Skip to content

Commit

Permalink
Test nomination event
Browse files Browse the repository at this point in the history
  • Loading branch information
rockbmb committed Jan 30, 2025
1 parent bb11446 commit 61576ef
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions substrate/frame/nomination-pools/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4933,10 +4933,21 @@ mod nominate {
assert_ok!(Pools::nominate(RuntimeOrigin::signed(900), 1, vec![21]));
assert_eq!(Nominations::get().unwrap(), vec![21]);

// Check event
System::assert_last_event(tests::RuntimeEvent::Pools(Event::PoolNominationMade {
pool_id: 1,
caller: 900,
}));

// Nominator can nominate
assert_ok!(Pools::nominate(RuntimeOrigin::signed(901), 1, vec![31]));
assert_eq!(Nominations::get().unwrap(), vec![31]);

System::assert_last_event(tests::RuntimeEvent::Pools(Event::PoolNominationMade {
pool_id: 1,
caller: 901,
}));

// Can't nominate for a pool that doesn't exist
assert_noop!(
Pools::nominate(RuntimeOrigin::signed(902), 123, vec![21]),
Expand Down

0 comments on commit 61576ef

Please sign in to comment.