git.delta.rocks / unique-network / refs/commits / 89dc6e6bc9cf

difftreelog

CORE-386 Add methods for adding substrate admins

Trubnikov Sergey2022-06-07parent: #984c76e.patch.diff
in: master

4 files changed

modifiedpallets/common/src/erc.rsdiffbeforeafterboth
--- a/pallets/common/src/erc.rs
+++ b/pallets/common/src/erc.rs
@@ -47,10 +47,9 @@
 }
 
 #[solidity_interface(name = "Collection")]
-
-impl<T: Config> CollectionHandle<T> 
-// where 
-// 	T::AccountId: From<H256>
+impl<T: Config> CollectionHandle<T>
+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);
modifiedpallets/fungible/src/erc.rsdiffbeforeafterboth
--- a/pallets/fungible/src/erc.rs
+++ b/pallets/fungible/src/erc.rs
@@ -152,12 +152,18 @@
 		via("CollectionHandle<T>", common_mut, Collection)
 	)
 )]
-impl<T: Config> FungibleHandle<T> {}
+impl<T: Config> FungibleHandle<T>
+where
+	T::AccountId: From<[u8; 32]>
+{}
 
 generate_stubgen!(gen_impl, UniqueFungibleCall<()>, true);
 generate_stubgen!(gen_iface, UniqueFungibleCall<()>, false);
 
-impl<T: Config> CommonEvmHandler for FungibleHandle<T> {
+impl<T: Config> CommonEvmHandler for FungibleHandle<T>
+where
+	T::AccountId: From<[u8; 32]>
+{
 	const CODE: &'static [u8] = include_bytes!("./stubs/UniqueFungible.raw");
 
 	fn call(self, handle: &mut impl PrecompileHandle) -> Option<PrecompileResult> {
modifiedpallets/nonfungible/src/erc.rsdiffbeforeafterboth
584 )584 )
585)]585)]
586impl<T: Config> NonfungibleHandle<T> {}586impl<T: Config> NonfungibleHandle<T>
587where
588 T::AccountId: From<[u8; 32]>
589{}
587590
588// Not a tests, but code generators591// Not a tests, but code generators
589generate_stubgen!(gen_impl, UniqueNFTCall<()>, true);592generate_stubgen!(gen_impl, UniqueNFTCall<()>, true);
590generate_stubgen!(gen_iface, UniqueNFTCall<()>, false);593generate_stubgen!(gen_iface, UniqueNFTCall<()>, false);
591594
592impl<T: Config> CommonEvmHandler for NonfungibleHandle<T> {595impl<T: Config> CommonEvmHandler for NonfungibleHandle<T>
596where
597 T::AccountId: From<[u8; 32]>
598{
593 const CODE: &'static [u8] = include_bytes!("./stubs/UniqueNFT.raw");599 const CODE: &'static [u8] = include_bytes!("./stubs/UniqueNFT.raw");
594600
modifiedruntime/common/src/dispatch.rsdiffbeforeafterboth
--- 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()