git.delta.rocks / unique-network / refs/commits / 01896baccffe

difftreelog

fix after rebase

Trubnikov Sergey2022-10-13parent: #b44fe9b.patch.diff
in: master

7 files changed

modifiedCargo.lockdiffbeforeafterboth
before · Cargo.lock
1049 packageslockfile v3
after · Cargo.lock
1049 packageslockfile v3
modifiedcrates/evm-coder/Cargo.tomldiffbeforeafterboth
--- a/crates/evm-coder/Cargo.toml
+++ b/crates/evm-coder/Cargo.toml
@@ -6,7 +6,7 @@
 
 [dependencies]
 const_format = { version = "0.2.26", default-features = false }
-sha3-const = { version = "0.1.0", default-features = false }
+sha3-const = { version = "0.1.1", default-features = false }
 # Ethereum uses keccak (=sha3) for selectors
 # sha3 = "0.10.1"
 # evm-coder reexports those proc-macro
@@ -22,7 +22,7 @@
 # We have tuple-heavy code in solidity.rs
 impl-trait-for-tuples = "0.2.2"
 
-pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" }
+pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29" }
 
 [dev-dependencies]
 # We want to assert some large binary blobs equality in tests
modifiedcrates/evm-coder/procedural/src/solidity_interface.rsdiffbeforeafterboth
--- a/crates/evm-coder/procedural/src/solidity_interface.rs
+++ b/crates/evm-coder/procedural/src/solidity_interface.rs
@@ -895,7 +895,7 @@
 		};
 		custom_signature.extend(custom_signature_group.to_token_stream());
 
-		// println!("!!!!! {}", custom_signature);
+		println!("!!!!! {}", custom_signature);
 		custom_signature
 	}
 
modifiedcrates/evm-coder/src/abi.rsdiffbeforeafterboth
--- a/crates/evm-coder/src/abi.rs
+++ b/crates/evm-coder/src/abi.rs
@@ -424,44 +424,16 @@
 	fn is_dynamic() -> bool {
 		address::is_dynamic() || uint256::is_dynamic()
 	}
-}
 
-impl AbiRead<EthCrossAccount> for AbiReader<'_> {
-	fn abi_read(&mut self) -> Result<EthCrossAccount> {
-		let size = if !EthCrossAccount::is_dynamic() {
-			Some(<Self as AbiRead<EthCrossAccount>>::size())
-		} else {
-			None
-		};
-		let mut subresult = self.subresult(size)?;
-		let eth = <Self as AbiRead<address>>::abi_read(&mut subresult)?;
-		let sub = <Self as AbiRead<uint256>>::abi_read(&mut subresult)?;
-
-		Ok(EthCrossAccount { eth: eth, sub: sub })
-	}
-
 	fn size() -> usize {
-		<Self as AbiRead<address>>::size() + <Self as AbiRead<uint256>>::size()
-	}
-}
-
-impl AbiWrite for &EthCrossAccount {
-	fn abi_write(&self, writer: &mut AbiWriter) {
-		self.eth.abi_write(writer);
-		self.sub.abi_write(writer);
+		<address as TypeHelper>::size() + <uint256 as TypeHelper>::size()
 	}
 }
 
-impl TypeHelper for EthCrossAccount {
-	fn is_dynamic() -> bool {
-		address::is_dynamic() || uint256::is_dynamic()
-	}
-}
-
 impl AbiRead<EthCrossAccount> for AbiReader<'_> {
 	fn abi_read(&mut self) -> Result<EthCrossAccount> {
 		let size = if !EthCrossAccount::is_dynamic() {
-			Some(<Self as AbiRead<EthCrossAccount>>::size())
+			Some(<EthCrossAccount as TypeHelper>::size())
 		} else {
 			None
 		};
@@ -469,11 +441,7 @@
 		let eth = <Self as AbiRead<address>>::abi_read(&mut subresult)?;
 		let sub = <Self as AbiRead<uint256>>::abi_read(&mut subresult)?;
 
-		Ok(EthCrossAccount { eth: eth, sub: sub })
-	}
-
-	fn size() -> usize {
-		<Self as AbiRead<address>>::size() + <Self as AbiRead<uint256>>::size()
+		Ok(EthCrossAccount { eth, sub })
 	}
 }
 
modifiedcrates/evm-coder/src/lib.rsdiffbeforeafterboth
--- a/crates/evm-coder/src/lib.rs
+++ b/crates/evm-coder/src/lib.rs
@@ -169,6 +169,7 @@
 		}
 	}
 
+	#[allow(clippy::from_over_into)]
 	impl Into<Vec<u8>> for bytes {
 		fn into(self) -> Vec<u8> {
 			self.0
modifiedcrates/evm-coder/src/solidity.rsdiffbeforeafterboth
--- a/crates/evm-coder/src/solidity.rs
+++ b/crates/evm-coder/src/solidity.rs
@@ -35,12 +35,6 @@
 use crate::types::*;
 
 #[derive(Default)]
-pub struct FunctionSelectorMaker {
-	pub name: string,
-	pub args: Vec<fn() -> string>,
-}
-
-#[derive(Default)]
 pub struct TypeCollector {
 	/// Code => id
 	/// id ordering is required to perform topo-sort on the resulting data
@@ -488,19 +482,6 @@
 	View,
 	Mutable,
 }
-
-// fn fn_selector_str(input: &str) -> u32 {
-// 	use sha3::Digest;
-// 	let mut hasher = sha3::Keccak256::new();
-// 	hasher.update(input.as_bytes());
-// 	let result = hasher.finalize();
-
-// 	let mut selector_bytes = [0; 4];
-// 	selector_bytes.copy_from_slice(&result[0..4]);
-
-// 	u32::from_be_bytes(selector_bytes)
-// }
-
 pub struct SolidityFunction<A, R> {
 	pub docs: &'static [&'static str],
 	pub selector_str: &'static str,
modifiedpallets/common/src/eth.rsdiffbeforeafterboth
--- a/pallets/common/src/eth.rs
+++ b/pallets/common/src/eth.rs
@@ -16,7 +16,7 @@
 
 //! The module contains a number of functions for converting and checking ethereum identifiers.
 
-use evm_coder::types::{uint256, address, EthCrossAccount};
+use evm_coder::types::{uint256, address};
 pub use pallet_evm::account::{Config, CrossAccountId};
 use sp_core::H160;
 use up_data_structs::CollectionId;