git.delta.rocks / unique-network / refs/commits / 41b5a1d1099f

difftreelog

fix After rebase

Trubnikov Sergey2022-08-25parent: #fd0a584.patch.diff
in: master

6 files changed

modifiedcrates/evm-coder/src/solidity.rsdiffbeforeafterboth
--- a/crates/evm-coder/src/solidity.rs
+++ b/crates/evm-coder/src/solidity.rs
@@ -479,7 +479,7 @@
 	}
 }
 
-#[impl_for_tuples(0, 24)]
+#[impl_for_tuples(0, 48)]
 impl SolidityFunctions for Tuple {
 	for_tuples!( where #( Tuple: SolidityFunctions ),* );
 
modifiedpallets/common/src/erc.rsdiffbeforeafterboth
--- a/pallets/common/src/erc.rs
+++ b/pallets/common/src/erc.rs
@@ -32,7 +32,7 @@
 
 use crate::{
 	Pallet, CollectionHandle, Config, CollectionProperties,
-	eth::convert_substrate_address_to_cross_account_id,
+	eth::{convert_cross_account_to_uint256, convert_uint256_to_cross_account},
 };
 
 /// Events for ethereum collection helper.
@@ -63,7 +63,7 @@
 #[solidity_interface(name = Collection)]
 impl<T: Config> CollectionHandle<T>
 where
-	T::AccountId: From<[u8; 32]> + AsRef<[u8]>,
+	T::AccountId: From<[u8; 32]> + AsRef<[u8; 32]>,
 {
 	/// Set collection property.
 	///
@@ -177,7 +177,7 @@
 			SponsorshipState::Confirmed(ref sponsor) => sponsor,
 		};
 		let sponsor = T::CrossAccountId::from_sub(sponsor.clone());
-		let sponsor_sub = convert_cross_account_to_uint256::<T>(&sponsor)?;
+		let sponsor_sub = convert_cross_account_to_uint256::<T>(&sponsor);
 		Ok((*sponsor.as_eth(), sponsor_sub))
 	}
 
@@ -274,7 +274,7 @@
 		new_admin: uint256,
 	) -> Result<void> {
 		let caller = T::CrossAccountId::from_eth(caller);
-		let new_admin = convert_substrate_address_to_cross_account_id::<T>(new_admin);
+		let new_admin = convert_uint256_to_cross_account::<T>(new_admin);
 		<Pallet<T>>::toggle_admin(self, &caller, &new_admin, true).map_err(dispatch_to_evm::<T>)?;
 		Ok(())
 	}
@@ -287,7 +287,7 @@
 		admin: uint256,
 	) -> Result<void> {
 		let caller = T::CrossAccountId::from_eth(caller);
-		let admin = convert_substrate_address_to_cross_account_id::<T>(admin);
+		let admin = convert_uint256_to_cross_account::<T>(admin);
 		<Pallet<T>>::toggle_admin(self, &caller, &admin, false).map_err(dispatch_to_evm::<T>)?;
 		Ok(())
 	}
@@ -461,7 +461,7 @@
 	/// @param user account to verify
 	/// @return "true" if account is the owner or admin
 	fn is_owner_or_admin_substrate(&self, user: uint256) -> Result<bool> {
-		let user = convert_substrate_address_to_cross_account_id::<T>(user);
+		let user = convert_uint256_to_cross_account::<T>(user);
 		Ok(self.is_owner_or_admin(&user))
 	}
 
@@ -494,7 +494,7 @@
 	/// @param newOwner new owner substrate account
 	fn set_owner_substrate(&mut self, caller: caller, new_owner: uint256) -> Result<void> {
 		let caller = T::CrossAccountId::from_eth(caller);
-		let new_owner = convert_substrate_address_to_cross_account_id::<T>(new_owner);
+		let new_owner = convert_uint256_to_cross_account::<T>(new_owner);
 		self.set_owner_internal(caller, new_owner)
 			.map_err(dispatch_to_evm::<T>)
 	}
