Skip to content

Commit

Permalink
another fix in ceremonies benchmakrs
Browse files Browse the repository at this point in the history
  • Loading branch information
brenzi committed Feb 7, 2024
1 parent 826e8ed commit 2c9daf5
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ceremonies/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "pallet-encointer-ceremonies"
version = "3.0.3"
version = "3.0.4"
authors = ["Encointer Association <[email protected]>"]
edition = "2021"
description = "Ceremonies pallet for the Encointer blockchain runtime"
Expand Down
30 changes: 29 additions & 1 deletion ceremonies/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,34 @@ fn test_location() -> Location {
fn create_community<T: Config>() -> CommunityIdentifier {
let location = test_location();
let bs = bootstrappers::<T>();
encointer_scheduler::Pallet::<T>::set_phase_duration(
RawOrigin::Root.into(),
CeremonyPhaseType::Assigning,
10u32.into(),
)
.ok();
encointer_scheduler::Pallet::<T>::set_phase_duration(
RawOrigin::Root.into(),
CeremonyPhaseType::Attesting,
10u32.into(),
)
.ok();
encointer_scheduler::Pallet::<T>::set_phase_duration(
RawOrigin::Root.into(),
CeremonyPhaseType::Registering,
10u32.into(),
)
.ok();
next_phase::<T>();
next_phase::<T>();
next_phase::<T>();
Pallet::<T>::set_inactivity_timeout(RawOrigin::Root.into(), 5).ok();
Pallet::<T>::set_reputation_lifetime(RawOrigin::Root.into(), 5).ok();
Pallet::<T>::set_endorsement_tickets_per_bootstrapper(RawOrigin::Root.into(), 1).ok();
Pallet::<T>::set_endorsement_tickets_per_reputable(RawOrigin::Root.into(), 1).ok();
Pallet::<T>::set_location_tolerance(RawOrigin::Root.into(), 1000).ok();
Pallet::<T>::set_time_tolerance(RawOrigin::Root.into(), 1_000_000u32.into()).ok();

encointer_communities::Pallet::<T>::set_min_solar_trip_time_s(RawOrigin::Root.into(), 1).ok();
encointer_communities::Pallet::<T>::set_max_speed_mps(RawOrigin::Root.into(), 83).ok();
encointer_communities::Pallet::<T>::new_community(
Expand Down Expand Up @@ -126,7 +154,7 @@ where
pub fn last_event<T: Config>() -> Option<<T as frame_system::Config>::RuntimeEvent> {
let events = frame_system::Pallet::<T>::events();
if events.len() < 1 {
return None
return None;
}
let frame_system::EventRecord { event, .. } = &events[events.len() - 1];
Some(event.clone())
Expand Down

0 comments on commit 2c9daf5

Please sign in to comment.