File tree Expand file tree Collapse file tree 3 files changed +8
-1
lines changed Expand file tree Collapse file tree 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 {
185185 "tb" => Ok ( Currency :: BitcoinTestnet ) ,
186186 "bcrt" => Ok ( Currency :: Regtest ) ,
187187 "sb" => Ok ( Currency :: Simnet ) ,
188+ "tbs" => Ok ( Currency :: Signet ) ,
188189 _ => Err ( ParseError :: UnknownCurrency )
189190 }
190191 }
@@ -774,6 +775,7 @@ mod test {
774775 assert_eq ! ( "tb" . parse:: <Currency >( ) , Ok ( Currency :: BitcoinTestnet ) ) ;
775776 assert_eq ! ( "bcrt" . parse:: <Currency >( ) , Ok ( Currency :: Regtest ) ) ;
776777 assert_eq ! ( "sb" . parse:: <Currency >( ) , Ok ( Currency :: Simnet ) ) ;
778+ assert_eq ! ( "tbs" . parse:: <Currency >( ) , Ok ( Currency :: Signet ) ) ;
777779 assert_eq ! ( "something_else" . parse:: <Currency >( ) , Err ( ParseError :: UnknownCurrency ) )
778780 }
779781
Original file line number Diff line number Diff line change @@ -328,8 +328,11 @@ pub enum Currency {
328328 /// Bitcoin regtest
329329 Regtest ,
330330
331- /// Bitcoin simnet/signet
331+ /// Bitcoin simnet
332332 Simnet ,
333+
334+ /// Bitcoin signet
335+ Signet ,
333336}
334337
335338/// 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 {
153153 Currency :: BitcoinTestnet => "tb" ,
154154 Currency :: Regtest => "bcrt" ,
155155 Currency :: Simnet => "sb" ,
156+ Currency :: Signet => "tbs" ,
156157 } ;
157158 write ! ( f, "{}" , currency_code)
158159 }
@@ -473,6 +474,7 @@ mod test {
473474 assert_eq ! ( "tb" , Currency :: BitcoinTestnet . to_string( ) ) ;
474475 assert_eq ! ( "bcrt" , Currency :: Regtest . to_string( ) ) ;
475476 assert_eq ! ( "sb" , Currency :: Simnet . to_string( ) ) ;
477+ assert_eq ! ( "tbs" , Currency :: Signet . to_string( ) ) ;
476478 }
477479
478480 #[ test]
You can’t perform that action at this time.
0 commit comments