From 67a4ea452077705d4b170254cea08b6f31af23f8 Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Mon, 29 Aug 2022 15:11:55 +0000 Subject: [PATCH] fix: Tuple size calculation. Some PR fixes. --- --- 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", --- a/crates/evm-coder/Cargo.toml +++ b/crates/evm-coder/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "evm-coder" -version = "0.1.2" +version = "0.1.3" license = "GPLv3" edition = "2021" --- 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)] --- 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" -- gitstuff