Rb staking pallet validator commission change event (#10827)

* commission-changed-event-and-deposit

* deposit_event fix

* commission_changed_event_works

* fmt

* CommissionChanged -> ValidatorPrefsUpdated

* event ValidatorPrefs

* updated commet

* fmt

* Update frame/staking/src/pallet/mod.rs

Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com>

* Update frame/staking/src/pallet/mod.rs

Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com>

* Update frame/staking/src/tests.rs

Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com>

Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com>
This commit is contained in:
Ross Bulat
2022-04-14 17:25:54 +01:00
committed by GitHub
parent e5c33d8aa4
commit c56e8f684f
2 changed files with 15 additions and 1 deletions
+10
View File
@@ -4598,11 +4598,21 @@ fn capped_stakers_works() {
#[test]
fn min_commission_works() {
ExtBuilder::default().build_and_execute(|| {
// account 10 controls the stash from account 11
assert_ok!(Staking::validate(
Origin::signed(10),
ValidatorPrefs { commission: Perbill::from_percent(5), blocked: false }
));
// event emitted should be correct
assert_eq!(
*staking_events().last().unwrap(),
Event::ValidatorPrefsSet(
11,
ValidatorPrefs { commission: Perbill::from_percent(5), blocked: false }
)
);
assert_ok!(Staking::set_staking_configs(
Origin::root(),
ConfigOp::Remove,