File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -878,6 +878,8 @@ pub struct Bip9SoftforkInfo {
878
878
pub enum SoftforkType {
879
879
Buried ,
880
880
Bip9 ,
881
+ #[ serde( other) ]
882
+ Unknown ,
881
883
}
882
884
883
885
/// Status of a softfork
@@ -2078,3 +2080,18 @@ where
2078
2080
}
2079
2081
Ok ( Some ( res) )
2080
2082
}
2083
+
2084
+ #[ cfg( test) ]
2085
+ mod tests {
2086
+ use super :: * ;
2087
+
2088
+ #[ test]
2089
+ fn test_softfork_type ( ) {
2090
+ let buried: SoftforkType = serde_json:: from_str ( "\" buried\" " ) . unwrap ( ) ;
2091
+ assert_eq ! ( buried, SoftforkType :: Buried ) ;
2092
+ let bip9: SoftforkType = serde_json:: from_str ( "\" bip9\" " ) . unwrap ( ) ;
2093
+ assert_eq ! ( bip9, SoftforkType :: Bip9 ) ;
2094
+ let unknown: SoftforkType = serde_json:: from_str ( "\" bip8\" " ) . unwrap ( ) ;
2095
+ assert_eq ! ( unknown, SoftforkType :: Unknown ) ;
2096
+ }
2097
+ }
You can’t perform that action at this time.
0 commit comments