@@ -2049,11 +2049,11 @@ mod test {
2049
2049
#[ test]
2050
2050
fn test_deserialize_state_machine_update ( ) {
2051
2051
let signer_message = StateMachineUpdate {
2052
- burn_block : ConsensusHash :: from_bytes ( & [ 0x55 ; 20 ] ) . unwrap ( ) ,
2052
+ burn_block : ConsensusHash ( [ 0x55 ; 20 ] ) ,
2053
2053
burn_block_height : 100 ,
2054
- current_miner_pkh : Hash160 :: from_data ( & [ 0xab ; 32 ] ) ,
2055
- parent_tenure_id : ConsensusHash :: from_bytes ( & [ 0x22 ; 20 ] ) . unwrap ( ) ,
2056
- parent_tenure_last_block : StacksBlockId ( [ 0x33u8 ; 32 ] ) ,
2054
+ current_miner_pkh : Hash160 ( [ 0xab ; 20 ] ) ,
2055
+ parent_tenure_id : ConsensusHash ( [ 0x22 ; 20 ] ) ,
2056
+ parent_tenure_last_block : StacksBlockId ( [ 0x33 ; 32 ] ) ,
2057
2057
parent_tenure_last_block_height : 1 ,
2058
2058
active_signer_protocol_version : 2 ,
2059
2059
local_supported_signer_protocol_version : 3 ,
@@ -2062,6 +2062,20 @@ mod test {
2062
2062
let mut bytes = vec ! [ ] ;
2063
2063
signer_message. consensus_serialize ( & mut bytes) . unwrap ( ) ;
2064
2064
2065
+ // check for raw content for avoiding regressions when structure changes
2066
+ let raw_signer_message: Vec < & [ u8 ] > = vec ! [
2067
+ /* burn_block*/ & [ 0x55 ; 20 ] ,
2068
+ /* burn_block_height*/ & [ 0 , 0 , 0 , 0 , 0 , 0 , 0 , 100 ] ,
2069
+ /* current_miner_pkh */ & [ 0xab ; 20 ] ,
2070
+ /* parent_tenure_id*/ & [ 0x22 ; 20 ] ,
2071
+ /* parent_tenure_last_block */ & [ 0x33 ; 32 ] ,
2072
+ /* parent_tenure_last_block_height*/ & [ 0 , 0 , 0 , 0 , 0 , 0 , 0 , 1 ] ,
2073
+ /* active_signer_protocol_version*/ & [ 0 , 0 , 0 , 0 , 0 , 0 , 0 , 2 ] ,
2074
+ /* local_supported_signer_protocol_version*/ & [ 0 , 0 , 0 , 0 , 0 , 0 , 0 , 3 ] ,
2075
+ ] ;
2076
+
2077
+ assert_eq ! ( bytes, raw_signer_message. concat( ) ) ;
2078
+
2065
2079
let signer_message_deserialized =
2066
2080
StateMachineUpdate :: consensus_deserialize ( & mut & bytes[ ..] ) . unwrap ( ) ;
2067
2081
0 commit comments