From f345769f33aad0d6231c4e3f686b157d778c3d3e Mon Sep 17 00:00:00 2001 From: green Date: Tue, 17 Sep 2024 13:54:25 +0200 Subject: [PATCH] Apply suggestion --- crates/services/upgradable-executor/src/instance.rs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/crates/services/upgradable-executor/src/instance.rs b/crates/services/upgradable-executor/src/instance.rs index 551ef435892..1dfe0e2f04a 100644 --- a/crates/services/upgradable-executor/src/instance.rs +++ b/crates/services/upgradable-executor/src/instance.rs @@ -57,8 +57,9 @@ trait CallerHelper { /// Writes the encoded data to the memory at the provided pointer. fn write(&mut self, ptr: u32, encoded: &[u8]) -> anyhow::Result<()>; - /// Peeks the next transactions from the source and returns the size of the encoded transactions. - fn peek_next_txs_size( + /// Peeks the next transactions from the source and returns the size of + /// the encoded transactions in bytes. + fn peek_next_txs_bytes( &mut self, source: Arc, gas_limit: u64, @@ -78,7 +79,7 @@ impl<'a> CallerHelper for Caller<'a, ExecutionState> { .map_err(|e| anyhow::anyhow!("Failed to write to the memory: {}", e)) } - fn peek_next_txs_size( + fn peek_next_txs_bytes( &mut self, source: Arc, gas_limit: u64, @@ -240,7 +241,7 @@ impl Instance { return Ok(0); }; - caller.peek_next_txs_size(source, gas_limit, u16::MAX, u32::MAX) + caller.peek_next_txs_bytes(source, gas_limit, u16::MAX, u32::MAX) }; Func::wrap(&mut self.store, closure) @@ -263,7 +264,7 @@ impl Instance { anyhow::anyhow!("The number of transactions is more than `u16::MAX`: {e}") })?; - caller.peek_next_txs_size(source, gas_limit, tx_number_limit, size_limit) + caller.peek_next_txs_bytes(source, gas_limit, tx_number_limit, size_limit) }; Func::wrap(&mut self.store, closure)