git.delta.rocks / unique-network / refs/commits / d1896d4a495f

difftreelog

refac code

PraetorP2022-12-12parent: #78c3cae.patch.diff
in: master

3 files changed

modifiedpallets/common/src/erc.rsdiffbeforeafterboth
--- 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::<T>(&sponsor))
+		Ok(EthCrossAccount::from_sub::<T>(&sponsor))
 	}
 
 	/// Get current collection limits.
modifiedpallets/common/src/eth.rsdiffbeforeafterboth
--- 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<T>(account_id: &T::AccountId) -> Self
+	pub fn from_sub<T>(account_id: &T::AccountId) -> Self
 	where
 		T: pallet_evm::Config,
 		T::AccountId: AsRef<[u8; 32]>,
modifiedpallets/evm-contract-helpers/src/eth.rsdiffbeforeafterboth
25 types::*,25 types::*,
26 ToLog,26 ToLog,
27};27};
28use pallet_common::eth::EthCrossAccount;
28use pallet_evm::{29use pallet_evm::{
29 ExitRevert, OnCreate, OnMethodCall, PrecompileResult, PrecompileFailure, PrecompileHandle,30 ExitRevert, OnCreate, OnMethodCall, PrecompileResult, PrecompileFailure, PrecompileHandle,
30 account::CrossAccountId,31 account::CrossAccountId,
174 ///175 ///
175 /// @param contractAddress The contract for which a sponsor is requested.176 /// @param contractAddress The contract for which a sponsor is requested.
176 /// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw.177 /// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw.
177 fn sponsor(&self, contract_address: address) -> Result<(address, uint256)> {178 fn sponsor(&self, contract_address: address) -> Result<EthCrossAccount> {
178 let sponsor =179 Ok(EthCrossAccount::from_sub_cross_account::<T>(
179 Pallet::<T>::get_sponsor(contract_address).ok_or("Contract has no sponsor")?;180 &Pallet::<T>::get_sponsor(contract_address).ok_or("Contract has no sponsor")?,
180 Ok(pallet_common::eth::convert_cross_account_to_tuple::<T>(181 ))
181 &sponsor,
182 ))
183 }182 }
184183
185 /// Check tat contract has confirmed sponsor.184 /// Check tat contract has confirmed sponsor.