Make decl_module! implement OnFinalise (#947)

This commit is contained in:
Bastian Köcher
2018-10-23 09:58:15 +02:00
committed by GitHub
parent 52093c4b7a
commit 1ba73e0e88
19 changed files with 158 additions and 117 deletions
+2 -7
View File
@@ -55,7 +55,7 @@ use codec::{HasCompact, Compact};
use runtime_support::{Parameter, StorageValue, StorageMap};
use runtime_support::dispatch::Result;
use session::OnSessionChange;
use primitives::{Perbill, traits::{Zero, One, Bounded, OnFinalise, As}};
use primitives::{Perbill, traits::{Zero, One, Bounded, As}};
use balances::{address::Address, OnDilution};
use system::ensure_signed;
@@ -76,7 +76,7 @@ pub enum LockStatus<BlockNumber: Parameter> {
/// Preference of what happens on a slash event.
#[derive(PartialEq, Eq, Clone, Encode, Decode)]
#[cfg_attr(feature = "std", derive(Serialize, Deserialize, Debug))]
pub struct ValidatorPrefs<Balance: HasCompact + Copy> { // TODO: @bkchr shouldn't need this Copy but derive(Encode) breaks otherwise
pub struct ValidatorPrefs<Balance: HasCompact + Copy> { // TODO: @bkchr shouldn't need this Copy but derive(Encode) breaks otherwise
/// Validator should ensure this many more slashes than is necessary before being unstaked.
#[codec(compact)]
pub unstake_threshold: u32,
@@ -525,11 +525,6 @@ impl<T: Trait> Module<T> {
}
}
impl<T: Trait> OnFinalise<T::BlockNumber> for Module<T> {
fn on_finalise(_n: T::BlockNumber) {
}
}
impl<T: Trait> OnSessionChange<T::Moment> for Module<T> {
fn on_session_change(elapsed: T::Moment, should_reward: bool) {
Self::new_session(elapsed, should_reward);