diff --git a/democracy/src/benchmarking.rs b/democracy/src/benchmarking.rs index e51a9a2b..520bc33d 100644 --- a/democracy/src/benchmarking.rs +++ b/democracy/src/benchmarking.rs @@ -1,15 +1,15 @@ use crate::{Pallet as EncointerDemocracy, *}; use encointer_primitives::{ - ceremonies::Reputation, - communities::CommunityIdentifier, - democracy::{ProposalState, Tally, Vote}, - storage::{current_ceremony_index_key, global_reputation_count, participant_reputation}, + ceremonies::Reputation, + communities::CommunityIdentifier, + democracy::{ProposalState, Tally, Vote}, + storage::{current_ceremony_index_key, global_reputation_count, participant_reputation}, }; use frame_benchmarking::{account, benchmarks, impl_benchmark_test_suite}; use frame_support::{ - assert_ok, - traits::{OnFinalize, OriginTrait}, - BoundedVec, + assert_ok, + traits::{OnFinalize, OriginTrait}, + BoundedVec, }; use frame_system::RawOrigin; use parity_scale_codec::Encode; @@ -17,16 +17,20 @@ use parity_scale_codec::Encode; use sp_std::vec; fn advance_timestamp_equivalent_to_n_blocks(n: u64) { - let offset: T::Moment = (n * 6000u64) - .try_into() - .unwrap_or_else(|_| panic!("Something went horribly wrong!")); - let new_time: T::Moment = pallet_timestamp::Pallet::::get() + offset; - let _ = pallet_timestamp::Pallet::::set(T::RuntimeOrigin::none(), new_time); - pallet_timestamp::Pallet::::on_finalize(frame_system::Pallet::::block_number()); + let offset: T::Moment = (n * 6000u64) + .try_into() + .unwrap_or_else(|_| panic!("Something went horribly wrong!")); + let new_time: T::Moment = pallet_timestamp::Pallet::::get() + offset; + let _ = pallet_timestamp::Pallet::::set(T::RuntimeOrigin::none(), new_time); + pallet_timestamp::Pallet::::on_finalize(frame_system::Pallet::::block_number()); } benchmarks! { - + where_clause { + where + sp_core::H256: From<::Hash>, + T::AccountId: AsRef<[u8; 32]>, + } submit_proposal { let zoran = account("zoran", 1, 1); let cid = CommunityIdentifier::default();