Skip to content

Commit

Permalink
revertme: improve repro
Browse files Browse the repository at this point in the history
  • Loading branch information
shekhirin committed Sep 16, 2022
1 parent dbcc9bd commit 1e9fb5b
Showing 1 changed file with 30 additions and 17 deletions.
47 changes: 30 additions & 17 deletions crates/revm/src/inspector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -357,23 +357,7 @@ mod tests {
}
}

#[test]
fn test_gas_inspector() {
let contract_data: Bytes = Bytes::from(vec![
opcode::PUSH1,
0x1,
opcode::PUSH1,
0xb,
opcode::JUMPI,
opcode::PUSH1,
0x1,
opcode::PUSH1,
0x1,
opcode::PUSH1,
0x1,
opcode::JUMPDEST,
opcode::STOP,
]);
fn gas_inspector(contract_data: Bytes) {
let bytecode = Bytecode::new_raw(contract_data);

let mut evm = crate::new();
Expand All @@ -394,4 +378,33 @@ mod tests {
);
}
}

#[test]
fn test_gas_inspector() {
gas_inspector(Bytes::from(vec![
opcode::PUSH1,
0x1,
opcode::PUSH1,
0xb,
opcode::JUMPI,
opcode::PUSH1,
0x1,
opcode::PUSH1,
0x1,
opcode::PUSH1,
0x1,
opcode::JUMPDEST,
opcode::STOP,
]));
println!("\n");
gas_inspector(Bytes::from(vec![
opcode::PUSH1,
0x1,
opcode::PUSH1,
0x5,
opcode::JUMPI,
opcode::JUMPDEST,
opcode::STOP,
]));
}
}

0 comments on commit 1e9fb5b

Please sign in to comment.