Skip to content

Commit 0079498

Browse files
Test works
1 parent 74523df commit 0079498

File tree

9 files changed

+28
-14
lines changed

9 files changed

+28
-14
lines changed

Cargo.lock

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,7 @@ dev = [
3333

3434
try-runtime = ["darwinia-cli/try-runtime"]
3535

36-
runtime-benchmarks = [
37-
"darwinia-cli/runtime-benchmarks",
38-
]
39-
36+
runtime-benchmarks = ["darwinia-cli/runtime-benchmarks"]
4037

4138
[workspace]
4239
members = [

cli/Cargo.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,14 @@ darwinia-cli = { optional = true, git = "https://github.com/darwinia-network/dar
2929
darwinia-service = { default-features = false, path = "../node/service" }
3030
# substrate client
3131
sc-cli = { optional = true, git = "https://github.com/darwinia-network/substrate.git", tag = "darwinia-v0.11.2" }
32-
"frame-benchmarking-cli" = { optional = true, git = "https://github.com/darwinia-network/substrate.git", tag = "darwinia-v0.11.2" }
3332
sc-client-api = { git = "https://github.com/darwinia-network/substrate.git", tag = "darwinia-v0.11.2" }
3433
sc-executor = { git = "https://github.com/darwinia-network/substrate.git", tag = "darwinia-v0.11.2" }
3534
sc-network = { optional = true, git = "https://github.com/darwinia-network/substrate.git", tag = "darwinia-v0.11.2" }
3635
sc-service = { git = "https://github.com/darwinia-network/substrate.git", tag = "darwinia-v0.11.2" }
3736
sc-tracing = { optional = true, git = "https://github.com/darwinia-network/substrate.git", tag = "darwinia-v0.11.2" }
3837
try-runtime-cli = { optional = true, git = "https://github.com/darwinia-network/substrate.git", tag = "darwinia-v0.11.2" }
38+
# benchmark
39+
frame-benchmarking-cli = { optional = true, git = "https://github.com/darwinia-network/substrate.git", tag = "darwinia-v0.11.2" }
3940
# substrate primitives
4041
sp-core = { git = "https://github.com/darwinia-network/substrate.git", tag = "darwinia-v0.11.2" }
4142
# this crate is used only to enable `trie-memory-tracker` feature
@@ -78,4 +79,5 @@ try-runtime = [
7879

7980
runtime-benchmarks = [
8081
"frame-benchmarking-cli",
82+
"darwinia-service/runtime-benchmarks",
8183
]

cli/src/command.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -414,10 +414,12 @@ pub fn run() -> sc_cli::Result<()> {
414414
Some(Subcommand::Benchmark(cmd)) => {
415415
let runner = cli.create_runner(cmd)?;
416416
let chain_spec = &runner.config().chain_spec;
417+
417418
if chain_spec.is_crab() {
418419
runner.sync_run(|config| cmd.run::<crab_runtime::Block, CrabExecutor>(config))
419420
} else if chain_spec.is_darwinia() {
420-
todo!()
421+
runner
422+
.sync_run(|config| cmd.run::<darwinia_runtime::Block, DarwiniaExecutor>(config))
421423
} else {
422424
Err("Benchmarking wasn't enabled when building the node. \
423425
You can enable it with `--features runtime-benchmarks`."

file_header.txt

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// This file is part of Darwinia.
2+
//
3+
// Copyright (C) 2018-2021 Darwinia Network
4+
// SPDX-License-Identifier: GPL-3.0
5+
//
6+
// Darwinia is free software: you can redistribute it and/or modify
7+
// it under the terms of the GNU General Public License as published by
8+
// the Free Software Foundation, either version 3 of the License, or
9+
// (at your option) any later version.
10+
//
11+
// Darwinia is distributed in the hope that it will be useful,
12+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+
// GNU General Public License for more details.
15+
//
16+
// You should have received a copy of the GNU General Public License
17+
// along with Darwinia. If not, see <https://www.gnu.org/licenses/>.

node/service/Cargo.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ sc-telemetry = { git = "https://github.com/darwinia-network/substrate.
5252
sc-transaction-pool = { git = "https://github.com/darwinia-network/substrate.git", tag = "darwinia-v0.11.2" }
5353
# substrate frame
5454
frame-benchmarking = { git = "https://github.com/darwinia-network/substrate.git", tag = "darwinia-v0.11.2" }
55-
frame-benchmarking-cli = { optional = true, git = "https://github.com/darwinia-network/substrate.git", tag = "darwinia-v0.11.2" }
5655
frame-system-rpc-runtime-api = { git = "https://github.com/darwinia-network/substrate.git", tag = "darwinia-v0.11.2" }
5756
pallet-im-online = { git = "https://github.com/darwinia-network/substrate.git", tag = "darwinia-v0.11.2" }
5857
pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/darwinia-network/substrate.git", tag = "darwinia-v0.11.2" }
@@ -96,7 +95,6 @@ try-runtime = [
9695
]
9796

9897
runtime-benchmarks = [
99-
"frame-benchmarking-cli",
10098
"crab-runtime/runtime-benchmarks",
10199
"darwinia-runtime/runtime-benchmarks",
102100
]

runtime/crab/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,6 @@ std = [
138138
"dvm-dynamic-fee/std",
139139
"dvm-rpc-runtime-api/std",
140140
# --- dvm --->
141-
"frame-benchmarking/std",
142141
"frame-executive/std",
143142
"frame-support/std",
144143
"frame-system/std",

runtime/crab/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -659,6 +659,7 @@ sp_api::impl_runtime_apis! {
659659
let mut batches = Vec::<BenchmarkBatch>::new();
660660
let params = (&config, &whitelist);
661661

662+
662663
add_benchmark!(params, batches, frame_system, SystemBench::<Runtime>);
663664

664665
if batches.is_empty() { return Err("Benchmark not found for this pallet.".into()) }

runtime/darwinia/Cargo.toml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,14 @@ darwinia-support = { default-features = false, git = "https:/
3636
darwinia-treasury = { default-features = false, git = "https://github.com/darwinia-network/darwinia-common.git", tag = "darwinia-v0.11.2" }
3737
darwinia-tron-backing = { default-features = false, git = "https://github.com/darwinia-network/darwinia-common.git", tag = "darwinia-v0.11.2" }
3838
darwinia-vesting = { default-features = false, git = "https://github.com/darwinia-network/darwinia-common.git", tag = "darwinia-v0.11.2" }
39-
frame-benchmarking = { optional=true, default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "darwinia-v0.11.2" }
40-
frame-system-benchmarking = { optional=true, default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "darwinia-v0.11.2" }
4139
# darwinia primitives
4240
darwinia-primitives = { default-features = false, path = "../../primitives" }
4341
ethereum-primitives = { default-features = false, git = "https://github.com/darwinia-network/darwinia-common.git", tag = "darwinia-v0.11.2" }
4442
# darwinia runtime
4543
darwinia-runtime-common = { default-features = false, path = "../common" }
4644
# substrate frame
45+
frame-benchmarking = { optional=true, default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "darwinia-v0.11.2" }
46+
frame-system-benchmarking = { optional=true, default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "darwinia-v0.11.2" }
4747
frame-executive = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "darwinia-v0.11.2" }
4848
frame-support = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "darwinia-v0.11.2" }
4949
frame-system = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "darwinia-v0.11.2" }
@@ -120,7 +120,6 @@ std = [
120120
"darwinia-runtime-common/std",
121121
"frame-executive/std",
122122
"frame-support/std",
123-
"frame-benchmarking/std",
124123
"frame-system/std",
125124
"frame-system-rpc-runtime-api/std",
126125
"frame-try-runtime/std",
@@ -180,8 +179,8 @@ on-chain-release-build = [
180179
runtime-benchmarks = [
181180
"frame-benchmarking",
182181
"frame-system-benchmarking",
183-
"frame-system/runtime-benchmarks",
184182
"frame-support/runtime-benchmarks",
183+
"frame-system/runtime-benchmarks",
185184
"pallet-collective/runtime-benchmarks",
186185
"pallet-society/runtime-benchmarks",
187186
]

0 commit comments

Comments
 (0)