Skip to content

Commit

Permalink
Adds benchmark to user-test Program
Browse files Browse the repository at this point in the history
  • Loading branch information
diegoximenes committed Dec 11, 2024
1 parent 228f963 commit ecc4e1f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions arbitrator/wasm-libraries/user-test/src/program.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ use arbutil::{
user::UserOutcomeKind,
EvmData,
},
benchmark::Benchmark,
Bytes20, Bytes32, Color,
};
use caller_env::{static_caller::STATIC_MEM, GuestPtr, MemAccess};
Expand All @@ -28,6 +29,7 @@ impl From<MemoryBoundsError> for eyre::ErrReport {
/// Mock type representing a `user_host::Program`
pub struct Program {
evm_api: MockEvmApi,
benchmark: Option<Benchmark>,
}

#[allow(clippy::unit_arg)]
Expand All @@ -52,6 +54,10 @@ impl UserHost<VecReader> for Program {
&EVM_DATA
}

fn benchmark(&mut self) -> &mut Option<Benchmark> {
&mut self.benchmark
}

fn evm_return_data_len(&mut self) -> &mut u32 {
unimplemented!()
}
Expand Down Expand Up @@ -91,6 +97,7 @@ impl Program {
pub fn current() -> Self {
Self {
evm_api: MockEvmApi,
benchmark: None,
}
}

Expand Down

0 comments on commit ecc4e1f

Please sign in to comment.