--- a/pallets/common/src/erc.rs +++ b/pallets/common/src/erc.rs @@ -295,7 +295,7 @@ None => return Ok(Default::default()), }; - Ok(EthCrossAccount::from_substrate::(&sponsor)) + Ok(EthCrossAccount::from_sub::(&sponsor)) } /// Get current collection limits. --- a/pallets/common/src/eth.rs +++ b/pallets/common/src/eth.rs @@ -140,7 +140,7 @@ } } /// Creates `EthCrossAccount` from substrate account - pub fn from_substrate(account_id: &T::AccountId) -> Self + pub fn from_sub(account_id: &T::AccountId) -> Self where T: pallet_evm::Config, T::AccountId: AsRef<[u8; 32]>, --- a/pallets/evm-contract-helpers/src/eth.rs +++ b/pallets/evm-contract-helpers/src/eth.rs @@ -25,6 +25,7 @@ types::*, ToLog, }; +use pallet_common::eth::EthCrossAccount; use pallet_evm::{ ExitRevert, OnCreate, OnMethodCall, PrecompileResult, PrecompileFailure, PrecompileHandle, account::CrossAccountId, @@ -174,11 +175,9 @@ /// /// @param contractAddress The contract for which a sponsor is requested. /// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw. - fn sponsor(&self, contract_address: address) -> Result<(address, uint256)> { - let sponsor = - Pallet::::get_sponsor(contract_address).ok_or("Contract has no sponsor")?; - Ok(pallet_common::eth::convert_cross_account_to_tuple::( - &sponsor, + fn sponsor(&self, contract_address: address) -> Result { + Ok(EthCrossAccount::from_sub_cross_account::( + &Pallet::::get_sponsor(contract_address).ok_or("Contract has no sponsor")?, )) }