--- a/pallets/common/src/erc.rs +++ b/pallets/common/src/erc.rs @@ -49,7 +49,7 @@ #[solidity_interface(name = "Collection")] impl CollectionHandle where - T::AccountId: From<[u8; 32]> + T::AccountId: From<[u8; 32]>, { fn set_collection_property(&mut self, caller: caller, key: string, value: bytes) -> Result<()> { let caller = T::CrossAccountId::from_eth(caller); @@ -176,12 +176,15 @@ new_admin.to_big_endian(&mut new_admin_arr); let account_id = T::AccountId::from(new_admin_arr); let new_admin = T::CrossAccountId::from_sub(account_id); - >::toggle_admin(self, &caller, &new_admin, true) - .map_err(dispatch_to_evm::)?; + >::toggle_admin(self, &caller, &new_admin, true).map_err(dispatch_to_evm::)?; Ok(()) } - fn remove_collection_admin_substrate(&self, caller: caller, new_admin: uint256) -> Result { + fn remove_collection_admin_substrate( + &self, + caller: caller, + new_admin: uint256, + ) -> Result { let caller = T::CrossAccountId::from_eth(caller); let mut new_admin_arr: [u8; 32] = Default::default(); new_admin.to_big_endian(&mut new_admin_arr); @@ -195,16 +198,14 @@ fn add_collection_admin(&self, caller: caller, new_admin: address) -> Result { let caller = T::CrossAccountId::from_eth(caller); let new_admin = T::CrossAccountId::from_eth(new_admin); - >::toggle_admin(self, &caller, &new_admin, true) - .map_err(dispatch_to_evm::)?; + >::toggle_admin(self, &caller, &new_admin, true).map_err(dispatch_to_evm::)?; Ok(()) } fn remove_admin(&self, caller: caller, admin: address) -> Result { let caller = T::CrossAccountId::from_eth(caller); let admin = T::CrossAccountId::from_eth(admin); - >::toggle_admin(self, &caller, &admin, false) - .map_err(dispatch_to_evm::)?; + >::toggle_admin(self, &caller, &admin, false).map_err(dispatch_to_evm::)?; Ok(()) } @@ -233,9 +234,9 @@ true => { let mut bv = OwnerRestrictedSet::new(); for i in collections { - bv.try_insert(crate::eth::map_eth_to_id(&i).ok_or_else(|| Error::Revert( - "Can't convert address into collection id".into(), - ))?) + bv.try_insert(crate::eth::map_eth_to_id(&i).ok_or_else(|| { + Error::Revert("Can't convert address into collection id".into()) + })?) .map_err(|e| Error::Revert(format!("{:?}", e)))?; } NestingRule::OwnerRestricted (bv) @@ -259,16 +260,14 @@ fn add_to_collection_allow_list(&self, caller: caller, user: address) -> Result { let caller = T::CrossAccountId::from_eth(caller); let user = T::CrossAccountId::from_eth(user); - >::toggle_allowlist(self, &caller, &user, true) - .map_err(dispatch_to_evm::)?; + >::toggle_allowlist(self, &caller, &user, true).map_err(dispatch_to_evm::)?; Ok(()) } fn remove_from_collection_allow_list(&self, caller: caller, user: address) -> Result { let caller = T::CrossAccountId::from_eth(caller); let user = T::CrossAccountId::from_eth(user); - >::toggle_allowlist(self, &caller, &user, false) - .map_err(dispatch_to_evm::)?; + >::toggle_allowlist(self, &caller, &user, false).map_err(dispatch_to_evm::)?; Ok(()) } --- a/pallets/fungible/src/erc.rs +++ b/pallets/fungible/src/erc.rs @@ -152,17 +152,14 @@ via("CollectionHandle", common_mut, Collection) ) )] -impl FungibleHandle -where - T::AccountId: From<[u8; 32]> -{} +impl FungibleHandle where T::AccountId: From<[u8; 32]> {} generate_stubgen!(gen_impl, UniqueFungibleCall<()>, true); generate_stubgen!(gen_iface, UniqueFungibleCall<()>, false); impl CommonEvmHandler for FungibleHandle where - T::AccountId: From<[u8; 32]> + T::AccountId: From<[u8; 32]>, { const CODE: &'static [u8] = include_bytes!("./stubs/UniqueFungible.raw"); --- a/pallets/nonfungible/src/erc.rs +++ b/pallets/nonfungible/src/erc.rs @@ -583,10 +583,7 @@ TokenProperties, ) )] -impl NonfungibleHandle -where - T::AccountId: From<[u8; 32]> -{} +impl NonfungibleHandle where T::AccountId: From<[u8; 32]> {} // Not a tests, but code generators generate_stubgen!(gen_impl, UniqueNFTCall<()>, true); @@ -594,7 +591,7 @@ impl CommonEvmHandler for NonfungibleHandle where - T::AccountId: From<[u8; 32]> + T::AccountId: From<[u8; 32]>, { const CODE: &'static [u8] = include_bytes!("./stubs/UniqueNFT.raw");