Skip to content

Commit

Permalink
Update new runtimes to use new proxy pallet config
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidK committed Sep 17, 2024
1 parent 4e76c2e commit 0332ab4
Show file tree
Hide file tree
Showing 4 changed files with 96 additions and 38 deletions.
34 changes: 24 additions & 10 deletions cumulus/parachains/runtimes/coretime/coretime-rococo/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ use frame_support::{
genesis_builder_helper::{build_state, get_preset},
parameter_types,
traits::{
ConstBool, ConstU32, ConstU64, ConstU8, EitherOfDiverse, InstanceFilter, TransformOrigin,
fungible::HoldConsideration, ConstBool, ConstU32, ConstU64, ConstU8, EitherOfDiverse,
InstanceFilter, LinearStoragePrice, TransformOrigin, ZeroFootprintOr,
},
weights::{ConstantMultiplier, Weight, WeightToFee as _},
PalletId,
Expand Down Expand Up @@ -549,28 +550,41 @@ impl InstanceFilter<RuntimeCall> for ProxyType {
parameter_types! {
// One storage item; key size 32, value size 8; .
pub const ProxyDepositBase: Balance = deposit(1, 40);
// Additional storage item size of 33 bytes.
pub const ProxyDepositFactor: Balance = deposit(0, 33);
pub const ProxyDepositPerByte: Balance = deposit(0, 1);
pub const MaxProxies: u16 = 32;
// One storage item; key size 32, value size 16
pub const AnnouncementDepositBase: Balance = deposit(1, 48);
pub const AnnouncementDepositFactor: Balance = deposit(0, 66);
pub const AnnouncementDepositPerByte: Balance = deposit(0, 1);
pub const MaxPending: u16 = 32;
pub const ProxyHoldReason: RuntimeHoldReason = RuntimeHoldReason::Proxy(pallet_proxy::HoldReason::Proxy);
pub const AnnouncementHoldReason: RuntimeHoldReason = RuntimeHoldReason::Proxy(pallet_proxy::HoldReason::Announcement);
}

impl pallet_proxy::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type RuntimeCall = RuntimeCall;
type Currency = Balances;
type ProxyType = ProxyType;
type ProxyDepositBase = ProxyDepositBase;
type ProxyDepositFactor = ProxyDepositFactor;
type MaxProxies = MaxProxies;
type WeightInfo = weights::pallet_proxy::WeightInfo<Runtime>;
type MaxPending = MaxPending;
type CallHasher = BlakeTwo256;
type AnnouncementDepositBase = AnnouncementDepositBase;
type AnnouncementDepositFactor = AnnouncementDepositFactor;
type ProxyConsideration = HoldConsideration<
AccountId,
Balances,
ProxyHoldReason,
ZeroFootprintOr<
LinearStoragePrice<ProxyDepositBase, ProxyDepositPerByte, Balance>,
Balance,
>,
>;
type AnnouncementConsideration = HoldConsideration<
AccountId,
Balances,
ProxyHoldReason,
ZeroFootprintOr<
LinearStoragePrice<AnnouncementDepositBase, AnnouncementDepositPerByte, Balance>,
Balance,
>,
>;
}

impl pallet_utility::Config for Runtime {
Expand Down
33 changes: 24 additions & 9 deletions cumulus/parachains/runtimes/coretime/coretime-westend/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ use frame_support::{
genesis_builder_helper::{build_state, get_preset},
parameter_types,
traits::{
ConstBool, ConstU32, ConstU64, ConstU8, EitherOfDiverse, InstanceFilter, TransformOrigin,
fungible::HoldConsideration, ConstBool, ConstU32, ConstU64, ConstU8, EitherOfDiverse,
InstanceFilter, LinearStoragePrice, TransformOrigin, ZeroFootprintOr,
},
weights::{ConstantMultiplier, Weight, WeightToFee as _},
PalletId,
Expand Down Expand Up @@ -549,28 +550,42 @@ impl InstanceFilter<RuntimeCall> for ProxyType {
parameter_types! {
// One storage item; key size 32, value size 8; .
pub const ProxyDepositBase: Balance = deposit(1, 40);
// Additional storage item size of 33 bytes.
pub const ProxyDepositFactor: Balance = deposit(0, 33);
pub const ProxyDepositPerByte: Balance = deposit(0, 1);
pub const MaxProxies: u16 = 32;
// One storage item; key size 32, value size 16
pub const AnnouncementDepositBase: Balance = deposit(1, 48);
pub const AnnouncementDepositFactor: Balance = deposit(0, 66);
pub const AnnouncementDepositPerByte: Balance = deposit(0, 1);
pub const MaxPending: u16 = 32;
pub const ProxyHoldReason: RuntimeHoldReason = RuntimeHoldReason::Proxy(pallet_proxy::HoldReason::Proxy);
pub const AnnouncementHoldReason: RuntimeHoldReason = RuntimeHoldReason::Proxy(pallet_proxy::HoldReason::Announcement);
}

impl pallet_proxy::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type RuntimeCall = RuntimeCall;
type Currency = Balances;
type ProxyType = ProxyType;
type ProxyDepositBase = ProxyDepositBase;
type ProxyDepositFactor = ProxyDepositFactor;
type MaxProxies = MaxProxies;
type WeightInfo = weights::pallet_proxy::WeightInfo<Runtime>;
type MaxPending = MaxPending;
type CallHasher = BlakeTwo256;
type AnnouncementDepositBase = AnnouncementDepositBase;
type AnnouncementDepositFactor = AnnouncementDepositFactor;
type ProxyConsideration = HoldConsideration<
AccountId,
Balances,
ProxyHoldReason,
ZeroFootprintOr<
LinearStoragePrice<ProxyDepositBase, ProxyDepositPerByte, Balance>,
Balance,
>,
>;
type AnnouncementConsideration = HoldConsideration<
AccountId,
Balances,
ProxyHoldReason,
ZeroFootprintOr<
LinearStoragePrice<AnnouncementDepositBase, AnnouncementDepositPerByte, Balance>,
Balance,
>,
>;
}

impl pallet_utility::Config for Runtime {
Expand Down
34 changes: 24 additions & 10 deletions cumulus/parachains/runtimes/people/people-rococo/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ use frame_support::{
genesis_builder_helper::{build_state, get_preset},
parameter_types,
traits::{
ConstBool, ConstU32, ConstU64, ConstU8, EitherOfDiverse, Everything, InstanceFilter,
TransformOrigin,
fungible::HoldConsideration, ConstBool, ConstU32, ConstU64, ConstU8, EitherOfDiverse,
Everything, InstanceFilter, LinearStoragePrice, TransformOrigin, ZeroFootprintOr,
},
weights::{ConstantMultiplier, Weight, WeightToFee as _},
PalletId,
Expand Down Expand Up @@ -492,28 +492,42 @@ impl InstanceFilter<RuntimeCall> for ProxyType {
parameter_types! {
// One storage item; key size 32, value size 8.
pub const ProxyDepositBase: Balance = deposit(1, 40);
// Additional storage item size of 33 bytes.
pub const ProxyDepositFactor: Balance = deposit(0, 33);
pub const ProxyDepositPerByte: Balance = deposit(0, 1);
pub const MaxProxies: u16 = 32;
// One storage item; key size 32, value size 16.
pub const AnnouncementDepositBase: Balance = deposit(1, 48);
pub const AnnouncementDepositFactor: Balance = deposit(0, 66);
pub const AnnouncementDepositPerByte: Balance = deposit(0, 1);
pub const MaxPending: u16 = 32;
pub const ProxyHoldReason: RuntimeHoldReason = RuntimeHoldReason::Proxy(pallet_proxy::HoldReason::Proxy);
pub const AnnouncementHoldReason: RuntimeHoldReason = RuntimeHoldReason::Proxy(pallet_proxy::HoldReason::Announcement);
}

impl pallet_proxy::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type RuntimeCall = RuntimeCall;
type Currency = Balances;
type ProxyType = ProxyType;
type ProxyDepositBase = ProxyDepositBase;
type ProxyDepositFactor = ProxyDepositFactor;
type MaxProxies = MaxProxies;
type WeightInfo = weights::pallet_proxy::WeightInfo<Runtime>;
type MaxPending = MaxPending;
type CallHasher = BlakeTwo256;
type AnnouncementDepositBase = AnnouncementDepositBase;
type AnnouncementDepositFactor = AnnouncementDepositFactor;
type ProxyConsideration = HoldConsideration<
AccountId,
Balances,
ProxyHoldReason,
ZeroFootprintOr<
LinearStoragePrice<ProxyDepositBase, ProxyDepositPerByte, Balance>,
Balance,
>,
>;
type AnnouncementConsideration = HoldConsideration<
AccountId,
Balances,
ProxyHoldReason,
ZeroFootprintOr<
LinearStoragePrice<AnnouncementDepositBase, AnnouncementDepositPerByte, Balance>,
Balance,
>,
>;
}

impl pallet_utility::Config for Runtime {
Expand Down
33 changes: 24 additions & 9 deletions cumulus/parachains/runtimes/people/people-westend/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ use frame_support::{
genesis_builder_helper::{build_state, get_preset},
parameter_types,
traits::{
ConstBool, ConstU32, ConstU64, ConstU8, EitherOfDiverse, Everything, InstanceFilter,
TransformOrigin,
fungible::HoldConsideration, ConstBool, ConstU32, ConstU64, ConstU8, EitherOfDiverse,
Everything, InstanceFilter, LinearStoragePrice, TransformOrigin, ZeroFootprintOr,
},
weights::{ConstantMultiplier, Weight, WeightToFee as _},
PalletId,
Expand Down Expand Up @@ -493,27 +493,42 @@ parameter_types! {
// One storage item; key size 32, value size 8.
pub const ProxyDepositBase: Balance = deposit(1, 40);
// Additional storage item size of 33 bytes.
pub const ProxyDepositFactor: Balance = deposit(0, 33);
pub const ProxyDepositPerByte: Balance = deposit(0, 1);
pub const MaxProxies: u16 = 32;
// One storage item; key size 32, value size 16.
pub const AnnouncementDepositBase: Balance = deposit(1, 48);
pub const AnnouncementDepositFactor: Balance = deposit(0, 66);
pub const AnnouncementDepositPerByte: Balance = deposit(0, 1);
pub const MaxPending: u16 = 32;
pub const ProxyHoldReason: RuntimeHoldReason = RuntimeHoldReason::Proxy(pallet_proxy::HoldReason::Proxy);
pub const AnnouncementHoldReason: RuntimeHoldReason = RuntimeHoldReason::Proxy(pallet_proxy::HoldReason::Announcement);
}

impl pallet_proxy::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type RuntimeCall = RuntimeCall;
type Currency = Balances;
type ProxyType = ProxyType;
type ProxyDepositBase = ProxyDepositBase;
type ProxyDepositFactor = ProxyDepositFactor;
type MaxProxies = MaxProxies;
type WeightInfo = weights::pallet_proxy::WeightInfo<Runtime>;
type MaxPending = MaxPending;
type CallHasher = BlakeTwo256;
type AnnouncementDepositBase = AnnouncementDepositBase;
type AnnouncementDepositFactor = AnnouncementDepositFactor;
type ProxyConsideration = HoldConsideration<
AccountId,
Balances,
ProxyHoldReason,
ZeroFootprintOr<
LinearStoragePrice<ProxyDepositBase, ProxyDepositPerByte, Balance>,
Balance,
>,
>;
type AnnouncementConsideration = HoldConsideration<
AccountId,
Balances,
ProxyHoldReason,
ZeroFootprintOr<
LinearStoragePrice<AnnouncementDepositBase, AnnouncementDepositPerByte, Balance>,
Balance,
>,
>;
}

impl pallet_utility::Config for Runtime {
Expand Down

0 comments on commit 0332ab4

Please sign in to comment.