--- a/pallets/evm-coder-substrate/src/lib.rs +++ b/pallets/evm-coder-substrate/src/lib.rs @@ -16,7 +16,7 @@ execution::{self, Result}, types::{Msg, value}, }; - use frame_support::ensure; + use frame_support::{ensure}; use pallet_evm::{ExitError, ExitReason, ExitRevert, ExitSucceed, PrecompileOutput}; pub use frame_support::dispatch::DispatchResult; use pallet_ethereum::EthereumTransactionSender; @@ -120,6 +120,9 @@ pub fn consume_sload_sub(&self) -> DispatchResult { self.consume_gas_sub(G_SLOAD_WORD) } + pub fn consume_sstores_sub(&self, amount: usize) -> DispatchResult { + self.consume_gas_sub(G_SSTORE_WORD.saturating_mul(amount as u64)) + } pub fn consume_sstore_sub(&self) -> DispatchResult { self.consume_gas_sub(G_SSTORE_WORD) }