Skip to content

Commit

Permalink
Merge pull request #41 from ZeroDAO/polkadot-v150
Browse files Browse the repository at this point in the history
Fix benchmarks errors
  • Loading branch information
DarkingLee committed Jul 10, 2024
2 parents 81a1432 + 2e23910 commit 15e40d6
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 5 deletions.
1 change: 1 addition & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ jobs:
run: |
rustup update stable --no-self-update
rustup target add wasm32-unknown-unknown
rustup component add rust-src --toolchain stable-x86_64-unknown-linux-gnu
# Rust cache
- uses: Swatinem/rust-cache@v2
Expand Down
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions crates/pallet-farmers-fortune/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ benchmarks! {
[u8; 32]: Into<<T as frame_system::Config>::AccountId>,
[u8; 32]: From<<T as frame_system::Config>::Hash>,
[u8; 32]: Into<<T as frame_system::Config>::Hash>,
u32: From<<T as frame_system::Config>::BlockNumber>,
u32: From<BlockNumberFor<T>>,
BalanceOf<T>: From<u128>,
T: Config<CommitmentFromPosition = MeloStore<T>>,
T: pallet_melo_store::Config,
Expand All @@ -41,8 +41,8 @@ benchmarks! {
System::<T>::set_block_number(6u32.into());

let header_hash: T::Hash = BLOCK_HASH1.into();
let block_num5: T::BlockNumber = 5u32.into();
let block_num3: T::BlockNumber = 3u32.into();
let block_num5: BlockNumberFor<T> = 5u32.into();
let block_num3: BlockNumberFor<T> = 3u32.into();

<frame_system::BlockHash<T>>::insert(block_num5, header_hash);
<frame_system::BlockHash<T>>::insert(block_num3, header_hash);
Expand Down
2 changes: 2 additions & 0 deletions runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ sp-version = { default-features = false, git = "https://github.com/paritytech/po
] }
sp-staking = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-v1.9.0", default-features = false, features = ["serde"] }
sp-genesis-builder = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-v1.9.0" }
sp-storage = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-v1.9.0" }

node-primitives = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-v1.9.0", default-features = false }

Expand Down Expand Up @@ -186,6 +187,7 @@ std = [
"sp-version/std",
"sp-io/std",
"sp-genesis-builder/std",
"sp-storage/std",
"substrate-wasm-builder",
"frame-executive-ext/std",
# "frame-executive/std",
Expand Down
6 changes: 4 additions & 2 deletions runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -626,6 +626,8 @@ impl pallet_treasury::Config for Runtime {
type Paymaster = PayAssetFromAccount<Assets, gov::TreasuryAccount>;
type BalanceConverter = AssetRate;
type PayoutPeriod = gov::SpendPayoutPeriod;
#[cfg(feature = "runtime-benchmarks")]
type BenchmarkHelper = ();

type OnSlash = ();
type ProposalBondMaximum = ();
Expand Down Expand Up @@ -1517,8 +1519,8 @@ impl_runtime_apis! {
fn dispatch_benchmark(
config: frame_benchmarking::BenchmarkConfig
) -> Result<Vec<frame_benchmarking::BenchmarkBatch>, sp_runtime::RuntimeString> {
use frame_benchmarking::{baseline, Benchmarking, BenchmarkBatch, TrackedStorageKey};

use frame_benchmarking::{baseline, Benchmarking, BenchmarkBatch};
use sp_storage::TrackedStorageKey;
use frame_system_benchmarking::Pallet as SystemBench;
use baseline::Pallet as BaselineBench;

Expand Down

0 comments on commit 15e40d6

Please sign in to comment.