mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 17:01:09 +00:00
Disarm OnRuntimeUpgrade::pre/post_upgrade Tuple footgun (#14759)
* return error on incorrect tuple usage of pre_upgrade and post_upgrade * add test * comment lint * Update frame/support/src/traits/hooks.rs Co-authored-by: Keith Yeung <kungfukeith11@gmail.com> * Update frame/support/src/traits/hooks.rs Co-authored-by: Keith Yeung <kungfukeith11@gmail.com> * address feedback * Update frame/support/src/traits/hooks.rs Co-authored-by: Keith Yeung <kungfukeith11@gmail.com> * Update frame/support/src/traits/hooks.rs Co-authored-by: Keith Yeung <kungfukeith11@gmail.com> * Update frame/support/src/traits/hooks.rs Co-authored-by: Keith Yeung <kungfukeith11@gmail.com> * muharem comments * Update frame/support/src/traits/hooks.rs Co-authored-by: Muharem Ismailov <ismailov.m.h@gmail.com> * Update frame/support/src/traits/hooks.rs Co-authored-by: Muharem Ismailov <ismailov.m.h@gmail.com> * remove useless type --------- Co-authored-by: Keith Yeung <kungfukeith11@gmail.com> Co-authored-by: Muharem Ismailov <ismailov.m.h@gmail.com>
This commit is contained in:
@@ -53,8 +53,6 @@ pub trait UnlockConfig: 'static {
|
||||
type PalletId: Get<LockIdentifier>;
|
||||
/// The DB weight as configured in the runtime to calculate the correct weight.
|
||||
type DbWeight: Get<RuntimeDbWeight>;
|
||||
/// The block number as configured in the runtime.
|
||||
type BlockNumber: Parameter + Zero + Copy + Ord;
|
||||
}
|
||||
|
||||
#[storage_alias(dynamic)]
|
||||
@@ -331,7 +329,6 @@ mod test {
|
||||
assert_ok, parameter_types,
|
||||
traits::{Currency, OnRuntimeUpgrade, ReservableCurrency, WithdrawReasons},
|
||||
};
|
||||
use frame_system::pallet_prelude::BlockNumberFor;
|
||||
|
||||
parameter_types! {
|
||||
const PalletName: &'static str = "Elections";
|
||||
@@ -341,7 +338,6 @@ mod test {
|
||||
impl super::UnlockConfig for UnlockConfigImpl {
|
||||
type Currency = Balances;
|
||||
type AccountId = u64;
|
||||
type BlockNumber = BlockNumberFor<Test>;
|
||||
type DbWeight = ();
|
||||
type PalletName = PalletName;
|
||||
type MaxVotesPerVoter = PhragmenMaxVoters;
|
||||
|
||||
Reference in New Issue
Block a user