difftreelog
misk: add unit tests
in: master
1 file changed
crates/evm-coder/src/abi/test.rsdiffbeforeafterboth539 assert_eq!(p2, 0x0b);539 assert_eq!(p2, 0x0b);540}540}541542#[test]543fn encode_decode_option_uint8_some() {544 test_impl::<Option<u8>>(545 0xdeadbeef,546 Some(44),547 &hex!(548 "549 deadbeef550 0000000000000000000000000000000000000000000000000000000000000001551 000000000000000000000000000000000000000000000000000000000000002c552 "553 ),554 );555}556557#[test]558fn encode_decode_option_uint8_none() {559 test_impl::<Option<u8>>(560 0xdeadbeef,561 None,562 &hex!(563 "564 deadbeef565 0000000000000000000000000000000000000000000000000000000000000000566 0000000000000000000000000000000000000000000000000000000000000000567 "568 ),569 );570}571572#[test]573fn encode_decode_option_string_some() {574 test_impl::<Option<String>>(575 0xdeadbeef,576 Some("some string".to_string()),577 &hex!(578 "579 deadbeef580 0000000000000000000000000000000000000000000000000000000000000020581 0000000000000000000000000000000000000000000000000000000000000001582 0000000000000000000000000000000000000000000000000000000000000040583 000000000000000000000000000000000000000000000000000000000000000b584 736f6d6520737472696e67000000000000000000000000000000000000000000585 "586 ),587 );588}589590#[test]591fn encode_decode_option_string_none() {592 test_impl::<Option<String>>(593 0xdeadbeef,594 None,595 &hex!(596 "597 deadbeef598 0000000000000000000000000000000000000000000000000000000000000020599 0000000000000000000000000000000000000000000000000000000000000000600 0000000000000000000000000000000000000000000000000000000000000040601 0000000000000000000000000000000000000000000000000000000000000000602 "603 ),604 );605}541606