Skip to content

Commit

Permalink
Use hex encoded bytes
Browse files Browse the repository at this point in the history
  • Loading branch information
thibault-martinez committed Oct 31, 2023
1 parent e9aac65 commit 5a458ae
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions sdk/tests/types/protocol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,12 @@ fn params_serde_hash() {
let protocol_params_bytes = protocol_params.pack_to_vec();

assert_eq!(
protocol_params_bytes,
[
0, 3, 10, 84, 101, 115, 116, 74, 117, 110, 103, 108, 101, 3, 116, 103, 108, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
193, 93, 45, 211, 247, 223, 9, 0, 46, 219, 11, 101, 0, 0, 0, 0, 10, 13, 63, 1, 17, 2, 0, 10, 0, 0, 0, 20,
0, 0, 0, 32, 151, 64, 76, 144, 21, 10, 0, 0, 0, 10, 10, 0, 0, 0, 15, 0, 30, 0, 10, 0, 0, 0, 20, 0, 0, 0,
24, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 53, 12, 0, 32, 161,
7, 0, 160, 134, 1, 0, 232, 3, 0, 0, 100, 0, 0, 0, 7, 5, 7, 8, 130, 4, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 8, 1,
0, 0, 0, 0, 0, 0, 0, 31
]
prefix_hex::encode(protocol_params_bytes),
"0x00030a546573744a756e676c650374676c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000003f011102000a000000140000002097404c9015c15d2dd3f7df09002edb0b65000000000a0d0a0000000a0a0000000f001e000a000000140000001800000001000000000000000000000000000000000000000000000000350c0020a10700a0860100e803000064000000070507088204000002000000000000000801000000000000001f"
);

assert_eq!(
protocol_params.hash().to_string(),
"0x0c00425134785bf2dbe42e4ec7e288009ebdc38ced797beaa45d5213092021cb"
"0x55dad02be983b85257ca6481ce51d77cd250a91c9ce7fe6b1db7295301297d7a"
);
}

0 comments on commit 5a458ae

Please sign in to comment.