Skip to content

Commit

Permalink
rename system para deposit function for clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
joepetrowski committed Jan 25, 2024
1 parent e34fab7 commit 296d296
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 42 deletions.
24 changes: 12 additions & 12 deletions system-parachains/asset-hubs/asset-hub-kusama/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -251,12 +251,12 @@ impl pallet_transaction_payment::Config for Runtime {

parameter_types! {
pub const AssetDeposit: Balance = UNITS / 10; // 1 / 10 UNITS deposit to create asset
pub const AssetAccountDeposit: Balance = deposit(1, 16);
pub const AssetAccountDeposit: Balance = system_para_deposit(1, 16);
pub const AssetsStringLimit: u32 = 50;
/// Key = 32 bytes, Value = 36 bytes (32+1+1+1+1)
// https://github.com/paritytech/substrate/blob/069917b/frame/assets/src/lib.rs#L257L271
pub const MetadataDepositBase: Balance = deposit(1, 68);
pub const MetadataDepositPerByte: Balance = deposit(0, 1);
pub const MetadataDepositBase: Balance = system_para_deposit(1, 68);
pub const MetadataDepositPerByte: Balance = system_para_deposit(0, 1);
}

/// We allow root to execute privileged asset operations.
Expand Down Expand Up @@ -403,9 +403,9 @@ impl pallet_assets::Config<ForeignAssetsInstance> for Runtime {

parameter_types! {
// One storage item; key size is 32; value is size 4+4+16+32 bytes = 56 bytes.
pub const DepositBase: Balance = deposit(1, 88);
pub const DepositBase: Balance = system_para_deposit(1, 88);
// Additional storage item size of 32 bytes.
pub const DepositFactor: Balance = deposit(0, 32);
pub const DepositFactor: Balance = system_para_deposit(0, 32);
pub const MaxSignatories: u32 = 100;
}

Expand All @@ -428,13 +428,13 @@ impl pallet_utility::Config for Runtime {

parameter_types! {
// One storage item; key size 32, value size 8; .
pub const ProxyDepositBase: Balance = deposit(1, 40);
pub const ProxyDepositBase: Balance = system_para_deposit(1, 40);
// Additional storage item size of 33 bytes.
pub const ProxyDepositFactor: Balance = deposit(0, 33);
pub const ProxyDepositFactor: Balance = system_para_deposit(0, 33);
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 AnnouncementDepositBase: Balance = system_para_deposit(1, 48);
pub const AnnouncementDepositFactor: Balance = system_para_deposit(0, 66);
pub const MaxPending: u16 = 32;
}

Expand Down Expand Up @@ -744,9 +744,9 @@ impl pallet_asset_conversion_tx_payment::Config for Runtime {
parameter_types! {
pub const UniquesCollectionDeposit: Balance = UNITS / 10; // 1 / 10 UNIT deposit to create a collection
pub const UniquesItemDeposit: Balance = UNITS / 1_000; // 1 / 1000 UNIT deposit to mint an item
pub const UniquesMetadataDepositBase: Balance = deposit(1, 129);
pub const UniquesAttributeDepositBase: Balance = deposit(1, 0);
pub const UniquesDepositPerByte: Balance = deposit(0, 1);
pub const UniquesMetadataDepositBase: Balance = system_para_deposit(1, 129);
pub const UniquesAttributeDepositBase: Balance = system_para_deposit(1, 0);
pub const UniquesDepositPerByte: Balance = system_para_deposit(0, 1);
}

impl pallet_uniques::Config for Runtime {
Expand Down
24 changes: 12 additions & 12 deletions system-parachains/asset-hubs/asset-hub-polkadot/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -261,12 +261,12 @@ impl pallet_transaction_payment::Config for Runtime {

parameter_types! {
pub const AssetDeposit: Balance = 10 * UNITS; // 10 UNITS deposit to create fungible asset class
pub const AssetAccountDeposit: Balance = deposit(1, 16);
pub const AssetAccountDeposit: Balance = system_para_deposit(1, 16);
pub const AssetsStringLimit: u32 = 50;
/// Key = 32 bytes, Value = 36 bytes (32+1+1+1+1)
// https://github.com/paritytech/substrate/blob/069917b/frame/assets/src/lib.rs#L257L271
pub const MetadataDepositBase: Balance = deposit(1, 68);
pub const MetadataDepositPerByte: Balance = deposit(0, 1);
pub const MetadataDepositBase: Balance = system_para_deposit(1, 68);
pub const MetadataDepositPerByte: Balance = system_para_deposit(0, 1);
}

/// We allow root to execute privileged asset operations.
Expand Down Expand Up @@ -343,9 +343,9 @@ impl pallet_assets::Config<ForeignAssetsInstance> for Runtime {

parameter_types! {
// One storage item; key size is 32; value is size 4+4+16+32 bytes = 56 bytes.
pub const DepositBase: Balance = deposit(1, 88);
pub const DepositBase: Balance = system_para_deposit(1, 88);
// Additional storage item size of 32 bytes.
pub const DepositFactor: Balance = deposit(0, 32);
pub const DepositFactor: Balance = system_para_deposit(0, 32);
pub const MaxSignatories: u32 = 100;
}

Expand All @@ -368,13 +368,13 @@ impl pallet_utility::Config for Runtime {

parameter_types! {
// One storage item; key size 32, value size 8; .
pub const ProxyDepositBase: Balance = deposit(1, 40);
pub const ProxyDepositBase: Balance = system_para_deposit(1, 40);
// Additional storage item size of 33 bytes.
pub const ProxyDepositFactor: Balance = deposit(0, 33);
pub const ProxyDepositFactor: Balance = system_para_deposit(0, 33);
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 AnnouncementDepositBase: Balance = system_para_deposit(1, 48);
pub const AnnouncementDepositFactor: Balance = system_para_deposit(0, 66);
pub const MaxPending: u16 = 32;
}

Expand Down Expand Up @@ -686,9 +686,9 @@ impl pallet_asset_tx_payment::Config for Runtime {
parameter_types! {
pub const UniquesCollectionDeposit: Balance = 10 * UNITS; // 10 UNIT deposit to create uniques class
pub const UniquesItemDeposit: Balance = UNITS / 100; // 1 / 100 UNIT deposit to create uniques instance
pub const UniquesMetadataDepositBase: Balance = deposit(1, 129);
pub const UniquesAttributeDepositBase: Balance = deposit(1, 0);
pub const UniquesDepositPerByte: Balance = deposit(0, 1);
pub const UniquesMetadataDepositBase: Balance = system_para_deposit(1, 129);
pub const UniquesAttributeDepositBase: Balance = system_para_deposit(1, 0);
pub const UniquesDepositPerByte: Balance = system_para_deposit(0, 1);
}

impl pallet_uniques::Config for Runtime {
Expand Down
4 changes: 2 additions & 2 deletions system-parachains/bridge-hubs/bridge-hub-kusama/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -413,9 +413,9 @@ impl pallet_collator_selection::Config for Runtime {

parameter_types! {
// One storage item; key size is 32; value is size 4+4+16+32 bytes = 56 bytes.
pub const DepositBase: Balance = deposit(1, 88);
pub const DepositBase: Balance = system_para_deposit(1, 88);
// Additional storage item size of 32 bytes.
pub const DepositFactor: Balance = deposit(0, 32);
pub const DepositFactor: Balance = system_para_deposit(0, 32);
}

impl pallet_multisig::Config for Runtime {
Expand Down
4 changes: 2 additions & 2 deletions system-parachains/bridge-hubs/bridge-hub-polkadot/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -413,9 +413,9 @@ impl pallet_collator_selection::Config for Runtime {

parameter_types! {
// One storage item; key size is 32; value is size 4+4+16+32 bytes = 56 bytes.
pub const DepositBase: Balance = deposit(1, 88);
pub const DepositBase: Balance = system_para_deposit(1, 88);
// Additional storage item size of 32 bytes.
pub const DepositFactor: Balance = deposit(0, 32);
pub const DepositFactor: Balance = system_para_deposit(0, 32);
}

impl pallet_multisig::Config for Runtime {
Expand Down
16 changes: 8 additions & 8 deletions system-parachains/collectives/collectives-polkadot/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -236,9 +236,9 @@ impl pallet_transaction_payment::Config for Runtime {

parameter_types! {
// One storage item; key size is 32; value is size 4+4+16+32 bytes = 56 bytes.
pub const DepositBase: Balance = deposit(1, 88);
pub const DepositBase: Balance = system_para_deposit(1, 88);
// Additional storage item size of 32 bytes.
pub const DepositFactor: Balance = deposit(0, 32);
pub const DepositFactor: Balance = system_para_deposit(0, 32);
}

impl pallet_multisig::Config for Runtime {
Expand All @@ -260,12 +260,12 @@ impl pallet_utility::Config for Runtime {

parameter_types! {
// One storage item; key size 32, value size 8; .
pub const ProxyDepositBase: Balance = deposit(1, 40);
pub const ProxyDepositBase: Balance = system_para_deposit(1, 40);
// Additional storage item size of 33 bytes.
pub const ProxyDepositFactor: Balance = deposit(0, 33);
pub const ProxyDepositFactor: Balance = system_para_deposit(0, 33);
// 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 AnnouncementDepositBase: Balance = system_para_deposit(1, 48);
pub const AnnouncementDepositFactor: Balance = system_para_deposit(0, 66);
}

/// The type used to represent the kinds of proxying allowed.
Expand Down Expand Up @@ -568,8 +568,8 @@ impl pallet_scheduler::Config for Runtime {
}

parameter_types! {
pub const PreimageBaseDeposit: Balance = deposit(2, 64);
pub const PreimageByteDeposit: Balance = deposit(0, 1);
pub const PreimageBaseDeposit: Balance = system_para_deposit(2, 64);
pub const PreimageByteDeposit: Balance = system_para_deposit(0, 1);
pub const PreimageHoldReason: RuntimeHoldReason =
RuntimeHoldReason::Preimage(pallet_preimage::HoldReason::Preimage);
}
Expand Down
2 changes: 1 addition & 1 deletion system-parachains/constants/src/kusama.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ pub mod currency {

/// Deposit rate for stored data. 1/100th of the Relay Chain's deposit rate. `items` is the
/// number of keys in storage and `bytes` is the size of the value.
pub const fn deposit(items: u32, bytes: u32) -> Balance {
pub const fn system_para_deposit(items: u32, bytes: u32) -> Balance {
kusama_runtime_constants::currency::deposit(items, bytes) / 100
}
}
Expand Down
2 changes: 1 addition & 1 deletion system-parachains/constants/src/polkadot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ pub mod currency {

/// Deposit rate for stored data. 1/100th of the Relay Chain's deposit rate. `items` is the
/// number of keys in storage and `bytes` is the size of the value.
pub const fn deposit(items: u32, bytes: u32) -> Balance {
pub const fn system_para_deposit(items: u32, bytes: u32) -> Balance {
polkadot_runtime_constants::currency::deposit(items, bytes) / 100
}
}
Expand Down
8 changes: 4 additions & 4 deletions system-parachains/encointer/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,13 +152,13 @@ pub fn native_version() -> NativeVersion {

parameter_types! {
// One storage item; key size 32, value size 8; .
pub const ProxyDepositBase: Balance = deposit(1, 40);
pub const ProxyDepositBase: Balance = system_para_deposit(1, 40);
// Additional storage item size of 33 bytes.
pub const ProxyDepositFactor: Balance = deposit(0, 33);
pub const ProxyDepositFactor: Balance = system_para_deposit(0, 33);
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 AnnouncementDepositBase: Balance = system_para_deposit(1, 48);
pub const AnnouncementDepositFactor: Balance = system_para_deposit(0, 66);
pub const MaxPending: u16 = 32;
}

Expand Down

0 comments on commit 296d296

Please sign in to comment.