Skip to content

Commit

Permalink
Fix frame_system::set_code benchmark for Encointer
Browse files Browse the repository at this point in the history
2024-01-22 16:36:57 Starting benchmark: frame_system::set_code
Error:
   0: Invalid input: Benchmark frame_system::set_code failed: ValidationDataNotAvailable
  • Loading branch information
bkontur committed Jan 22, 2024
1 parent c11b28d commit 39a6b54
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions system-parachains/encointer/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -963,11 +963,20 @@ impl_runtime_apis! {
fn dispatch_benchmark(
config: frame_benchmarking::BenchmarkConfig
) -> Result<Vec<frame_benchmarking::BenchmarkBatch>, sp_runtime::RuntimeString> {
use frame_benchmarking::{Benchmarking, BenchmarkBatch};
use frame_benchmarking::{Benchmarking, BenchmarkBatch, BenchmarkError};
use frame_support::traits::TrackedStorageKey;

use frame_system_benchmarking::Pallet as SystemBench;
impl frame_system_benchmarking::Config for Runtime {}
impl frame_system_benchmarking::Config for Runtime {
fn setup_set_code_requirements(code: &sp_std::vec::Vec<u8>) -> Result<(), BenchmarkError> {
ParachainSystem::initialize_for_set_code_benchmark(code.len() as u32);
Ok(())
}

fn verify_set_code() {
System::assert_last_event(cumulus_pallet_parachain_system::Event::<Runtime>::ValidationFunctionStored.into());
}
}

let whitelist: Vec<TrackedStorageKey> = vec![
// Block Number
Expand Down

0 comments on commit 39a6b54

Please sign in to comment.