modifiedpallets/fungible/src/erc.rsdiffbeforeafterboth
154 Collection(common_mut, CollectionHandle<T>),154 Collection(common_mut, CollectionHandle<T>),
155 )155 )
156)]156)]
157impl<T: Config> FungibleHandle<T> where T::AccountId: From<[u8; 32]> + AsRef<[u8]> {}157impl<T: Config> FungibleHandle<T> where T::AccountId: From<[u8; 32]> + AsRef<[u8; 32]> {}
158158
159generate_stubgen!(gen_impl, UniqueFungibleCall<()>, true);159generate_stubgen!(gen_impl, UniqueFungibleCall<()>, true);
160generate_stubgen!(gen_iface, UniqueFungibleCall<()>, false);160generate_stubgen!(gen_iface, UniqueFungibleCall<()>, false);
161161
162impl<T: Config> CommonEvmHandler for FungibleHandle<T>162impl<T: Config> CommonEvmHandler for FungibleHandle<T>
163where163where
164 T::AccountId: From<[u8; 32]> + AsRef<[u8]>,164 T::AccountId: From<[u8; 32]> + AsRef<[u8; 32]>,
165{165{
166 const CODE: &'static [u8] = include_bytes!("./stubs/UniqueFungible.raw");166 const CODE: &'static [u8] = include_bytes!("./stubs/UniqueFungible.raw");
167167
modifiedpallets/nonfungible/src/erc.rsdiffbeforeafterboth
--- a/pallets/nonfungible/src/erc.rs
+++ b/pallets/nonfungible/src/erc.rs
@@ -740,7 +740,7 @@
 		TokenProperties,
 	)
 )]
-impl<T: Config> NonfungibleHandle<T> where T::AccountId: From<[u8; 32]> + AsRef<[u8]> {}
+impl<T: Config> NonfungibleHandle<T> where T::AccountId: From<[u8; 32]> + AsRef<[u8; 32]> {}
 
 // Not a tests, but code generators
 generate_stubgen!(gen_impl, UniqueNFTCall<()>, true);
@@ -748,7 +748,7 @@
 
 impl<T: Config> CommonEvmHandler for NonfungibleHandle<T>
 where
-	T::AccountId: From<[u8; 32]> + AsRef<[u8]>,
+	T::AccountId: From<[u8; 32]> + AsRef<[u8; 32]>,
 {
 	const CODE: &'static [u8] = include_bytes!("./stubs/UniqueNFT.raw");
 
modifiedpallets/refungible/src/erc.rsdiffbeforeafterboth
--- a/pallets/refungible/src/erc.rs
+++ b/pallets/refungible/src/erc.rs
@@ -789,7 +789,7 @@
 		TokenProperties,
 	)
 )]
-impl<T: Config> RefungibleHandle<T> where T::AccountId: From<[u8; 32]> + AsRef<[u8]> {}
+impl<T: Config> RefungibleHandle<T> where T::AccountId: From<[u8; 32]> + AsRef<[u8; 32]> {}
 
 // Not a tests, but code generators
 generate_stubgen!(gen_impl, UniqueRefungibleCall<()>, true);
@@ -797,7 +797,7 @@
 
 impl<T: Config> CommonEvmHandler for RefungibleHandle<T>
 where
-	T::AccountId: From<[u8; 32]> + AsRef<[u8]>,
+	T::AccountId: From<[u8; 32]> + AsRef<[u8; 32]>,
 {
 	const CODE: &'static [u8] = include_bytes!("./stubs/UniqueRefungible.raw");
 	fn call(
modifiedruntime/common/dispatch.rsdiffbeforeafterboth
--- a/runtime/common/dispatch.rs
+++ b/runtime/common/dispatch.rs
@@ -124,7 +124,7 @@
 		+ pallet_fungible::Config
 		+ pallet_nonfungible::Config
 		+ pallet_refungible::Config,
-	T::AccountId: From<[u8; 32]> + AsRef<[u8]>,
+	T::AccountId: From<[u8; 32]> + AsRef<[u8; 32]>,
 {
 	fn is_reserved(target: &H160) -> bool {
 		map_eth_to_id(target).is_some()