difftreelog
feat evm helpers method to set rate limit
in: master
2 files changed
pallets/evm-contract-helpers/src/eth.rsdiffbeforeafterboth37 Ok(())37 Ok(())38 }38 }3940 fn set_sponsoring_rate_limit(41 &mut self,42 caller: caller,43 contract: address,44 rate_limit: uint32,45 ) -> Result<void> {46 self.0.consume_sload()?;47 <Pallet<T>>::ensure_owner(contract, caller)?;48 self.0.consume_sstore()?;49 <Pallet<T>>::set_sponsoring_rate_limit(contract, rate_limit.into());50 Ok(())51 }395240 fn allowed(&self, contract: address, user: address) -> Result<bool> {53 fn allowed(&self, contract: address, user: address) -> Result<bool> {41 self.0.consume_sload()?;54 self.0.consume_sload()?;pallets/evm-contract-helpers/src/lib.rsdiffbeforeafterboth66 <SelfSponsoring<T>>::insert(contract, enabled);66 <SelfSponsoring<T>>::insert(contract, enabled);67 }67 }6869 pub fn set_sponsoring_rate_limit(contract: H160, rate_limit: T::BlockNumber) {70 <SponsoringRateLimit<T>>::insert(contract, rate_limit);71 }687269 pub fn allowed(contract: H160, user: H160) -> bool {73 pub fn allowed(contract: H160, user: H160) -> bool {70 if !<AllowlistEnabled<T>>::get(contract) {74 if !<AllowlistEnabled<T>>::get(contract) {