difftreelog
Merge pull request #707 from UniqueNetwork/feature/add_test-abi--test--encode_decode_vec_tuple_string_bytes
in: master
add test abi::test::encode_decode_vec_tuple_string_bytes
2 files changed
crates/evm-coder/src/abi.rsdiffbeforeafterboth808 )808 )809 );809 );810811 test_impl!(812 vec_tuple_string_bytes,813 Vec<(string, bytes)>,814 0xdeadbeef,815 vec![816 (817 "Test URI 0".to_string(),818 bytes(vec![819 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11,820 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11,821 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11,822 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11823 ])824 ),825 (826 "Test URI 1".to_string(),827 bytes(vec![828 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22,829 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22,830 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22,831 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22832 ])833 ),834 ("Test URI 2".to_string(), bytes(vec![0x33, 0x33])),835 ],836 &hex!(837 "838 deadbeef839 0000000000000000000000000000000000000000000000000000000000000020840 0000000000000000000000000000000000000000000000000000000000000003841 842 0000000000000000000000000000000000000000000000000000000000000060843 0000000000000000000000000000000000000000000000000000000000000140844 0000000000000000000000000000000000000000000000000000000000000220845846 0000000000000000000000000000000000000000000000000000000000000040847 0000000000000000000000000000000000000000000000000000000000000080848 000000000000000000000000000000000000000000000000000000000000000a849 5465737420555249203000000000000000000000000000000000000000000000850 0000000000000000000000000000000000000000000000000000000000000030851 1111111111111111111111111111111111111111111111111111111111111111852 1111111111111111111111111111111100000000000000000000000000000000853854 0000000000000000000000000000000000000000000000000000000000000040855 0000000000000000000000000000000000000000000000000000000000000080856 000000000000000000000000000000000000000000000000000000000000000a857 5465737420555249203100000000000000000000000000000000000000000000858 000000000000000000000000000000000000000000000000000000000000002f859 2222222222222222222222222222222222222222222222222222222222222222860 2222222222222222222222222222220000000000000000000000000000000000861862 0000000000000000000000000000000000000000000000000000000000000040863 0000000000000000000000000000000000000000000000000000000000000080864 000000000000000000000000000000000000000000000000000000000000000a865 5465737420555249203200000000000000000000000000000000000000000000866 0000000000000000000000000000000000000000000000000000000000000002867 3333000000000000000000000000000000000000000000000000000000000000868 "869 )870 );810871811 #[test]872 #[test]812 fn dynamic_after_static() {873 fn dynamic_after_static() {crates/evm-coder/src/lib.rsdiffbeforeafterboth163 #[cfg(feature = "std")]163 #[cfg(feature = "std")]164 define_simple_type!(type string = ::std::string::String);164 define_simple_type!(type string = ::std::string::String);165165166 #[derive(Default, Debug)]166 #[derive(Default, Debug, PartialEq)]167 pub struct bytes(pub Vec<u8>);167 pub struct bytes(pub Vec<u8>);168 impl Signature for bytes {168 impl Signature for bytes {169 const SIGNATURE: SignatureUnit = make_signature!(new fixed("bytes"));169 const SIGNATURE: SignatureUnit = make_signature!(new fixed("bytes"));