diff --git a/pallets/drand/src/lib.rs b/pallets/drand/src/lib.rs index 8119b7f60..7e234db29 100644 --- a/pallets/drand/src/lib.rs +++ b/pallets/drand/src/lib.rs @@ -94,7 +94,7 @@ const CHAIN_HASH: &str = MAINNET_CHAIN_HASH; #[cfg(not(feature = "mainnet"))] const CHAIN_HASH: &str = QUICKNET_CHAIN_HASH; -pub const MAX_PULSES_TO_FETCH: u64 = 20; +pub const MAX_PULSES_TO_FETCH: u64 = 50; /// Defines application identifier for crypto keys of this module. /// @@ -203,11 +203,12 @@ pub mod pallet { #[pallet::generate_deposit(pub(super) fn deposit_event)] pub enum Event { BeaconConfigChanged, - /// A user has successfully set a new value. - NewPulse { - /// The new value set. - rounds: Vec, - }, + // Disabled because too spammy + // /// A user has successfully set a new value. + // NewPulse { + // /// The new value set. + // rounds: Vec, + // }, } #[pallet::error] @@ -333,11 +334,6 @@ pub mod pallet { let current_block = frame_system::Pallet::::block_number(); >::put(current_block.saturating_add(One::one())); - // Emit a single event with all new rounds - if !new_rounds.is_empty() { - Self::deposit_event(Event::NewPulse { rounds: new_rounds }); - } - Ok(()) } /// allows the root user to set the beacon configuration diff --git a/pallets/drand/src/tests.rs b/pallets/drand/src/tests.rs index b2e3dfd5b..ece0f211f 100644 --- a/pallets/drand/src/tests.rs +++ b/pallets/drand/src/tests.rs @@ -16,7 +16,7 @@ use crate::{ mock::*, BeaconConfig, BeaconConfigurationPayload, BeaconInfoResponse, Call, DrandResponseBody, - Error, Event, Pulse, Pulses, PulsesPayload, + Error, Pulse, Pulses, PulsesPayload, }; use codec::Encode; use frame_support::{ @@ -122,13 +122,6 @@ fn it_can_submit_valid_pulse_when_beacon_config_exists() { let pulse = Pulses::::get(ROUND_NUMBER); assert!(pulse.is_some()); assert_eq!(pulse, Some(p)); - // Assert that the correct event was deposited - System::assert_last_event( - Event::NewPulse { - rounds: vec![ROUND_NUMBER], - } - .into(), - ); }); } @@ -219,12 +212,6 @@ fn it_rejects_pulses_with_non_incremental_round_numbers() { let pulse = Pulses::::get(ROUND_NUMBER); assert!(pulse.is_some()); - System::assert_last_event( - Event::NewPulse { - rounds: vec![ROUND_NUMBER], - } - .into(), - ); System::set_block_number(2); // Attempt to submit the same pulse again, which should fail