File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -1017,6 +1017,7 @@ pub enum StringOrStringArray {
1017
1017
pub struct GetBlockchainInfoResult {
1018
1018
/// Current network name as defined in BIP70 (main, test, signet, regtest)
1019
1019
#[ serde( deserialize_with = "deserialize_bip70_network" ) ]
1020
+ #[ serde( serialize_with = "serialize_bip70_network" ) ]
1020
1021
pub chain : Network ,
1021
1022
/// The current number of blocks processed in the server
1022
1023
pub blocks : u64 ,
@@ -2190,6 +2191,13 @@ where
2190
2191
Ok ( Some ( res) )
2191
2192
}
2192
2193
2194
+ fn serialize_bip70_network < S > ( network : & Network , serializer : S ) -> Result < S :: Ok , S :: Error >
2195
+ where
2196
+ S : serde:: Serializer ,
2197
+ {
2198
+ serializer. serialize_str ( network. to_core_arg ( ) )
2199
+ }
2200
+
2193
2201
/// deserialize_bip70_network deserializes a Bitcoin Core network according to BIP70
2194
2202
/// The accepted input variants are: {"main", "test", "signet", "regtest"}
2195
2203
fn deserialize_bip70_network < ' de , D > ( deserializer : D ) -> Result < Network , D :: Error >
You can’t perform that action at this time.
0 commit comments