From e104a49e53b74a7dcbd4d9aa23b7b2cc26eab5df Mon Sep 17 00:00:00 2001 From: Uncle Stinky Date: Mon, 31 Aug 2026 15:06:47 +0300 Subject: [PATCH] fix runtime for the benchmarking Signed-off-by: Uncle Stinky --- runtime/casper/Cargo.toml | 2 +- runtime/casper/src/lib.rs | 13 ++++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/runtime/casper/Cargo.toml b/runtime/casper/Cargo.toml index d2c48c8..8a2c452 100644 --- a/runtime/casper/Cargo.toml +++ b/runtime/casper/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "casper-runtime" -version = "4.0.0" +version = "4.0.1" build = "build.rs" description = "Runtime of the Casper Network" edition.workspace = true diff --git a/runtime/casper/src/lib.rs b/runtime/casper/src/lib.rs index 2854641..4377076 100644 --- a/runtime/casper/src/lib.rs +++ b/runtime/casper/src/lib.rs @@ -14,11 +14,15 @@ use frame_support::{ genesis_builder_helper::{build_state, get_preset}, traits::{ fungible::HoldConsideration, - tokens::{imbalance::ResolveTo, PayFromAccount, UnityAssetBalanceConversion}, + tokens::{imbalance::ResolveTo, UnityAssetBalanceConversion}, ConstU128, ConstU32, InstanceFilter, KeyOwnerProofSystem, LinearStoragePrice, }, }; + +#[cfg(not(feature = "runtime-benchmarks"))] +use frame_support::traits::tokens::PayFromAccount; + use frame_system::EnsureRoot; use runtime_common::{ impl_runtime_weights, impls::DealWithFees, prod_or_fast, BlockHashCount, BlockLength, @@ -577,8 +581,8 @@ impl EnsureOrigin for RootSpendOrigin { } #[cfg(feature = "runtime-benchmarks")] - fn successful_origin() -> RuntimeOrigin { - EnsureRoot::::successful_origin() + fn try_successful_origin() -> Result { + EnsureRoot::::try_successful_origin() } } @@ -1054,7 +1058,6 @@ mod benches { // that path resolves correctly in the generated file. // Substrate - [pallet_alliance, Alliance] [pallet_babe, Babe] [pallet_bags_list, VoterList] [pallet_balances, Balances] @@ -1077,7 +1080,7 @@ mod benches { // Ghosts [ghost_nomination_pools, NominationPoolsBench::] [ghost_networks, GhostNetworks] - [ghost_claims, GhostClaims] + [ghost_governance, GhostGovernance] [ghost_weaver, GhostWeaver] [ghost_exodus, GhostExodus] [ghost_sudo, GhostSudo]