mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 08:51:09 +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:
@@ -464,7 +464,7 @@ macro_rules! decl_tests {
|
||||
assert_ok!(Balances::reserve(&1, 110));
|
||||
assert_ok!(Balances::repatriate_reserved(&1, &2, 41, Status::Free), 0);
|
||||
System::assert_last_event(
|
||||
Event::pallet_balances(crate::Event::ReserveRepatriated(1, 2, 41, Status::Free))
|
||||
Event::Balances(crate::Event::ReserveRepatriated(1, 2, 41, Status::Free))
|
||||
);
|
||||
assert_eq!(Balances::reserved_balance(1), 69);
|
||||
assert_eq!(Balances::free_balance(1), 0);
|
||||
@@ -683,18 +683,18 @@ macro_rules! decl_tests {
|
||||
System::set_block_number(2);
|
||||
assert_ok!(Balances::reserve(&1, 10));
|
||||
|
||||
System::assert_last_event(Event::pallet_balances(crate::Event::Reserved(1, 10)));
|
||||
System::assert_last_event(Event::Balances(crate::Event::Reserved(1, 10)));
|
||||
|
||||
System::set_block_number(3);
|
||||
assert!(Balances::unreserve(&1, 5).is_zero());
|
||||
|
||||
System::assert_last_event(Event::pallet_balances(crate::Event::Unreserved(1, 5)));
|
||||
System::assert_last_event(Event::Balances(crate::Event::Unreserved(1, 5)));
|
||||
|
||||
System::set_block_number(4);
|
||||
assert_eq!(Balances::unreserve(&1, 6), 1);
|
||||
|
||||
// should only unreserve 5
|
||||
System::assert_last_event(Event::pallet_balances(crate::Event::Unreserved(1, 5)));
|
||||
System::assert_last_event(Event::Balances(crate::Event::Unreserved(1, 5)));
|
||||
});
|
||||
}
|
||||
|
||||
@@ -709,9 +709,9 @@ macro_rules! decl_tests {
|
||||
assert_eq!(
|
||||
events(),
|
||||
[
|
||||
Event::frame_system(system::Event::NewAccount(1)),
|
||||
Event::pallet_balances(crate::Event::Endowed(1, 100)),
|
||||
Event::pallet_balances(crate::Event::BalanceSet(1, 100, 0)),
|
||||
Event::System(system::Event::NewAccount(1)),
|
||||
Event::Balances(crate::Event::Endowed(1, 100)),
|
||||
Event::Balances(crate::Event::BalanceSet(1, 100, 0)),
|
||||
]
|
||||
);
|
||||
|
||||
@@ -721,8 +721,8 @@ macro_rules! decl_tests {
|
||||
assert_eq!(
|
||||
events(),
|
||||
[
|
||||
Event::frame_system(system::Event::KilledAccount(1)),
|
||||
Event::pallet_balances(crate::Event::DustLost(1, 99)),
|
||||
Event::System(system::Event::KilledAccount(1)),
|
||||
Event::Balances(crate::Event::DustLost(1, 99)),
|
||||
]
|
||||
);
|
||||
});
|
||||
@@ -739,9 +739,9 @@ macro_rules! decl_tests {
|
||||
assert_eq!(
|
||||
events(),
|
||||
[
|
||||
Event::frame_system(system::Event::NewAccount(1)),
|
||||
Event::pallet_balances(crate::Event::Endowed(1, 100)),
|
||||
Event::pallet_balances(crate::Event::BalanceSet(1, 100, 0)),
|
||||
Event::System(system::Event::NewAccount(1)),
|
||||
Event::Balances(crate::Event::Endowed(1, 100)),
|
||||
Event::Balances(crate::Event::BalanceSet(1, 100, 0)),
|
||||
]
|
||||
);
|
||||
|
||||
@@ -751,7 +751,7 @@ macro_rules! decl_tests {
|
||||
assert_eq!(
|
||||
events(),
|
||||
[
|
||||
Event::frame_system(system::Event::KilledAccount(1))
|
||||
Event::System(system::Event::KilledAccount(1))
|
||||
]
|
||||
);
|
||||
});
|
||||
|
||||
@@ -172,9 +172,9 @@ fn emit_events_with_no_existential_deposit_suicide_with_dust() {
|
||||
assert_eq!(
|
||||
events(),
|
||||
[
|
||||
Event::frame_system(system::Event::NewAccount(1)),
|
||||
Event::pallet_balances(crate::Event::Endowed(1, 100)),
|
||||
Event::pallet_balances(crate::Event::BalanceSet(1, 100, 0)),
|
||||
Event::System(system::Event::NewAccount(1)),
|
||||
Event::Balances(crate::Event::Endowed(1, 100)),
|
||||
Event::Balances(crate::Event::BalanceSet(1, 100, 0)),
|
||||
]
|
||||
);
|
||||
|
||||
@@ -190,8 +190,8 @@ fn emit_events_with_no_existential_deposit_suicide_with_dust() {
|
||||
assert_eq!(
|
||||
events(),
|
||||
[
|
||||
Event::frame_system(system::Event::KilledAccount(1)),
|
||||
Event::pallet_balances(crate::Event::DustLost(1, 1)),
|
||||
Event::System(system::Event::KilledAccount(1)),
|
||||
Event::Balances(crate::Event::DustLost(1, 1)),
|
||||
]
|
||||
);
|
||||
});
|
||||
|
||||
@@ -188,8 +188,8 @@ fn transfer_dust_removal_tst1_should_work() {
|
||||
// Number of events expected is 8
|
||||
assert_eq!(System::events().len(), 11);
|
||||
|
||||
System::assert_has_event(Event::pallet_balances(crate::Event::Transfer(2, 3, 450)));
|
||||
System::assert_has_event(Event::pallet_balances(crate::Event::DustLost(2, 50)));
|
||||
System::assert_has_event(Event::Balances(crate::Event::Transfer(2, 3, 450)));
|
||||
System::assert_has_event(Event::Balances(crate::Event::DustLost(2, 50)));
|
||||
}
|
||||
);
|
||||
}
|
||||
@@ -220,8 +220,8 @@ fn transfer_dust_removal_tst2_should_work() {
|
||||
// Number of events expected is 8
|
||||
assert_eq!(System::events().len(), 9);
|
||||
|
||||
System::assert_has_event(Event::pallet_balances(crate::Event::Transfer(2, 1, 450)));
|
||||
System::assert_has_event(Event::pallet_balances(crate::Event::DustLost(2, 50)));
|
||||
System::assert_has_event(Event::Balances(crate::Event::Transfer(2, 1, 450)));
|
||||
System::assert_has_event(Event::Balances(crate::Event::DustLost(2, 50)));
|
||||
}
|
||||
);
|
||||
}
|
||||
@@ -261,11 +261,11 @@ fn repatriating_reserved_balance_dust_removal_should_work() {
|
||||
// Number of events expected is 10
|
||||
assert_eq!(System::events().len(), 10);
|
||||
|
||||
System::assert_has_event(Event::pallet_balances(
|
||||
System::assert_has_event(Event::Balances(
|
||||
crate::Event::ReserveRepatriated(2, 1, 450, Status::Free),
|
||||
));
|
||||
|
||||
System::assert_last_event(Event::pallet_balances(crate::Event::DustLost(2, 50)));
|
||||
System::assert_last_event(Event::Balances(crate::Event::DustLost(2, 50)));
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user