mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 11:07:56 +00:00
im-online: send heartbeats at a random period (#8819)
* im-online: send heartbeats at a random period * support: use permill to represent session progress * im-online: increase probability of heartbeating with session progress * babe, session: fix tests * babe: fix test
This commit is contained in:
@@ -20,7 +20,7 @@
|
||||
use sp_std::prelude::*;
|
||||
use codec::{Codec, Decode};
|
||||
use sp_runtime::traits::{Convert, Zero};
|
||||
use sp_runtime::{BoundToRuntimeAppPublic, ConsensusEngineId, Percent, RuntimeAppPublic};
|
||||
use sp_runtime::{BoundToRuntimeAppPublic, ConsensusEngineId, Permill, RuntimeAppPublic};
|
||||
use sp_staking::SessionIndex;
|
||||
use crate::dispatch::Parameter;
|
||||
use crate::weights::Weight;
|
||||
@@ -126,7 +126,7 @@ pub trait EstimateNextSessionRotation<BlockNumber> {
|
||||
/// Return an estimate of the current session progress.
|
||||
///
|
||||
/// None should be returned if the estimation fails to come to an answer.
|
||||
fn estimate_current_session_progress(now: BlockNumber) -> (Option<Percent>, Weight);
|
||||
fn estimate_current_session_progress(now: BlockNumber) -> (Option<Permill>, Weight);
|
||||
|
||||
/// Return the block number at which the next session rotation is estimated to happen.
|
||||
///
|
||||
@@ -139,7 +139,7 @@ impl<BlockNumber: Zero> EstimateNextSessionRotation<BlockNumber> for () {
|
||||
Zero::zero()
|
||||
}
|
||||
|
||||
fn estimate_current_session_progress(_: BlockNumber) -> (Option<Percent>, Weight) {
|
||||
fn estimate_current_session_progress(_: BlockNumber) -> (Option<Permill>, Weight) {
|
||||
(None, Zero::zero())
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user