Companion for 12109 (#5929)

* Update following `pallet-vesting` configurable `WithdrawReasons`

* Update lib.rs

* Update lib.rs

* Update lib.rs

* update lockfile for {"substrate"}

* fix warning

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
Co-authored-by: parity-processbot <>
This commit is contained in:
Leszek Wiesner
2022-10-10 00:23:54 +02:00
committed by GitHub
parent 607350449c
commit 71197818a4
8 changed files with 210 additions and 186 deletions
+179 -178
View File
File diff suppressed because it is too large Load Diff
+4 -1
View File
@@ -717,7 +717,7 @@ mod tests {
assert_err, assert_noop, assert_ok,
dispatch::{DispatchError::BadOrigin, GetDispatchInfo, Pays},
ord_parameter_types, parameter_types,
traits::{ExistenceRequirement, GenesisBuild},
traits::{ExistenceRequirement, GenesisBuild, WithdrawReasons},
};
use pallet_balances;
use sp_runtime::{
@@ -790,6 +790,8 @@ mod tests {
parameter_types! {
pub const MinVestedTransfer: u64 = 1;
pub UnvestedFundsAllowedWithdrawReasons: WithdrawReasons =
WithdrawReasons::except(WithdrawReasons::TRANSFER | WithdrawReasons::RESERVE);
}
impl pallet_vesting::Config for Test {
@@ -798,6 +800,7 @@ mod tests {
type BlockNumberToBalance = Identity;
type MinVestedTransfer = MinVestedTransfer;
type WeightInfo = ();
type UnvestedFundsAllowedWithdrawReasons = UnvestedFundsAllowedWithdrawReasons;
const MAX_VESTING_SCHEDULES: u32 = 28;
}
+7 -2
View File
@@ -474,8 +474,10 @@ mod tests {
// or public keys. `u64` is used as the `AccountId` and no `Signature`s are required.
use crate::purchase;
use frame_support::{
assert_noop, assert_ok, dispatch::DispatchError::BadOrigin, ord_parameter_types,
parameter_types, traits::Currency,
assert_noop, assert_ok,
dispatch::DispatchError::BadOrigin,
ord_parameter_types, parameter_types,
traits::{Currency, WithdrawReasons},
};
use pallet_balances::Error as BalancesError;
use sp_runtime::{
@@ -550,6 +552,8 @@ mod tests {
parameter_types! {
pub const MinVestedTransfer: u64 = 1;
pub UnvestedFundsAllowedWithdrawReasons: WithdrawReasons =
WithdrawReasons::except(WithdrawReasons::TRANSFER | WithdrawReasons::RESERVE);
}
impl pallet_vesting::Config for Test {
@@ -558,6 +562,7 @@ mod tests {
type BlockNumberToBalance = Identity;
type MinVestedTransfer = MinVestedTransfer;
type WeightInfo = ();
type UnvestedFundsAllowedWithdrawReasons = UnvestedFundsAllowedWithdrawReasons;
const MAX_VESTING_SCHEDULES: u32 = 28;
}
+4 -1
View File
@@ -52,7 +52,7 @@ use frame_support::{
construct_runtime, parameter_types,
traits::{
ConstU32, Contains, EitherOf, EitherOfDiverse, InstanceFilter, KeyOwnerProofSystem,
LockIdentifier, PrivilegeCmp,
LockIdentifier, PrivilegeCmp, WithdrawReasons,
},
weights::ConstantMultiplier,
PalletId, RuntimeDebug,
@@ -931,6 +931,8 @@ impl pallet_society::Config for Runtime {
parameter_types! {
pub const MinVestedTransfer: Balance = 100 * CENTS;
pub UnvestedFundsAllowedWithdrawReasons: WithdrawReasons =
WithdrawReasons::except(WithdrawReasons::TRANSFER | WithdrawReasons::RESERVE);
}
impl pallet_vesting::Config for Runtime {
@@ -939,6 +941,7 @@ impl pallet_vesting::Config for Runtime {
type BlockNumberToBalance = ConvertInto;
type MinVestedTransfer = MinVestedTransfer;
type WeightInfo = weights::pallet_vesting::WeightInfo<Runtime>;
type UnvestedFundsAllowedWithdrawReasons = UnvestedFundsAllowedWithdrawReasons;
const MAX_VESTING_SCHEDULES: u32 = 28;
}
+4 -1
View File
@@ -42,7 +42,7 @@ use frame_support::{
construct_runtime, parameter_types,
traits::{
ConstU32, EitherOfDiverse, InstanceFilter, KeyOwnerProofSystem, LockIdentifier,
PrivilegeCmp,
PrivilegeCmp, WithdrawReasons,
},
weights::ConstantMultiplier,
PalletId, RuntimeDebug,
@@ -992,6 +992,8 @@ impl claims::Config for Runtime {
parameter_types! {
pub const MinVestedTransfer: Balance = 1 * DOLLARS;
pub UnvestedFundsAllowedWithdrawReasons: WithdrawReasons =
WithdrawReasons::except(WithdrawReasons::TRANSFER | WithdrawReasons::RESERVE);
}
impl pallet_vesting::Config for Runtime {
@@ -1000,6 +1002,7 @@ impl pallet_vesting::Config for Runtime {
type BlockNumberToBalance = ConvertInto;
type MinVestedTransfer = MinVestedTransfer;
type WeightInfo = weights::pallet_vesting::WeightInfo<Runtime>;
type UnvestedFundsAllowedWithdrawReasons = UnvestedFundsAllowedWithdrawReasons;
const MAX_VESTING_SCHEDULES: u32 = 28;
}
+4 -1
View File
@@ -55,7 +55,7 @@ use frame_support::{
construct_runtime, parameter_types,
traits::{
Contains, EitherOfDiverse, InstanceFilter, KeyOwnerProofSystem, LockIdentifier,
PrivilegeCmp,
PrivilegeCmp, WithdrawReasons,
},
weights::ConstantMultiplier,
PalletId, RuntimeDebug,
@@ -857,6 +857,8 @@ impl pallet_society::Config for Runtime {
parameter_types! {
pub const MinVestedTransfer: Balance = 100 * CENTS;
pub UnvestedFundsAllowedWithdrawReasons: WithdrawReasons =
WithdrawReasons::except(WithdrawReasons::TRANSFER | WithdrawReasons::RESERVE);
}
impl pallet_vesting::Config for Runtime {
@@ -865,6 +867,7 @@ impl pallet_vesting::Config for Runtime {
type BlockNumberToBalance = ConvertInto;
type MinVestedTransfer = MinVestedTransfer;
type WeightInfo = weights::pallet_vesting::WeightInfo<Runtime>;
type UnvestedFundsAllowedWithdrawReasons = UnvestedFundsAllowedWithdrawReasons;
const MAX_VESTING_SCHEDULES: u32 = 28;
}
+4 -1
View File
@@ -38,7 +38,7 @@ use beefy_primitives::crypto::AuthorityId as BeefyId;
use frame_election_provider_support::{onchain, SequentialPhragmen};
use frame_support::{
construct_runtime, parameter_types,
traits::{Everything, KeyOwnerProofSystem},
traits::{Everything, KeyOwnerProofSystem, WithdrawReasons},
};
use pallet_grandpa::{fg_primitives, AuthorityId as GrandpaId};
use pallet_session::historical as session_historical;
@@ -455,6 +455,8 @@ impl claims::Config for Runtime {
parameter_types! {
pub storage MinVestedTransfer: Balance = 100 * DOLLARS;
pub UnvestedFundsAllowedWithdrawReasons: WithdrawReasons =
WithdrawReasons::except(WithdrawReasons::TRANSFER | WithdrawReasons::RESERVE);
}
impl pallet_vesting::Config for Runtime {
@@ -463,6 +465,7 @@ impl pallet_vesting::Config for Runtime {
type BlockNumberToBalance = ConvertInto;
type MinVestedTransfer = MinVestedTransfer;
type WeightInfo = ();
type UnvestedFundsAllowedWithdrawReasons = UnvestedFundsAllowedWithdrawReasons;
const MAX_VESTING_SCHEDULES: u32 = 28;
}
+4 -1
View File
@@ -25,7 +25,7 @@ use beefy_primitives::crypto::AuthorityId as BeefyId;
use frame_election_provider_support::{onchain, SequentialPhragmen};
use frame_support::{
construct_runtime, parameter_types,
traits::{ConstU32, InstanceFilter, KeyOwnerProofSystem},
traits::{ConstU32, InstanceFilter, KeyOwnerProofSystem, WithdrawReasons},
weights::ConstantMultiplier,
PalletId,
};
@@ -712,6 +712,8 @@ impl pallet_recovery::Config for Runtime {
parameter_types! {
pub const MinVestedTransfer: Balance = 100 * CENTS;
pub UnvestedFundsAllowedWithdrawReasons: WithdrawReasons =
WithdrawReasons::except(WithdrawReasons::TRANSFER | WithdrawReasons::RESERVE);
}
impl pallet_vesting::Config for Runtime {
@@ -720,6 +722,7 @@ impl pallet_vesting::Config for Runtime {
type BlockNumberToBalance = ConvertInto;
type MinVestedTransfer = MinVestedTransfer;
type WeightInfo = weights::pallet_vesting::WeightInfo<Runtime>;
type UnvestedFundsAllowedWithdrawReasons = UnvestedFundsAllowedWithdrawReasons;
const MAX_VESTING_SCHEDULES: u32 = 28;
}