@@ -10,7 +10,7 @@ use arm::{
1010 merkle_path:: MerklePath ,
1111 nullifier_key:: NullifierKey ,
1212 resource:: Resource ,
13- utils:: { bytes_to_words, hash_bytes, words_to_bytes} ,
13+ utils:: { bytes_to_words, hash_bytes, vec_u32 , words_to_bytes} ,
1414} ;
1515use serde:: { Deserialize , Serialize } ;
1616#[ derive( Clone , Debug , Default , Serialize , Deserialize ) ]
@@ -39,24 +39,32 @@ pub struct EncryptionInfo {
3939 // randomly generated for persistent resource_ciphertext
4040 pub sender_sk : SecretKey ,
4141 // randomly generated for persistent resource_ciphertext(12 bytes)
42+ #[ serde( with = "serde_bytes" ) ]
4243 pub encryption_nonce : Vec < u8 > ,
4344 // The discovery ciphertext for the resource
45+ #[ serde( with = "vec_u32" ) ]
4446 pub discovery_cipher : Vec < u32 > ,
4547}
4648
4749#[ derive( Clone , Debug , Serialize , Deserialize ) ]
4850pub struct ForwarderInfo {
4951 pub call_type : CallType ,
52+ #[ serde( with = "serde_bytes" ) ]
5053 pub forwarder_addr : Vec < u8 > ,
54+ #[ serde( with = "serde_bytes" ) ]
5155 pub token_addr : Vec < u8 > ,
56+ #[ serde( with = "serde_bytes" ) ]
5257 pub user_addr : Vec < u8 > ,
5358 pub permit_info : Option < PermitInfo > ,
5459}
5560
5661#[ derive( Clone , Debug , Serialize , Deserialize ) ]
5762pub struct PermitInfo {
63+ #[ serde( with = "serde_bytes" ) ]
5864 pub permit_nonce : Vec < u8 > ,
65+ #[ serde( with = "serde_bytes" ) ]
5966 pub permit_deadline : Vec < u8 > ,
67+ #[ serde( with = "serde_bytes" ) ]
6068 pub permit_sig : Vec < u8 > ,
6169}
6270
0 commit comments