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

difftreelog

misk: Change bound. Update changelog

Trubnikov Sergey2022-08-24parent: #66a04f8.patch.diff
in: master

3 files changed

modifiedpallets/common/src/eth.rsdiffbeforeafterboth
--- a/pallets/common/src/eth.rs
+++ b/pallets/common/src/eth.rs
@@ -53,9 +53,9 @@
 }
 
 /// Convert `CrossAccountId` to `uint256`.
-pub fn convert_cross_account_to_eth_uint256<T: Config>(from: &T::CrossAccountId) -> Result<uint256>
+pub fn convert_cross_account_to_uint256<T: Config>(from: &T::CrossAccountId) -> uint256
 where
-	T::AccountId: AsRef<[u8]>,
+	T::AccountId: AsRef<[u8; 32]>,
 {
 	use pallet_evm::account::CrossAccountId;
 	let slice = from.as_sub().as_ref();
modifiedpallets/evm-contract-helpers/CHANGELOG.mddiffbeforeafterboth
9 - Set arbitrary evm address as contract sponsor.9 - Set arbitrary evm address as contract sponsor.
10 - Ability to remove current sponsor.10 - Ability to remove current sponsor.
1111
12### Removed
13 - Remove methods
14 + sponsoring_enabled
15 + toggle_sponsoring
16
12 ### Changed17 ### Changed
1318
14 - Change `toggle_sponsoring` to `self_sponsored_enable`.19 - Change `toggle_sponsoring` to `self_sponsored_enable`.
modifiedpallets/evm-contract-helpers/src/eth.rsdiffbeforeafterboth
--- a/pallets/evm-contract-helpers/src/eth.rs
+++ b/pallets/evm-contract-helpers/src/eth.rs
@@ -45,7 +45,7 @@
 #[solidity_interface(name = "ContractHelpers")]
 impl<T: Config> ContractHelpers<T>
 where
-	T::AccountId: AsRef<[u8]>,
+	T::AccountId: AsRef<[u8; 32]>,
 {
 	/// Get contract ovner
 	///
@@ -110,7 +110,7 @@
 	fn get_sponsor(&self, contract_address: address) -> Result<(address, uint256)> {
 		let sponsor =
 			Pallet::<T>::get_sponsor(contract_address).ok_or("Contract has no sponsor")?;
-		let sponsor_sub = pallet_common::eth::convert_cross_account_to_eth_uint256::<T>(&sponsor)?;
+		let sponsor_sub = pallet_common::eth::convert_cross_account_to_uint256::<T>(&sponsor);
 		Ok((*sponsor.as_eth(), sponsor_sub))
 	}
 
@@ -206,7 +206,7 @@
 pub struct HelpersOnMethodCall<T: Config>(PhantomData<*const T>);
 impl<T: Config> OnMethodCall<T> for HelpersOnMethodCall<T>
 where
-	T::AccountId: AsRef<[u8]>,
+	T::AccountId: AsRef<[u8; 32]>,
 {
 	fn is_reserved(contract: &sp_core::H160) -> bool {
 		contract == &T::ContractAddress::get()