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
3232
33use crate::{33use crate::{
34 Pallet, CollectionHandle, Config, CollectionProperties,34 Pallet, CollectionHandle, Config, CollectionProperties,
35 eth::convert_substrate_address_to_cross_account_id,35 eth::{convert_cross_account_to_uint256, convert_uint256_to_cross_account},
36};36};
3737
38/// Events for ethereum collection helper.38/// Events for ethereum collection helper.
63#[solidity_interface(name = Collection)]63#[solidity_interface(name = Collection)]
64impl<T: Config> CollectionHandle<T>64impl<T: Config> CollectionHandle<T>
65where65where
66 T::AccountId: From<[u8; 32]> + AsRef<[u8]>,66 T::AccountId: From<[u8; 32]> + AsRef<[u8; 32]>,
67{67{
68 /// Set collection property.68 /// Set collection property.
69 ///69 ///
177 SponsorshipState::Confirmed(ref sponsor) => sponsor,177 SponsorshipState::Confirmed(ref sponsor) => sponsor,
178 };178 };
179 let sponsor = T::CrossAccountId::from_sub(sponsor.clone());179 let sponsor = T::CrossAccountId::from_sub(sponsor.clone());
180 let sponsor_sub = convert_cross_account_to_uint256::<T>(&sponsor)?;180 let sponsor_sub = convert_cross_account_to_uint256::<T>(&sponsor);
181 Ok((*sponsor.as_eth(), sponsor_sub))181 Ok((*sponsor.as_eth(), sponsor_sub))
182 }182 }
183183
274 new_admin: uint256,274 new_admin: uint256,
275 ) -> Result<void> {275 ) -> Result<void> {
276 let caller = T::CrossAccountId::from_eth(caller);276 let caller = T::CrossAccountId::from_eth(caller);
277 let new_admin = convert_substrate_address_to_cross_account_id::<T>(new_admin);277 let new_admin = convert_uint256_to_cross_account::<T>(new_admin);
278 <Pallet<T>>::toggle_admin(self, &caller, &new_admin, true).map_err(dispatch_to_evm::<T>)?;278 <Pallet<T>>::toggle_admin(self, &caller, &new_admin, true).map_err(dispatch_to_evm::<T>)?;
279 Ok(())279 Ok(())
280 }280 }
287 admin: uint256,287 admin: uint256,
288 ) -> Result<void> {288 ) -> Result<void> {
289 let caller = T::CrossAccountId::from_eth(caller);289 let caller = T::CrossAccountId::from_eth(caller);
290 let admin = convert_substrate_address_to_cross_account_id::<T>(admin);290 let admin = convert_uint256_to_cross_account::<T>(admin);
291 <Pallet<T>>::toggle_admin(self, &caller, &admin, false).map_err(dispatch_to_evm::<T>)?;291 <Pallet<T>>::toggle_admin(self, &caller, &admin, false).map_err(dispatch_to_evm::<T>)?;
292 Ok(())292 Ok(())
293 }293 }
461 /// @param user account to verify461 /// @param user account to verify
462 /// @return "true" if account is the owner or admin462 /// @return "true" if account is the owner or admin
463 fn is_owner_or_admin_substrate(&self, user: uint256) -> Result<bool> {463 fn is_owner_or_admin_substrate(&self, user: uint256) -> Result<bool> {
464 let user = convert_substrate_address_to_cross_account_id::<T>(user);464 let user = convert_uint256_to_cross_account::<T>(user);
465 Ok(self.is_owner_or_admin(&user))465 Ok(self.is_owner_or_admin(&user))
466 }466 }
467467
494 /// @param newOwner new owner substrate account494 /// @param newOwner new owner substrate account
495 fn set_owner_substrate(&mut self, caller: caller, new_owner: uint256) -> Result<void> {495 fn set_owner_substrate(&mut self, caller: caller, new_owner: uint256) -> Result<void> {
496 let caller = T::CrossAccountId::from_eth(caller);496 let caller = T::CrossAccountId::from_eth(caller);
497 let new_owner = convert_substrate_address_to_cross_account_id::<T>(new_owner);497 let new_owner = convert_uint256_to_cross_account::<T>(new_owner);
498 self.set_owner_internal(caller, new_owner)498 self.set_owner_internal(caller, new_owner)
499 .map_err(dispatch_to_evm::<T>)499 .map_err(dispatch_to_evm::<T>)
500 }500 }
modifiedpallets/fungible/src/erc.rsdiffbeforeafterboth
--- a/pallets/fungible/src/erc.rs
+++ b/pallets/fungible/src/erc.rs
@@ -154,14 +154,14 @@
 		Collection(common_mut, CollectionHandle<T>),
 	)
 )]
-impl<T: Config> FungibleHandle<T> where T::AccountId: From<[u8; 32]> + AsRef<[u8]> {}
+impl<T: Config> FungibleHandle<T> where T::AccountId: From<[u8; 32]> + AsRef<[u8; 32]> {}
 
 generate_stubgen!(gen_impl, UniqueFungibleCall<()>, true);
 generate_stubgen!(gen_iface, UniqueFungibleCall<()>, false);
 
 impl<T: Config> CommonEvmHandler for FungibleHandle<T>
 where
-	T::AccountId: From<[u8; 32]> + AsRef<[u8]>,
+	T::AccountId: From<[u8; 32]> + AsRef<[u8; 32]>,
 {
 	const CODE: &'static [u8] = include_bytes!("./stubs/UniqueFungible.raw");
 
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()