Skip to content

Commit

Permalink
Apply suggestion
Browse files Browse the repository at this point in the history
  • Loading branch information
xgreenx committed Sep 17, 2024
1 parent 62aaabb commit f345769
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions crates/services/upgradable-executor/src/instance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Source>(
/// Peeks the next transactions from the source and returns the size of
/// the encoded transactions in bytes.
fn peek_next_txs_bytes<Source>(
&mut self,
source: Arc<Source>,
gas_limit: u64,
Expand All @@ -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<Source>(
fn peek_next_txs_bytes<Source>(
&mut self,
source: Arc<Source>,
gas_limit: u64,
Expand Down Expand Up @@ -240,7 +241,7 @@ impl Instance<Created> {
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)
Expand All @@ -263,7 +264,7 @@ impl Instance<Created> {
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)
Expand Down

0 comments on commit f345769

Please sign in to comment.