mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 11:07:56 +00:00
Use pallet names to name enum variants (#8990)
* Remove unused event_metadata variable * Eliminate mod_name and use pallet names to name enum variants * Rename field name `pallet` to `path` * Use only the pallet name to generate variant names * Use new naming scheme for Event enum in sudo pallet tests * Use new naming scheme for Event enum in offences pallet tests * Use new naming scheme for Event enum in contracts pallet tests * Use new naming scheme for Event enum in collective pallet tests * Use new naming scheme for Event enum in bounties pallet tests * Use new naming scheme for Event enum in balances pallet tests * Use new naming scheme for Event enum in assets pallet tests * Use new naming scheme for Event enum in frame support tests * Use new naming scheme for Event enum in tips pallet tests * Use new naming scheme for Event enum in transaction payment pallet tests * Use new naming scheme for GenesisConfig fields in example pallet tests * Use new naming scheme for GenesisConfig fields in elections pallet tests * Use new naming scheme for Event enum in election provider multi-phase pallet tests * Use new naming scheme for Event enum in elections phragmen pallet tests * Use new naming scheme for GenesisConfig fields in chain spec * Use new naming scheme for Event enum in staking pallet mock * Use new naming scheme for GenesisConfig fields in node-template chain spec * Use new naming scheme for GenesisConfig fields in node-testing chain spec * Use new naming scheme for Event enum in node executor tests * Use new naming scheme for GenesisConfig fields in transaction storage pallet mock * Refactor match conditions
This commit is contained in:
@@ -58,7 +58,7 @@ fn sudo_emits_events_correctly() {
|
||||
// Should emit event to indicate success when called with the root `key` and `call` is `Ok`.
|
||||
let call = Box::new(Call::Logger(LoggerCall::privileged_i32_log(42, 1)));
|
||||
assert_ok!(Sudo::sudo(Origin::signed(1), call));
|
||||
System::assert_has_event(TestEvent::sudo(Event::Sudid(Ok(()))));
|
||||
System::assert_has_event(TestEvent::Sudo(Event::Sudid(Ok(()))));
|
||||
})
|
||||
}
|
||||
|
||||
@@ -96,7 +96,7 @@ fn sudo_unchecked_weight_emits_events_correctly() {
|
||||
// Should emit event to indicate success when called with the root `key` and `call` is `Ok`.
|
||||
let call = Box::new(Call::Logger(LoggerCall::privileged_i32_log(42, 1)));
|
||||
assert_ok!(Sudo::sudo_unchecked_weight(Origin::signed(1), call, 1_000));
|
||||
System::assert_has_event(TestEvent::sudo(Event::Sudid(Ok(()))));
|
||||
System::assert_has_event(TestEvent::Sudo(Event::Sudid(Ok(()))));
|
||||
})
|
||||
}
|
||||
|
||||
@@ -122,10 +122,10 @@ fn set_key_emits_events_correctly() {
|
||||
|
||||
// A root `key` can change the root `key`.
|
||||
assert_ok!(Sudo::set_key(Origin::signed(1), 2));
|
||||
System::assert_has_event(TestEvent::sudo(Event::KeyChanged(1)));
|
||||
System::assert_has_event(TestEvent::Sudo(Event::KeyChanged(1)));
|
||||
// Double check.
|
||||
assert_ok!(Sudo::set_key(Origin::signed(2), 4));
|
||||
System::assert_has_event(TestEvent::sudo(Event::KeyChanged(2)));
|
||||
System::assert_has_event(TestEvent::Sudo(Event::KeyChanged(2)));
|
||||
});
|
||||
}
|
||||
|
||||
@@ -160,6 +160,6 @@ fn sudo_as_emits_events_correctly() {
|
||||
// A non-privileged function will work when passed to `sudo_as` with the root `key`.
|
||||
let call = Box::new(Call::Logger(LoggerCall::non_privileged_log(42, 1)));
|
||||
assert_ok!(Sudo::sudo_as(Origin::signed(1), 2, call));
|
||||
System::assert_has_event(TestEvent::sudo(Event::SudoAsDone(Ok(()))));
|
||||
System::assert_has_event(TestEvent::Sudo(Event::SudoAsDone(Ok(()))));
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user