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
82 Ok(<Pallet<T>>::sponsoring_mode(contract_address) != SponsoringModeT::Disabled)82 Ok(<Pallet<T>>::sponsoring_mode(contract_address) != SponsoringModeT::Disabled)
83 }83 }
84
85 /// Deprecated
86 fn toggle_sponsoring(
87 &mut self,
88 caller: caller,
89 contract_address: address,
90 enabled: bool,
91 ) -> Result<void> {
92 <Pallet<T>>::ensure_owner(contract_address, caller).map_err(dispatch_to_evm::<T>)?;
93 <Pallet<T>>::toggle_sponsoring(contract_address, enabled);
94 Ok(())
95 }
9684
97 fn set_sponsoring_mode(85 fn set_sponsoring_mode(
98 &mut self,86 &mut self,
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);