Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Companion for Substrate#14474 #2792

Merged
merged 8 commits into from
Jun 30, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions bridges/primitives/header-chain/tests/implementation_match.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ pub fn make_default_justification(header: &TestHeader) -> GrandpaJustification<T
// the `finality_grandpa::validate_commit` function has two ways to report an unsuccessful
// commit validation:
//
// 1) to return `Err()` (which only may happen if `finality_grandpa::Chain` implementation
// returns an error);
// 1) to return `Err()` (which only may happen if `finality_grandpa::Chain` implementation returns
// an error);
// 2) to return `Ok(validation_result)` if `validation_result.is_valid()` is false.
//
// Our implementation would just return error in both cases.
Expand Down
4 changes: 2 additions & 2 deletions bridges/primitives/runtime/src/messages.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ pub struct MessageDispatchResult<DispatchLevelResult> {
/// Unspent dispatch weight. This weight that will be deducted from total delivery transaction
/// weight, thus reducing the transaction cost. This shall not be zero in (at least) two cases:
///
/// 1) if message has been dispatched successfully, but post-dispatch weight is less than
/// the weight, declared by the message sender;
/// 1) if message has been dispatched successfully, but post-dispatch weight is less than the
/// weight, declared by the message sender;
/// 2) if message has not been dispatched at all.
pub unspent_weight: Weight,
/// Fine-grained result of single message dispatch (for better diagnostic purposes)
Expand Down
2 changes: 1 addition & 1 deletion parachain-template/node/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ pub fn run() -> Result<()> {
match cmd {
BenchmarkCmd::Pallet(cmd) =>
if cfg!(feature = "runtime-benchmarks") {
runner.sync_run(|config| cmd.run::<Block, ParachainNativeExecutor>(config))
runner.sync_run(|config| cmd.run::<Block, ()>(config))
} else {
Err("Benchmarking wasn't enabled when building the node. \
You can enable it with `--features runtime-benchmarks`."
Expand Down
39 changes: 1 addition & 38 deletions polkadot-parachain/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -687,44 +687,7 @@ pub fn run() -> Result<()> {
match cmd {
BenchmarkCmd::Pallet(cmd) =>
if cfg!(feature = "runtime-benchmarks") {
runner.sync_run(|config| {
match config.chain_spec.runtime() {
Runtime::AssetHubKusama =>
cmd.run::<Block, AssetHubKusamaExecutor>(config),
Runtime::AssetHubWestend => cmd.run::<Block, AssetHubWestendExecutor>(config),
Runtime::AssetHubPolkadot =>
cmd.run::<Block, AssetHubPolkadotRuntimeExecutor>(config),
Runtime::CollectivesPolkadot | Runtime::CollectivesWestend =>
cmd.run::<Block, CollectivesPolkadotRuntimeExecutor>(config),
Runtime::BridgeHub(bridge_hub_runtime_type) => match bridge_hub_runtime_type {
chain_spec::bridge_hubs::BridgeHubRuntimeType::Polkadot |
chain_spec::bridge_hubs::BridgeHubRuntimeType::PolkadotLocal |
chain_spec::bridge_hubs::BridgeHubRuntimeType::PolkadotDevelopment =>
cmd.run::<Block, BridgeHubPolkadotRuntimeExecutor>(config),
chain_spec::bridge_hubs::BridgeHubRuntimeType::Kusama |
chain_spec::bridge_hubs::BridgeHubRuntimeType::KusamaLocal |
chain_spec::bridge_hubs::BridgeHubRuntimeType::KusamaDevelopment =>
cmd.run::<Block, BridgeHubKusamaRuntimeExecutor>(config),
chain_spec::bridge_hubs::BridgeHubRuntimeType::Rococo |
chain_spec::bridge_hubs::BridgeHubRuntimeType::RococoLocal |
chain_spec::bridge_hubs::BridgeHubRuntimeType::RococoDevelopment =>
cmd.run::<Block, BridgeHubRococoRuntimeExecutor>(config),
_ => Err(format!(
"Chain '{:?}' doesn't support benchmarking for bridge_hub_runtime_type: {:?}",
config.chain_spec.runtime(),
bridge_hub_runtime_type
)
.into()),
},
Runtime::Glutton =>
cmd.run::<Block, GluttonRuntimeExecutor>(config),
_ => Err(format!(
"Chain '{:?}' doesn't support benchmarking",
config.chain_spec.runtime()
)
.into()),
}
})
runner.sync_run(|config| cmd.run::<Block, ()>(config))
} else {
Err("Benchmarking wasn't enabled when building the node. \
You can enable it with `--features runtime-benchmarks`."
Expand Down