make benchmark work, issue with authorities fixed

Signed-off-by: Uncle Stretch <uncle.stretch@ghostchain.io>
This commit is contained in:
Uncle Stretch 2025-06-17 20:34:42 +03:00
parent 1196cc9faa
commit 3040dfb775
Signed by: str3tch
GPG Key ID: 84F3190747EE79AA

View File

@ -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::<T>::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();
<Pallet<T>>::slow_clap(RawOrigin::None.into(), clap, signature)?;
<Pallet::<T>>::trigger_nullification_for_benchmark();