File tree 3 files changed +8
-1
lines changed
3 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -185,6 +185,7 @@ impl FromStr for super::Currency {
185
185
"tb" => Ok ( Currency :: BitcoinTestnet ) ,
186
186
"bcrt" => Ok ( Currency :: Regtest ) ,
187
187
"sb" => Ok ( Currency :: Simnet ) ,
188
+ "tbs" => Ok ( Currency :: Signet ) ,
188
189
_ => Err ( ParseError :: UnknownCurrency )
189
190
}
190
191
}
@@ -774,6 +775,7 @@ mod test {
774
775
assert_eq ! ( "tb" . parse:: <Currency >( ) , Ok ( Currency :: BitcoinTestnet ) ) ;
775
776
assert_eq ! ( "bcrt" . parse:: <Currency >( ) , Ok ( Currency :: Regtest ) ) ;
776
777
assert_eq ! ( "sb" . parse:: <Currency >( ) , Ok ( Currency :: Simnet ) ) ;
778
+ assert_eq ! ( "tbs" . parse:: <Currency >( ) , Ok ( Currency :: Signet ) ) ;
777
779
assert_eq ! ( "something_else" . parse:: <Currency >( ) , Err ( ParseError :: UnknownCurrency ) )
778
780
}
779
781
Original file line number Diff line number Diff line change @@ -328,8 +328,11 @@ pub enum Currency {
328
328
/// Bitcoin regtest
329
329
Regtest ,
330
330
331
- /// Bitcoin simnet/signet
331
+ /// Bitcoin simnet
332
332
Simnet ,
333
+
334
+ /// Bitcoin signet
335
+ Signet ,
333
336
}
334
337
335
338
/// Tagged field which may have an unknown tag
Original file line number Diff line number Diff line change @@ -153,6 +153,7 @@ impl Display for Currency {
153
153
Currency :: BitcoinTestnet => "tb" ,
154
154
Currency :: Regtest => "bcrt" ,
155
155
Currency :: Simnet => "sb" ,
156
+ Currency :: Signet => "tbs" ,
156
157
} ;
157
158
write ! ( f, "{}" , currency_code)
158
159
}
@@ -473,6 +474,7 @@ mod test {
473
474
assert_eq ! ( "tb" , Currency :: BitcoinTestnet . to_string( ) ) ;
474
475
assert_eq ! ( "bcrt" , Currency :: Regtest . to_string( ) ) ;
475
476
assert_eq ! ( "sb" , Currency :: Simnet . to_string( ) ) ;
477
+ assert_eq ! ( "tbs" , Currency :: Signet . to_string( ) ) ;
476
478
}
477
479
478
480
#[ test]
You can’t perform that action at this time.
0 commit comments