mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 00:01:09 +00:00
Make decl_module! implement OnFinalise (#947)
This commit is contained in:
@@ -42,7 +42,7 @@ extern crate srml_system as system;
|
||||
extern crate srml_timestamp as timestamp;
|
||||
|
||||
use rstd::prelude::*;
|
||||
use primitives::traits::{As, Zero, One, OnFinalise, Convert};
|
||||
use primitives::traits::{As, Zero, One, Convert};
|
||||
use codec::HasCompact;
|
||||
use runtime_support::{StorageValue, StorageMap};
|
||||
use runtime_support::dispatch::Result;
|
||||
@@ -71,6 +71,9 @@ decl_module! {
|
||||
|
||||
fn set_length(new: <T::BlockNumber as HasCompact>::Type) -> Result;
|
||||
fn force_new_session(apply_rewards: bool) -> Result;
|
||||
fn on_finalise(n: T::BlockNumber) {
|
||||
Self::check_rotate_session(n);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -228,12 +231,6 @@ impl<T: Trait> Module<T> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: Trait> OnFinalise<T::BlockNumber> for Module<T> {
|
||||
fn on_finalise(n: T::BlockNumber) {
|
||||
Self::check_rotate_session(n);
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
Reference in New Issue
Block a user