--- a/pallets/evm-contract-helpers/src/eth.rs +++ b/pallets/evm-contract-helpers/src/eth.rs @@ -37,6 +37,19 @@ Ok(()) } + fn set_sponsoring_rate_limit( + &mut self, + caller: caller, + contract: address, + rate_limit: uint32, + ) -> Result { + self.0.consume_sload()?; + >::ensure_owner(contract, caller)?; + self.0.consume_sstore()?; + >::set_sponsoring_rate_limit(contract, rate_limit.into()); + Ok(()) + } + fn allowed(&self, contract: address, user: address) -> Result { self.0.consume_sload()?; Ok(>::allowed(contract, user)) --- a/pallets/evm-contract-helpers/src/lib.rs +++ b/pallets/evm-contract-helpers/src/lib.rs @@ -66,6 +66,10 @@ >::insert(contract, enabled); } + pub fn set_sponsoring_rate_limit(contract: H160, rate_limit: T::BlockNumber) { + >::insert(contract, rate_limit); + } + pub fn allowed(contract: H160, user: H160) -> bool { if !>::get(contract) { return true;