diff --git a/pallets/slow-clap/src/benchmarking.rs b/pallets/slow-clap/src/benchmarking.rs index 26fb21d..cd01549 100644 --- a/pallets/slow-clap/src/benchmarking.rs +++ b/pallets/slow-clap/src/benchmarking.rs @@ -50,8 +50,8 @@ benchmarks! { self_applause { let session_index = T::ValidatorSet::session_index(); - let authority = T::AuthorityId::generate_pair(Some(vec![69u8])); - let bounded_authorities = WeakBoundedVec::<_, T::MaxAuthorities>::try_from(vec![authority.clone()]) + let authorities = vec![T::AuthorityId::generate_pair(None)]; + let bounded_authorities = WeakBoundedVec::<_, T::MaxAuthorities>::try_from(authorities.clone()) .map_err(|()| "more than the maximum number of keys provided")?; Authorities::::set(&session_index, bounded_authorities); @@ -81,8 +81,11 @@ benchmarks! { amount, }; + let authority_id = authorities + .get(0usize) + .expect("first authority should exist"); let encoded_clap = clap.encode(); - let signature = authority.sign(&encoded_clap).unwrap(); + let signature = authority_id.sign(&encoded_clap).unwrap(); >::slow_clap(RawOrigin::None.into(), clap, signature)?; >::trigger_nullification_for_benchmark();