git.delta.rocks / unique-network / refs/commits / 3bb7d245f741

difftreelog

refactor remove toggle_sponsoring BREAKING CHANGE

Trubnikov Sergey2022-08-04parent: #e50c725.patch.diff
in: master

2 files changed

modifiedpallets/evm-contract-helpers/src/eth.rsdiffbeforeafterboth
--- a/pallets/evm-contract-helpers/src/eth.rs
+++ b/pallets/evm-contract-helpers/src/eth.rs
@@ -82,18 +82,6 @@
 		Ok(<Pallet<T>>::sponsoring_mode(contract_address) != SponsoringModeT::Disabled)
 	}
 
-	/// Deprecated 
-	fn toggle_sponsoring(
-		&mut self,
-		caller: caller,
-		contract_address: address,
-		enabled: bool,
-	) -> Result<void> {
-		<Pallet<T>>::ensure_owner(contract_address, caller).map_err(dispatch_to_evm::<T>)?;
-		<Pallet<T>>::toggle_sponsoring(contract_address, enabled);
-		Ok(())
-	}
-
 	fn set_sponsoring_mode(
 		&mut self,
 		caller: caller,
modifiedpallets/evm-contract-helpers/src/lib.rsdiffbeforeafterboth
200 <SelfSponsoring<T>>::remove(contract)200 <SelfSponsoring<T>>::remove(contract)
201 }201 }
202
203 pub fn toggle_sponsoring(contract: H160, enabled: bool) {
204 Self::set_sponsoring_mode(
205 contract,
206 if enabled {
207 SponsoringModeT::Allowlisted
208 } else {
209 SponsoringModeT::Disabled
210 },
211 )
212 }
213202
214 pub fn set_sponsoring_rate_limit(contract: H160, rate_limit: T::BlockNumber) {203 pub fn set_sponsoring_rate_limit(contract: H160, rate_limit: T::BlockNumber) {
215 <SponsoringRateLimit<T>>::insert(contract, rate_limit);204 <SponsoringRateLimit<T>>::insert(contract, rate_limit);