git.delta.rocks / unique-network / refs/commits / f44eb92d414c

difftreelog

refactor abi tests

Trubnikov Sergey2022-11-14parent: #d4b9e94.patch.diff
in: master

1 file changed

modifiedcrates/evm-coder/src/abi/test.rsdiffbeforeafterboth
47 test_impl_uint!(uint32);47 test_impl_uint!(uint32);
48}48}
49
50#[test]
51fn encode_decode_uint64() {
52 test_impl_uint!(uint64);
53}
5449
55#[test]50#[test]
56fn encode_decode_uint128() {51fn encode_decode_uint128() {
57 test_impl_uint!(uint128);52 test_impl_uint!(uint128);
58}53}
59
60#[test]
61fn encode_decode_bool_true() {
62 test_impl::<bool>(
63 0xdeadbeef,
64 true,
65 &hex!(
66 "
67 deadbeef
68 0000000000000000000000000000000000000000000000000000000000000001
69 "
70 ),
71 );
72}
73
74#[test]
75fn encode_decode_bool_false() {
76 test_impl::<bool>(
77 0xdeadbeef,
78 false,
79 &hex!(
80 "
81 deadbeef
82 0000000000000000000000000000000000000000000000000000000000000000
83 "
84 ),
85 );
86}
8754
88#[test]55#[test]
89fn encode_decode_uint256() {56fn encode_decode_uint256() {
169 );136 );
170}137}
171
172#[test]
173fn encode_decode_vec_tuple_uint8_uint8() {
174 test_impl::<Vec<(u8, u8)>>(
175 0xdeadbeef,
176 vec![(0x0A, 0x0B), (0x0C, 0x0D), (0x0E, 0x0F)],
177 &hex!(
178 "
179 deadbeef
180 0000000000000000000000000000000000000000000000000000000000000020
181 0000000000000000000000000000000000000000000000000000000000000003
182 000000000000000000000000000000000000000000000000000000000000000a
183 000000000000000000000000000000000000000000000000000000000000000b
184 000000000000000000000000000000000000000000000000000000000000000c
185 000000000000000000000000000000000000000000000000000000000000000d
186 000000000000000000000000000000000000000000000000000000000000000e
187 000000000000000000000000000000000000000000000000000000000000000f
188 "
189 ),
190 );
191}
192138
193#[test]139#[test]
194fn encode_decode_vec_tuple_uint256_string() {140fn encode_decode_vec_tuple_uint256_string() {