fix(evmbin): make benches compile again (#10586)
This commit is contained in:
parent
9e2b2b361c
commit
90a7ca9d10
@ -25,16 +25,18 @@
|
|||||||
extern crate test;
|
extern crate test;
|
||||||
extern crate ethcore;
|
extern crate ethcore;
|
||||||
extern crate evm;
|
extern crate evm;
|
||||||
extern crate ethcore_util;
|
extern crate ethereum_types;
|
||||||
extern crate ethcore_bigint;
|
|
||||||
extern crate rustc_hex;
|
extern crate rustc_hex;
|
||||||
|
extern crate vm;
|
||||||
|
|
||||||
|
use std::sync::Arc;
|
||||||
use self::test::{Bencher, black_box};
|
use self::test::{Bencher, black_box};
|
||||||
|
|
||||||
use evm::run_vm;
|
use ethereum_types::U256;
|
||||||
use ethcore::vm::ActionParams;
|
use evm::Factory;
|
||||||
use ethcore_bigint::prelude::U256;
|
|
||||||
use rustc_hex::FromHex;
|
use rustc_hex::FromHex;
|
||||||
|
use vm::tests::FakeExt;
|
||||||
|
use vm::{ActionParams, Ext};
|
||||||
|
|
||||||
#[bench]
|
#[bench]
|
||||||
fn simple_loop_usize(b: &mut Bencher) {
|
fn simple_loop_usize(b: &mut Bencher) {
|
||||||
@ -54,9 +56,11 @@ fn simple_loop(gas: U256, b: &mut Bencher) {
|
|||||||
b.iter(|| {
|
b.iter(|| {
|
||||||
let mut params = ActionParams::default();
|
let mut params = ActionParams::default();
|
||||||
params.gas = gas;
|
params.gas = gas;
|
||||||
params.code = Some(code.clone());
|
params.code = Some(Arc::new(code.clone()));
|
||||||
|
|
||||||
run_vm(params)
|
let mut ext = FakeExt::new();
|
||||||
|
let evm = Factory::default().create(params, ext.schedule(), ext.depth());
|
||||||
|
let _ = evm.exec(&mut ext);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -78,8 +82,10 @@ fn rng(gas: U256, b: &mut Bencher) {
|
|||||||
b.iter(|| {
|
b.iter(|| {
|
||||||
let mut params = ActionParams::default();
|
let mut params = ActionParams::default();
|
||||||
params.gas = gas;
|
params.gas = gas;
|
||||||
params.code = Some(code.clone());
|
params.code = Some(Arc::new(code.clone()));
|
||||||
|
|
||||||
run_vm(params)
|
let mut ext = FakeExt::new();
|
||||||
|
let evm = Factory::default().create(params, ext.schedule(), ext.depth());
|
||||||
|
let _ = evm.exec(&mut ext);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user