git.delta.rocks / unique-network / refs/commits / 20c99441bd57

difftreelog

Merge pull request #707 from UniqueNetwork/feature/add_test-abi--test--encode_decode_vec_tuple_string_bytes

Yaroslav Bolyukin2022-11-09parents: #1139d7d #97b5811.patch.diff
in: master
add test abi::test::encode_decode_vec_tuple_string_bytes

2 files changed

modifiedcrates/evm-coder/src/abi.rsdiffbeforeafterboth
808 )808 )
809 );809 );
810
811 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, 0x11
823 ])
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, 0x22
832 ])
833 ),
834 ("Test URI 2".to_string(), bytes(vec![0x33, 0x33])),
835 ],
836 &hex!(
837 "
838 deadbeef
839 0000000000000000000000000000000000000000000000000000000000000020
840 0000000000000000000000000000000000000000000000000000000000000003
841
842 0000000000000000000000000000000000000000000000000000000000000060
843 0000000000000000000000000000000000000000000000000000000000000140
844 0000000000000000000000000000000000000000000000000000000000000220
845
846 0000000000000000000000000000000000000000000000000000000000000040
847 0000000000000000000000000000000000000000000000000000000000000080
848 000000000000000000000000000000000000000000000000000000000000000a
849 5465737420555249203000000000000000000000000000000000000000000000
850 0000000000000000000000000000000000000000000000000000000000000030
851 1111111111111111111111111111111111111111111111111111111111111111
852 1111111111111111111111111111111100000000000000000000000000000000
853
854 0000000000000000000000000000000000000000000000000000000000000040
855 0000000000000000000000000000000000000000000000000000000000000080
856 000000000000000000000000000000000000000000000000000000000000000a
857 5465737420555249203100000000000000000000000000000000000000000000
858 000000000000000000000000000000000000000000000000000000000000002f
859 2222222222222222222222222222222222222222222222222222222222222222
860 2222222222222222222222222222220000000000000000000000000000000000
861
862 0000000000000000000000000000000000000000000000000000000000000040
863 0000000000000000000000000000000000000000000000000000000000000080
864 000000000000000000000000000000000000000000000000000000000000000a
865 5465737420555249203200000000000000000000000000000000000000000000
866 0000000000000000000000000000000000000000000000000000000000000002
867 3333000000000000000000000000000000000000000000000000000000000000
868 "
869 )
870 );
810871
811 #[test]872 #[test]
812 fn dynamic_after_static() {873 fn dynamic_after_static() {
modifiedcrates/evm-coder/src/lib.rsdiffbeforeafterboth
--- a/crates/evm-coder/src/lib.rs
+++ b/crates/evm-coder/src/lib.rs
@@ -163,7 +163,7 @@
 	#[cfg(feature = "std")]
 	define_simple_type!(type string = ::std::string::String);
 
-	#[derive(Default, Debug)]
+	#[derive(Default, Debug, PartialEq)]
 	pub struct bytes(pub Vec<u8>);
 	impl Signature for bytes {
 		const SIGNATURE: SignatureUnit = make_signature!(new fixed("bytes"));