git.delta.rocks / unique-network / refs/commits / 67a4ea452077

difftreelog

fix Tuple size calculation. Some PR fixes.

Trubnikov Sergey2022-08-29parent: #78a9952.patch.diff
in: master

4 files changed

modifiedCargo.lockdiffbeforeafterboth
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -2169,7 +2169,7 @@
 
 [[package]]
 name = "evm-coder"
-version = "0.1.2"
+version = "0.1.3"
 dependencies = [
  "ethereum",
  "evm-coder-procedural",
@@ -5749,7 +5749,7 @@
 
 [[package]]
 name = "pallet-fungible"
-version = "0.1.4"
+version = "0.1.5"
 dependencies = [
  "ethereum",
  "evm-coder",
modifiedcrates/evm-coder/Cargo.tomldiffbeforeafterboth
before · crates/evm-coder/Cargo.toml
1[package]2name = "evm-coder"3version = "0.1.2"4license = "GPLv3"5edition = "2021"67[dependencies]8# evm-coder reexports those proc-macro9evm-coder-procedural = { path = "./procedural" }10# Evm uses primitive-types for H160, H256 and others11primitive-types = { version = "0.11.1", default-features = false }12# Evm doesn't have reexports for log and others13ethereum = { version = "0.12.0", default-features = false }14sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" }15# Error types for execution16evm-core = { default-features = false , git = "https://github.com/uniquenetwork/evm", branch = "unique-polkadot-v0.9.27" }17# We have tuple-heavy code in solidity.rs18impl-trait-for-tuples = "0.2.2"1920[dev-dependencies]21# We want to assert some large binary blobs equality in tests22hex = "0.4.3"23hex-literal = "0.3.4"2425[features]26default = ["std"]27std = ["ethereum/std", "primitive-types/std", "evm-core/std"]
after · crates/evm-coder/Cargo.toml
1[package]2name = "evm-coder"3version = "0.1.3"4license = "GPLv3"5edition = "2021"67[dependencies]8# evm-coder reexports those proc-macro9evm-coder-procedural = { path = "./procedural" }10# Evm uses primitive-types for H160, H256 and others11primitive-types = { version = "0.11.1", default-features = false }12# Evm doesn't have reexports for log and others13ethereum = { version = "0.12.0", default-features = false }14sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" }15# Error types for execution16evm-core = { default-features = false , git = "https://github.com/uniquenetwork/evm", branch = "unique-polkadot-v0.9.27" }17# We have tuple-heavy code in solidity.rs18impl-trait-for-tuples = "0.2.2"1920[dev-dependencies]21# We want to assert some large binary blobs equality in tests22hex = "0.4.3"23hex-literal = "0.3.4"2425[features]26default = ["std"]27std = ["ethereum/std", "primitive-types/std", "evm-core/std"]
modifiedcrates/evm-coder/src/abi.rsdiffbeforeafterboth
--- a/crates/evm-coder/src/abi.rs
+++ b/crates/evm-coder/src/abi.rs
@@ -354,6 +354,15 @@
 				ABI_ALIGNMENT
 			}
 		}
+		impl AbiRead<$ty> for $ty {
+			fn abi_read(&mut self) -> Result<$ty> {
+				todo!("Refactor requered.")
+			}
+
+			fn size() -> usize {
+				ABI_ALIGNMENT
+			}
+		}
 	};
 }
 
@@ -412,6 +421,7 @@
 		where
 			$(
 				Self: AbiRead<$ident>,
+				$ident: AbiRead<$ident>,
 			)+
 			($($ident,)+): TypeHelper<($($ident,)+)>,
 		{
@@ -424,7 +434,7 @@
 			}
 
 			fn size() -> usize {
-				0 $(+ {let _ : $ident; ABI_ALIGNMENT})+
+				0 $(+ <$ident>::size())+
 			}
 		}
 		#[allow(non_snake_case)]
modifiedpallets/fungible/Cargo.tomldiffbeforeafterboth
--- a/pallets/fungible/Cargo.toml
+++ b/pallets/fungible/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "pallet-fungible"
-version = "0.1.4"
+version = "0.1.5"
 license = "GPLv3"
 edition = "2021"