@@ -485,7 +485,7 @@ pub struct JettonMasterData {
485485 #[ serde( with = "serde_helpers::string" ) ]
486486 pub total_supply : num_bigint:: BigInt ,
487487 pub mintable : bool ,
488- #[ serde( with = "serde_helpers::option_tonlib_address " ) ]
488+ #[ serde( with = "tonlib_address_or_empty " ) ]
489489 pub admin_address : Option < StdAddr > ,
490490 #[ serde( serialize_with = "JettonMasterData::serialize_jetton_conent" ) ]
491491 pub jetton_content : TokenDataAttributes ,
@@ -908,9 +908,9 @@ pub struct TonlibMessage {
908908 pub ty : & ' static str ,
909909 #[ serde( with = "serde_helpers::tonlib_hash" ) ]
910910 pub hash : HashBytes ,
911- #[ serde( with = "serde_helpers::option_tonlib_address " ) ]
911+ #[ serde( with = "tonlib_address_or_empty " ) ]
912912 pub source : Option < StdAddr > ,
913- #[ serde( with = "serde_helpers::option_tonlib_address " ) ]
913+ #[ serde( with = "tonlib_address_or_empty " ) ]
914914 pub destination : Option < StdAddr > ,
915915 #[ serde( with = "serde_helpers::string" ) ]
916916 pub value : Tokens ,
@@ -1818,6 +1818,20 @@ mod code_hash {
18181818 ] ) ;
18191819}
18201820
1821+ mod tonlib_address_or_empty {
1822+ use super :: * ;
1823+
1824+ pub fn serialize < S > ( value : & Option < StdAddr > , serializer : S ) -> Result < S :: Ok , S :: Error >
1825+ where
1826+ S : serde:: Serializer ,
1827+ {
1828+ match value {
1829+ Some ( value) => serde_helpers:: tonlib_address:: serialize ( value, serializer) ,
1830+ None => serializer. serialize_str ( "" ) ,
1831+ }
1832+ }
1833+ }
1834+
18211835#[ cfg( test) ]
18221836mod tests {
18231837 use super :: * ;
0 commit comments