Skip to content

Commit

Permalink
fix clippy,test,docs
Browse files Browse the repository at this point in the history
  • Loading branch information
lightsing committed May 9, 2024
1 parent 8b5279b commit 3680fd5
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
4 changes: 3 additions & 1 deletion crates/interpreter/src/interpreter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,9 @@ impl Interpreter {
let out_offset = call_outcome.memory_start();
let out_len = call_outcome.memory_length();

self.return_data_buffer = call_outcome.output().to_owned();
call_outcome
.output()
.clone_into(&mut self.return_data_buffer);
let target_len = min(out_len, self.return_data_buffer.len());

match call_outcome.instruction_result() {
Expand Down
10 changes: 8 additions & 2 deletions crates/primitives/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ impl AccountInfo {

#[cfg(test)]
mod tests {
use crate::{Account, KECCAK_EMPTY, U256};
use crate::{Account, U256};

#[test]
fn account_is_empty_balance() {
Expand Down Expand Up @@ -367,7 +367,13 @@ mod tests {
account.info.code_hash = [0; 32].into();
assert!(account.is_empty());

account.info.code_hash = KECCAK_EMPTY;
cfg_if::cfg_if! {
if #[cfg(feature = "scroll")] {
account.info.code_hash = crate::POSEIDON_EMPTY;
} else {
account.info.code_hash = crate::KECCAK_EMPTY;
}
}
assert!(account.is_empty());
}

Expand Down
2 changes: 1 addition & 1 deletion crates/revm/src/scroll/l1block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ impl L1BlockInfo {
}))
}

/// Calculate the gas cost of a transaction based on L1 block data posted on L2, depending on the [SpecId] passed.
/// Calculate the gas cost of a transaction based on L1 block data posted on L2.
pub fn calculate_tx_l1_cost(&self, input: &[u8]) -> U256 {
let tx_l1_gas = self.data_gas(input);
tx_l1_gas
Expand Down

0 comments on commit 3680fd5

Please sign in to comment.