Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Commit fb0dd8e

Browse files
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 <[email protected]> Co-authored-by: parity-processbot <>
1 parent 1c786b3 commit fb0dd8e

File tree

8 files changed

+210
-186
lines changed

8 files changed

+210
-186
lines changed

Cargo.lock

Lines changed: 179 additions & 178 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

runtime/common/src/claims.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -717,7 +717,7 @@ mod tests {
717717
assert_err, assert_noop, assert_ok,
718718
dispatch::{DispatchError::BadOrigin, GetDispatchInfo, Pays},
719719
ord_parameter_types, parameter_types,
720-
traits::{ExistenceRequirement, GenesisBuild},
720+
traits::{ExistenceRequirement, GenesisBuild, WithdrawReasons},
721721
};
722722
use pallet_balances;
723723
use sp_runtime::{
@@ -790,6 +790,8 @@ mod tests {
790790

791791
parameter_types! {
792792
pub const MinVestedTransfer: u64 = 1;
793+
pub UnvestedFundsAllowedWithdrawReasons: WithdrawReasons =
794+
WithdrawReasons::except(WithdrawReasons::TRANSFER | WithdrawReasons::RESERVE);
793795
}
794796

795797
impl pallet_vesting::Config for Test {
@@ -798,6 +800,7 @@ mod tests {
798800
type BlockNumberToBalance = Identity;
799801
type MinVestedTransfer = MinVestedTransfer;
800802
type WeightInfo = ();
803+
type UnvestedFundsAllowedWithdrawReasons = UnvestedFundsAllowedWithdrawReasons;
801804
const MAX_VESTING_SCHEDULES: u32 = 28;
802805
}
803806

runtime/common/src/purchase.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -474,8 +474,10 @@ mod tests {
474474
// or public keys. `u64` is used as the `AccountId` and no `Signature`s are required.
475475
use crate::purchase;
476476
use frame_support::{
477-
assert_noop, assert_ok, dispatch::DispatchError::BadOrigin, ord_parameter_types,
478-
parameter_types, traits::Currency,
477+
assert_noop, assert_ok,
478+
dispatch::DispatchError::BadOrigin,
479+
ord_parameter_types, parameter_types,
480+
traits::{Currency, WithdrawReasons},
479481
};
480482
use pallet_balances::Error as BalancesError;
481483
use sp_runtime::{
@@ -550,6 +552,8 @@ mod tests {
550552

551553
parameter_types! {
552554
pub const MinVestedTransfer: u64 = 1;
555+
pub UnvestedFundsAllowedWithdrawReasons: WithdrawReasons =
556+
WithdrawReasons::except(WithdrawReasons::TRANSFER | WithdrawReasons::RESERVE);
553557
}
554558

555559
impl pallet_vesting::Config for Test {
@@ -558,6 +562,7 @@ mod tests {
558562
type BlockNumberToBalance = Identity;
559563
type MinVestedTransfer = MinVestedTransfer;
560564
type WeightInfo = ();
565+
type UnvestedFundsAllowedWithdrawReasons = UnvestedFundsAllowedWithdrawReasons;
561566
const MAX_VESTING_SCHEDULES: u32 = 28;
562567
}
563568

runtime/kusama/src/lib.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ use frame_support::{
5252
construct_runtime, parameter_types,
5353
traits::{
5454
ConstU32, Contains, EitherOf, EitherOfDiverse, InstanceFilter, KeyOwnerProofSystem,
55-
LockIdentifier, PrivilegeCmp,
55+
LockIdentifier, PrivilegeCmp, WithdrawReasons,
5656
},
5757
weights::ConstantMultiplier,
5858
PalletId, RuntimeDebug,
@@ -931,6 +931,8 @@ impl pallet_society::Config for Runtime {
931931

932932
parameter_types! {
933933
pub const MinVestedTransfer: Balance = 100 * CENTS;
934+
pub UnvestedFundsAllowedWithdrawReasons: WithdrawReasons =
935+
WithdrawReasons::except(WithdrawReasons::TRANSFER | WithdrawReasons::RESERVE);
934936
}
935937

936938
impl pallet_vesting::Config for Runtime {
@@ -939,6 +941,7 @@ impl pallet_vesting::Config for Runtime {
939941
type BlockNumberToBalance = ConvertInto;
940942
type MinVestedTransfer = MinVestedTransfer;
941943
type WeightInfo = weights::pallet_vesting::WeightInfo<Runtime>;
944+
type UnvestedFundsAllowedWithdrawReasons = UnvestedFundsAllowedWithdrawReasons;
942945
const MAX_VESTING_SCHEDULES: u32 = 28;
943946
}
944947

runtime/polkadot/src/lib.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ use frame_support::{
4242
construct_runtime, parameter_types,
4343
traits::{
4444
ConstU32, EitherOfDiverse, InstanceFilter, KeyOwnerProofSystem, LockIdentifier,
45-
PrivilegeCmp,
45+
PrivilegeCmp, WithdrawReasons,
4646
},
4747
weights::ConstantMultiplier,
4848
PalletId, RuntimeDebug,
@@ -992,6 +992,8 @@ impl claims::Config for Runtime {
992992

993993
parameter_types! {
994994
pub const MinVestedTransfer: Balance = 1 * DOLLARS;
995+
pub UnvestedFundsAllowedWithdrawReasons: WithdrawReasons =
996+
WithdrawReasons::except(WithdrawReasons::TRANSFER | WithdrawReasons::RESERVE);
995997
}
996998

997999
impl pallet_vesting::Config for Runtime {
@@ -1000,6 +1002,7 @@ impl pallet_vesting::Config for Runtime {
10001002
type BlockNumberToBalance = ConvertInto;
10011003
type MinVestedTransfer = MinVestedTransfer;
10021004
type WeightInfo = weights::pallet_vesting::WeightInfo<Runtime>;
1005+
type UnvestedFundsAllowedWithdrawReasons = UnvestedFundsAllowedWithdrawReasons;
10031006
const MAX_VESTING_SCHEDULES: u32 = 28;
10041007
}
10051008

runtime/rococo/src/lib.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ use frame_support::{
5555
construct_runtime, parameter_types,
5656
traits::{
5757
Contains, EitherOfDiverse, InstanceFilter, KeyOwnerProofSystem, LockIdentifier,
58-
PrivilegeCmp,
58+
PrivilegeCmp, WithdrawReasons,
5959
},
6060
weights::ConstantMultiplier,
6161
PalletId, RuntimeDebug,
@@ -857,6 +857,8 @@ impl pallet_society::Config for Runtime {
857857

858858
parameter_types! {
859859
pub const MinVestedTransfer: Balance = 100 * CENTS;
860+
pub UnvestedFundsAllowedWithdrawReasons: WithdrawReasons =
861+
WithdrawReasons::except(WithdrawReasons::TRANSFER | WithdrawReasons::RESERVE);
860862
}
861863

862864
impl pallet_vesting::Config for Runtime {
@@ -865,6 +867,7 @@ impl pallet_vesting::Config for Runtime {
865867
type BlockNumberToBalance = ConvertInto;
866868
type MinVestedTransfer = MinVestedTransfer;
867869
type WeightInfo = weights::pallet_vesting::WeightInfo<Runtime>;
870+
type UnvestedFundsAllowedWithdrawReasons = UnvestedFundsAllowedWithdrawReasons;
868871
const MAX_VESTING_SCHEDULES: u32 = 28;
869872
}
870873

runtime/test-runtime/src/lib.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ use beefy_primitives::crypto::AuthorityId as BeefyId;
3838
use frame_election_provider_support::{onchain, SequentialPhragmen};
3939
use frame_support::{
4040
construct_runtime, parameter_types,
41-
traits::{Everything, KeyOwnerProofSystem},
41+
traits::{Everything, KeyOwnerProofSystem, WithdrawReasons},
4242
};
4343
use pallet_grandpa::{fg_primitives, AuthorityId as GrandpaId};
4444
use pallet_session::historical as session_historical;
@@ -455,6 +455,8 @@ impl claims::Config for Runtime {
455455

456456
parameter_types! {
457457
pub storage MinVestedTransfer: Balance = 100 * DOLLARS;
458+
pub UnvestedFundsAllowedWithdrawReasons: WithdrawReasons =
459+
WithdrawReasons::except(WithdrawReasons::TRANSFER | WithdrawReasons::RESERVE);
458460
}
459461

460462
impl pallet_vesting::Config for Runtime {
@@ -463,6 +465,7 @@ impl pallet_vesting::Config for Runtime {
463465
type BlockNumberToBalance = ConvertInto;
464466
type MinVestedTransfer = MinVestedTransfer;
465467
type WeightInfo = ();
468+
type UnvestedFundsAllowedWithdrawReasons = UnvestedFundsAllowedWithdrawReasons;
466469
const MAX_VESTING_SCHEDULES: u32 = 28;
467470
}
468471

runtime/westend/src/lib.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ use beefy_primitives::crypto::AuthorityId as BeefyId;
2525
use frame_election_provider_support::{onchain, SequentialPhragmen};
2626
use frame_support::{
2727
construct_runtime, parameter_types,
28-
traits::{ConstU32, InstanceFilter, KeyOwnerProofSystem},
28+
traits::{ConstU32, InstanceFilter, KeyOwnerProofSystem, WithdrawReasons},
2929
weights::ConstantMultiplier,
3030
PalletId,
3131
};
@@ -712,6 +712,8 @@ impl pallet_recovery::Config for Runtime {
712712

713713
parameter_types! {
714714
pub const MinVestedTransfer: Balance = 100 * CENTS;
715+
pub UnvestedFundsAllowedWithdrawReasons: WithdrawReasons =
716+
WithdrawReasons::except(WithdrawReasons::TRANSFER | WithdrawReasons::RESERVE);
715717
}
716718

717719
impl pallet_vesting::Config for Runtime {
@@ -720,6 +722,7 @@ impl pallet_vesting::Config for Runtime {
720722
type BlockNumberToBalance = ConvertInto;
721723
type MinVestedTransfer = MinVestedTransfer;
722724
type WeightInfo = weights::pallet_vesting::WeightInfo<Runtime>;
725+
type UnvestedFundsAllowedWithdrawReasons = UnvestedFundsAllowedWithdrawReasons;
723726
const MAX_VESTING_SCHEDULES: u32 = 28;
724727
}
725728

0 commit comments

Comments
 (0)