Skip to content

Commit

Permalink
chore: rename inspector (#55)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattsse authored Mar 5, 2024
1 parent 26a1b20 commit 7cdbe2e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/opcode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use std::collections::HashMap;

/// An Inspector that counts opcodes and measures gas usage per opcode.
#[derive(Clone, Debug, Default)]
pub struct OpcodeCounterInspector {
pub struct OpcodeGasInspector {
/// Map of opcode counts per transaction.
opcode_counts: HashMap<OpCode, u64>,
/// Map of total gas used per opcode.
Expand All @@ -16,7 +16,7 @@ pub struct OpcodeCounterInspector {
last_opcode_gas_remaining: Option<(OpCode, u64)>,
}

impl OpcodeCounterInspector {
impl OpcodeGasInspector {
/// Creates a new instance of the inspector.
pub fn new() -> Self {
Self::default()
Expand Down Expand Up @@ -54,7 +54,7 @@ impl OpcodeCounterInspector {
}
}

impl<DB> Inspector<DB> for OpcodeCounterInspector
impl<DB> Inspector<DB> for OpcodeGasInspector
where
DB: Database,
{
Expand Down Expand Up @@ -97,7 +97,7 @@ mod tests {

#[test]
fn test_opcode_counter_inspector() {
let mut opcode_counter = OpcodeCounterInspector::new();
let mut opcode_counter = OpcodeGasInspector::new();
let contract = Box::<Contract>::default();
let mut interpreter = Interpreter::new(contract, 10000, false);
let db = CacheDB::new(EmptyDB::default());
Expand All @@ -117,7 +117,7 @@ mod tests {

#[test]
fn test_with_variety_of_opcodes() {
let mut opcode_counter = OpcodeCounterInspector::new();
let mut opcode_counter = OpcodeGasInspector::new();
let contract = Box::<Contract>::default();
let mut interpreter = Interpreter::new(contract, 2024, false);
let db = CacheDB::new(EmptyDB::default());
Expand Down

0 comments on commit 7cdbe2e

Please sign in to comment.