From 89dc6e6bc9cf95a98f30a9257df21959e6e809e3 Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Tue, 07 Jun 2022 09:53:50 +0000 Subject: [PATCH] CORE-386 Add methods for adding substrate admins --- --- a/pallets/common/src/erc.rs +++ b/pallets/common/src/erc.rs @@ -47,10 +47,9 @@ } #[solidity_interface(name = "Collection")] - -impl CollectionHandle -// where -// T::AccountId: From +impl CollectionHandle +where + 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); --- a/pallets/fungible/src/erc.rs +++ b/pallets/fungible/src/erc.rs @@ -152,12 +152,18 @@ via("CollectionHandle", common_mut, Collection) ) )] -impl FungibleHandle {} +impl FungibleHandle +where + T::AccountId: From<[u8; 32]> +{} generate_stubgen!(gen_impl, UniqueFungibleCall<()>, true); generate_stubgen!(gen_iface, UniqueFungibleCall<()>, false); -impl CommonEvmHandler for FungibleHandle { +impl CommonEvmHandler for FungibleHandle +where + T::AccountId: From<[u8; 32]> +{ const CODE: &'static [u8] = include_bytes!("./stubs/UniqueFungible.raw"); fn call(self, handle: &mut impl PrecompileHandle) -> Option { --- a/pallets/nonfungible/src/erc.rs +++ b/pallets/nonfungible/src/erc.rs @@ -583,13 +583,19 @@ TokenProperties, ) )] -impl NonfungibleHandle {} +impl NonfungibleHandle +where + T::AccountId: From<[u8; 32]> +{} // Not a tests, but code generators generate_stubgen!(gen_impl, UniqueNFTCall<()>, true); generate_stubgen!(gen_iface, UniqueNFTCall<()>, false); -impl CommonEvmHandler for NonfungibleHandle { +impl CommonEvmHandler for NonfungibleHandle +where + T::AccountId: From<[u8; 32]> +{ const CODE: &'static [u8] = include_bytes!("./stubs/UniqueNFT.raw"); fn call(self, handle: &mut impl PrecompileHandle) -> Option { --- a/runtime/common/src/dispatch.rs +++ b/runtime/common/src/dispatch.rs @@ -96,6 +96,7 @@ + pallet_fungible::Config + pallet_nonfungible::Config + pallet_refungible::Config, + T::AccountId: From<[u8; 32]>, { fn is_reserved(target: &H160) -> bool { map_eth_to_id(target).is_some() -- gitstuff