Skip to content

Commit

Permalink
chore: use Bytes to store calldata (#7383)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattsse authored Mar 12, 2024
1 parent eef87de commit 4fa0fa1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions crates/debugger/src/tui/draw.rs
Original file line number Diff line number Diff line change
Expand Up @@ -503,9 +503,9 @@ impl DebuggerContext<'_> {
fn draw_buffer(&self, f: &mut Frame<'_>, area: Rect) {
let step = self.current_step();
let buf = match self.active_buffer {
BufferKind::Memory => &step.memory,
BufferKind::Calldata => &step.calldata,
BufferKind::Returndata => &step.returndata,
BufferKind::Memory => step.memory.as_ref(),
BufferKind::Calldata => step.calldata.as_ref(),
BufferKind::Returndata => step.returndata.as_ref(),
};

let min_len = hex_digits(buf.len());
Expand Down
4 changes: 2 additions & 2 deletions crates/evm/core/src/debug.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use alloy_primitives::{Address, U256};
use alloy_primitives::{Address, Bytes, U256};
use revm::interpreter::OpCode;
use revm_inspectors::tracing::types::CallKind;
use serde::{Deserialize, Serialize};
Expand Down Expand Up @@ -170,7 +170,7 @@ pub struct DebugStep {
/// Memory *prior* to running the associated opcode
pub memory: Vec<u8>,
/// Calldata *prior* to running the associated opcode
pub calldata: Vec<u8>,
pub calldata: Bytes,
/// Returndata *prior* to running the associated opcode
pub returndata: Vec<u8>,
/// Opcode to be executed
Expand Down
2 changes: 1 addition & 1 deletion crates/evm/evm/src/inspectors/debugger.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ impl<DB: DatabaseExt> Inspector<DB> for Debugger {
pc,
stack: interp.stack().data().clone(),
memory: interp.shared_memory.context_memory().to_vec(),
calldata: interp.contract().input.to_vec(),
calldata: interp.contract().input.clone(),
returndata: interp.return_data_buffer.to_vec(),
instruction: Instruction::OpCode(op),
push_bytes,
Expand Down

0 comments on commit 4fa0fa1

Please sign in to comment.