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
--- a/pallets/evm-contract-helpers/CHANGELOG.md
+++ b/pallets/evm-contract-helpers/CHANGELOG.md
@@ -9,6 +9,11 @@
  - Set arbitrary evm address as contract sponsor.
  - Ability to remove current sponsor.
 
+### Removed
+ - Remove methods
+   + sponsoring_enabled
+   + toggle_sponsoring
+
  ### Changed
 
  - Change `toggle_sponsoring` to `self_sponsored_enable`.
modifiedpallets/evm-contract-helpers/src/eth.rsdiffbeforeafterboth
45#[solidity_interface(name = "ContractHelpers")]45#[solidity_interface(name = "ContractHelpers")]
46impl<T: Config> ContractHelpers<T>46impl<T: Config> ContractHelpers<T>
47where47where
48 T::AccountId: AsRef<[u8]>,48 T::AccountId: AsRef<[u8; 32]>,
49{49{
50 /// Get contract ovner50 /// Get contract ovner
51 ///51 ///
110 fn get_sponsor(&self, contract_address: address) -> Result<(address, uint256)> {110 fn get_sponsor(&self, contract_address: address) -> Result<(address, uint256)> {
111 let sponsor =111 let sponsor =
112 Pallet::<T>::get_sponsor(contract_address).ok_or("Contract has no sponsor")?;112 Pallet::<T>::get_sponsor(contract_address).ok_or("Contract has no sponsor")?;
113 let sponsor_sub = pallet_common::eth::convert_cross_account_to_eth_uint256::<T>(&sponsor)?;113 let sponsor_sub = pallet_common::eth::convert_cross_account_to_uint256::<T>(&sponsor);
114 Ok((*sponsor.as_eth(), sponsor_sub))114 Ok((*sponsor.as_eth(), sponsor_sub))
115 }115 }
116116
206pub struct HelpersOnMethodCall<T: Config>(PhantomData<*const T>);206pub struct HelpersOnMethodCall<T: Config>(PhantomData<*const T>);
207impl<T: Config> OnMethodCall<T> for HelpersOnMethodCall<T>207impl<T: Config> OnMethodCall<T> for HelpersOnMethodCall<T>
208where208where
209 T::AccountId: AsRef<[u8]>,209 T::AccountId: AsRef<[u8; 32]>,
210{210{
211 fn is_reserved(contract: &sp_core::H160) -> bool {211 fn is_reserved(contract: &sp_core::H160) -> bool {
212 contract == &T::ContractAddress::get()212 contract == &T::ContractAddress::get()