diff --git a/Cargo.dev.toml b/Cargo.dev.toml index 3c16f9bd8..e10d3796f 100644 --- a/Cargo.dev.toml +++ b/Cargo.dev.toml @@ -4,6 +4,7 @@ cargo-features = ["resolver"] members = [ "auction", "authority", + "bencher", "benchmarking", "currencies", "gradually-update", @@ -20,6 +21,7 @@ members = [ "xcm-support", "unknown-tokens", "build-script-utils", + "weight-gen", "weight-meter", ] resolver = "2" diff --git a/bencher/Cargo.toml b/bencher/Cargo.toml index 6cb4f5aae..5ff55205b 100644 --- a/bencher/Cargo.toml +++ b/bencher/Cargo.toml @@ -7,10 +7,6 @@ version = "0.1.0" authors = ["Laminar Developers "] edition = "2018" -[[bin]] -path = "src/bin.rs" -name = "codegen" - [dependencies] linregress = { version = "0.4.0", optional = true } handlebars = {version = "3.5.2", optional = true } diff --git a/bencher/src/bench_runner.rs b/bencher/src/bench_runner.rs index 6f0d49075..26fabc066 100644 --- a/bencher/src/bench_runner.rs +++ b/bencher/src/bench_runner.rs @@ -12,7 +12,7 @@ use sp_state_machine::{Ext, OverlayedChanges, StorageTransactionCache}; pub fn run(wasm_code: Vec) -> Vec { let mut overlay = OverlayedChanges::default(); let mut cache = StorageTransactionCache::default(); - let state = BenchmarkingState::::new(Default::default(), Default::default()).unwrap(); + let state = BenchmarkingState::::new(Default::default(), Default::default(), false).unwrap(); let mut ext = Ext::<_, NumberFor, _>::new(&mut overlay, &mut cache, &state, None, None); let mut host_functions = benchmarking::HostFunctions::host_functions(); diff --git a/bencher/src/template.hbs b/bencher/src/template.hbs deleted file mode 100644 index 470b00c25..000000000 --- a/bencher/src/template.hbs +++ /dev/null @@ -1,23 +0,0 @@ -{{header}} - -#![allow(unused_parens)] -#![allow(unused_imports)] -#![allow(dead_code)] - -use frame_support::{traits::Get, weights::Weight}; -use sp_std::marker::PhantomData; - -pub struct ModuleWeights(PhantomData); -impl ModuleWeights { - {{~#each benchmarks as |benchmark|}} - pub fn {{benchmark.name~}} () -> Weight { - ({{underscore benchmark.base_weight}} as Weight) - {{~#if (ne benchmark.base_reads "0")}} - .saturating_add(T::DbWeight::get().reads({{benchmark.base_reads}} as Weight)) - {{~/if}} - {{~#if (ne benchmark.base_writes "0")}} - .saturating_add(T::DbWeight::get().writes({{benchmark.base_writes}} as Weight)) - {{~/if}} - } - {{~/each}} -}