Events and better log for staking. (#6118)

* Events and better log for staking.

* Fix build

* Update frame/staking/src/lib.rs

Co-authored-by: Marcio Diaz <marcio.diaz@gmail.com>

Co-authored-by: Marcio Diaz <marcio.diaz@gmail.com>
This commit is contained in:
Kian Paimani
2020-05-25 17:11:47 +02:00
committed by GitHub
parent 60e7c706db
commit 609f7daa12
3 changed files with 32 additions and 11 deletions
+15
View File
@@ -3031,6 +3031,21 @@ mod offchain_phragmen {
let queued_result = Staking::queued_elected().unwrap();
assert_eq!(queued_result.compute, ElectionCompute::Signed);
assert_eq!(
System::events()
.into_iter()
.map(|r| r.event)
.filter_map(|e| {
if let MetaEvent::staking(inner) = e {
Some(inner)
} else {
None
}
})
.last()
.unwrap(),
RawEvent::SolutionStored(ElectionCompute::Signed),
);
run_to_block(15);
assert_eq!(Staking::era_election_status(), ElectionStatus::Closed);