difftreelog
CORE-386 Add methods for adding substrate admins
in: master
4 files changed
pallets/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);
pallets/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> {
pallets/nonfungible/src/erc.rsdiffbeforeafterboth--- a/pallets/nonfungible/src/erc.rs
+++ b/pallets/nonfungible/src/erc.rs
@@ -583,13 +583,19 @@
TokenProperties,
)
)]
-impl<T: Config> NonfungibleHandle<T> {}
+impl<T: Config> NonfungibleHandle<T>
+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<T: Config> CommonEvmHandler for NonfungibleHandle<T> {
+impl<T: Config> CommonEvmHandler for NonfungibleHandle<T>
+where
+ T::AccountId: From<[u8; 32]>
+{
const CODE: &'static [u8] = include_bytes!("./stubs/UniqueNFT.raw");
fn call(self, handle: &mut impl PrecompileHandle) -> Option<PrecompileResult> {
runtime/common/src/dispatch.rsdiffbeforeafterboth96 + pallet_fungible::Config96 + pallet_fungible::Config97 + pallet_nonfungible::Config97 + pallet_nonfungible::Config98 + pallet_refungible::Config,98 + pallet_refungible::Config,99 T::AccountId: From<[u8; 32]>,99{100{100 fn is_reserved(target: &H160) -> bool {101 fn is_reserved(target: &H160) -> bool {101 map_eth_to_id(target).is_some()102 map_eth_to_id(target).is_some()