Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Prev Previous commit
Next Next commit
Merge remote-tracking branch 'upstream/master' into md-benchmark-vesting
  • Loading branch information
shawntabrizi committed Mar 7, 2020
commit ec25d929b5590dc24218c17e8af945c7da2058b4
40 changes: 33 additions & 7 deletions bin/node/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -842,13 +842,39 @@ impl_runtime_apis! {
) -> Result<Vec<frame_benchmarking::BenchmarkResults>, sp_runtime::RuntimeString> {
use frame_benchmarking::Benchmarking;

match module.as_slice() {
b"pallet-balances" | b"balances" => Balances::run_benchmark(extrinsic, steps, repeat).ok(),
b"pallet-identity" | b"identity" => Identity::run_benchmark(extrinsic, steps, repeat).ok(),
b"pallet-timestamp" | b"timestamp" => Timestamp::run_benchmark(extrinsic, steps, repeat).ok(),
b"pallet-vesting" | b"vesting" => Vesting::run_benchmark(extrinsic, steps, repeat).ok(),
_ => None,
}
let result = match module.as_slice() {
b"pallet-balances" | b"balances" => Balances::run_benchmark(
extrinsic,
lowest_range_values,
highest_range_values,
steps,
repeat,
),
b"pallet-identity" | b"identity" => Identity::run_benchmark(
extrinsic,
lowest_range_values,
highest_range_values,
steps,
repeat,
),
b"pallet-timestamp" | b"timestamp" => Timestamp::run_benchmark(
extrinsic,
lowest_range_values,
highest_range_values,
steps,
repeat,
),
b"pallet-vesting" | b"vesting" => Vesting::run_benchmark(
extrinsic,
lowest_range_values,
highest_range_values,
steps,
repeat,
),
_ => Err("Benchmark not found for this pallet."),
};

result.map_err(|e| e.into())
}
}
}
Expand Down
3 changes: 1 addition & 2 deletions frame/system/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -893,8 +893,7 @@ impl<T: Trait> Module<T> {

/// Set the block number to something in particular. Can be used as an alternative to
/// `initialize` for tests that don't need to bother with the other environment entries.
// TODO: feature guard this once #4873 is closed.
// #[cfg(any(feature = "std", test))]
#[cfg(any(feature = "std", feature = "runtime-benchmarks", test))]
pub fn set_block_number(n: T::BlockNumber) {
<Number<T>>::put(n);
}
Expand Down
12 changes: 6 additions & 6 deletions frame/vesting/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ description = "FRAME pallet for manage vesting"
serde = { version = "1.0.101", optional = true }
codec = { package = "parity-scale-codec", version = "1.2.0", default-features = false, features = ["derive"] }
enumflags2 = { version = "0.6.2" }
sp-std = { version = "2.0.0-dev", default-features = false, path = "../../primitives/std" }
sp-io = { version = "2.0.0-dev", default-features = false, path = "../../primitives/io" }
sp-runtime = { version = "2.0.0-dev", default-features = false, path = "../../primitives/runtime" }
frame-benchmarking = { version = "2.0.0-dev", default-features = false, path = "../benchmarking" }
frame-support = { version = "2.0.0-dev", default-features = false, path = "../support" }
frame-system = { version = "2.0.0-dev", default-features = false, path = "../system" }
sp-std = { version = "2.0.0-alpha.2", default-features = false, path = "../../primitives/std" }
sp-io = { version = "2.0.0-alpha.2", default-features = false, path = "../../primitives/io" }
sp-runtime = { version = "2.0.0-alpha.2", default-features = false, path = "../../primitives/runtime" }
frame-support = { version = "2.0.0-alpha.2", default-features = false, path = "../support" }
frame-system = { version = "2.0.0-alpha.2", default-features = false, path = "../system" }
frame-benchmarking = { version = "2.0.0-alpha.2", default-features = false, path = "../benchmarking" }

[dev-dependencies]
sp-core = { version = "2.0.0-alpha.2", path = "../../primitives/core" }
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.