Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion runtime/devnet/src/config/assets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use sp_runtime::traits::Verify;

use crate::{
deposit, AccountId, Assets, Balance, Balances, BlockNumber, Nfts, Runtime, RuntimeEvent,
RuntimeHoldReason, DAYS, EXISTENTIAL_DEPOSIT, UNIT,
RuntimeHoldReason, System, DAYS, EXISTENTIAL_DEPOSIT, UNIT,
};

/// We allow root to execute privileged asset operations.
Expand Down
3 changes: 2 additions & 1 deletion runtime/devnet/src/config/proxy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use pop_runtime_common::proxy::{
use sp_runtime::traits::BlakeTwo256;

use super::assets::{TrustBackedAssetsCall, TrustBackedNftsCall};
use crate::{Balances, Runtime, RuntimeCall, RuntimeEvent};
use crate::{Balances, Runtime, RuntimeCall, RuntimeEvent, System};

impl InstanceFilter<RuntimeCall> for ProxyType {
fn filter(&self, c: &RuntimeCall) -> bool {
Expand Down Expand Up @@ -97,6 +97,7 @@ impl InstanceFilter<RuntimeCall> for ProxyType {
impl pallet_proxy::Config for Runtime {
type AnnouncementDepositBase = AnnouncementDepositBase;
type AnnouncementDepositFactor = AnnouncementDepositFactor;
type BlockNumberProvider = System;
type CallHasher = BlakeTwo256;
type Currency = Balances;
type MaxPending = MaxPending;
Expand Down
1 change: 1 addition & 0 deletions runtime/devnet/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -542,6 +542,7 @@ parameter_types! {
}

impl pallet_multisig::Config for Runtime {
type BlockNumberProvider = System;
type Currency = Balances;
type DepositBase = DepositBase;
type DepositFactor = DepositFactor;
Expand Down
11 changes: 10 additions & 1 deletion runtime/mainnet/src/config/assets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use sp_runtime::traits::Verify;

use crate::{
config::monetary::ExistentialDeposit, deposit, weights, AccountId, Balance, Balances,
BlockNumber, Runtime, RuntimeEvent, DAYS,
BlockNumber, Runtime, RuntimeEvent, System, DAYS,
};

/// We allow root to execute privileged asset operations.
Expand Down Expand Up @@ -78,6 +78,7 @@ parameter_types! {
impl pallet_nfts::Config for Runtime {
type ApprovalsLimit = ConstU32<20>;
type AttributeDepositBase = NftsAttributeDepositBase;
type BlockNumberProvider = System;
type CollectionDeposit = NftsCollectionDeposit;
type CollectionId = CollectionId;
type CreateOrigin = AsEnsureOriginWithArg<EnsureSigned<AccountId>>;
Expand Down Expand Up @@ -360,6 +361,14 @@ mod tests {
assert_eq!(deposit(1, key_size as u32) / 100, NftsAttributeDepositBase::get());
}

#[test]
fn ensure_system_is_block_number_provider() {
assert_eq!(
TypeId::of::<<Runtime as pallet_nfts::Config>::BlockNumberProvider>(),
TypeId::of::<System>(),
);
}

#[test]
fn ensure_collection_deposit() {
// We account for the different elements stored when creating a new collection:
Expand Down
11 changes: 10 additions & 1 deletion runtime/mainnet/src/config/proxy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use pop_runtime_common::proxy::{MaxPending, MaxProxies, ProxyType};

use crate::{
config::assets::TrustBackedAssetsCall, deposit, parameter_types, weights, Balance, Balances,
BlakeTwo256, Runtime, RuntimeCall, RuntimeEvent,
BlakeTwo256, Runtime, RuntimeCall, RuntimeEvent, System,
};

impl InstanceFilter<RuntimeCall> for ProxyType {
Expand Down Expand Up @@ -106,6 +106,7 @@ parameter_types! {
impl pallet_proxy::Config for Runtime {
type AnnouncementDepositBase = AnnouncementDepositBase;
type AnnouncementDepositFactor = AnnouncementDepositFactor;
type BlockNumberProvider = System;
type CallHasher = BlakeTwo256;
type Currency = Balances;
type MaxPending = MaxPending;
Expand Down Expand Up @@ -192,6 +193,14 @@ mod tests {
);
}

#[test]
fn ensure_system_is_block_number_provider() {
assert_eq!(
TypeId::of::<<Runtime as Config>::BlockNumberProvider>(),
TypeId::of::<System>(),
);
}

#[test]
fn proxy_uses_blaketwo256_as_hasher() {
assert_eq!(TypeId::of::<<Runtime as Config>::CallHasher>(), TypeId::of::<BlakeTwo256>(),);
Expand Down
11 changes: 10 additions & 1 deletion runtime/mainnet/src/config/utility.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use crate::{
config::system::RuntimeBlockWeights, deposit, parameter_types, weights, AccountId, Balance,
Balances, ConstU32, EnsureRoot, EqualPrivilegeOnly, HoldConsideration, LinearStoragePrice,
OriginCaller, Perbill, Preimage, Runtime, RuntimeCall, RuntimeEvent, RuntimeHoldReason,
RuntimeOrigin, Weight,
RuntimeOrigin, System, Weight,
};

parameter_types! {
Expand All @@ -15,6 +15,7 @@ parameter_types! {
}

impl pallet_multisig::Config for Runtime {
type BlockNumberProvider = System;
type Currency = Balances;
type DepositBase = DepositBase;
type DepositFactor = DepositFactor;
Expand Down Expand Up @@ -87,6 +88,14 @@ mod tests {

use super::*;

#[test]
fn ensure_system_is_block_number_provider() {
assert_eq!(
TypeId::of::<<Runtime as pallet_multisig::Config>::BlockNumberProvider>(),
TypeId::of::<System>(),
);
}

#[test]
fn balances_is_used_for_deposits() {
assert_eq!(
Expand Down
3 changes: 2 additions & 1 deletion runtime/testnet/src/config/assets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use sp_runtime::traits::Verify;

use crate::{
deposit, AccountId, Assets, Balance, Balances, BlockNumber, Nfts, Runtime, RuntimeEvent,
RuntimeHoldReason, DAYS, EXISTENTIAL_DEPOSIT, UNIT,
RuntimeHoldReason, System, DAYS, EXISTENTIAL_DEPOSIT, UNIT,
};

/// We allow root to execute privileged asset operations.
Expand Down Expand Up @@ -66,6 +66,7 @@ impl pallet_nfts::Config for Runtime {
// TODO: source from primitives
type ApprovalsLimit = ConstU32<20>;
type AttributeDepositBase = NftsAttributeDepositBase;
type BlockNumberProvider = System;
type CollectionDeposit = NftsCollectionDeposit;
// TODO: source from primitives
type CollectionId = CollectionId;
Expand Down
3 changes: 2 additions & 1 deletion runtime/testnet/src/config/proxy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use pop_runtime_common::proxy::{
use sp_runtime::traits::BlakeTwo256;

use super::assets::TrustBackedAssetsCall;
use crate::{Balances, Runtime, RuntimeCall, RuntimeEvent};
use crate::{Balances, Runtime, RuntimeCall, RuntimeEvent, System};

impl InstanceFilter<RuntimeCall> for ProxyType {
fn filter(&self, c: &RuntimeCall) -> bool {
Expand Down Expand Up @@ -98,6 +98,7 @@ impl InstanceFilter<RuntimeCall> for ProxyType {
impl pallet_proxy::Config for Runtime {
type AnnouncementDepositBase = AnnouncementDepositBase;
type AnnouncementDepositFactor = AnnouncementDepositFactor;
type BlockNumberProvider = System;
type CallHasher = BlakeTwo256;
type Currency = Balances;
type MaxPending = MaxPending;
Expand Down
3 changes: 2 additions & 1 deletion runtime/testnet/src/config/utility.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use parachains_common::Balance;

use crate::{
config::system::RuntimeBlockWeights, deposit, AccountId, Balances, OriginCaller, Perbill,
Preimage, Runtime, RuntimeCall, RuntimeEvent, RuntimeHoldReason, RuntimeOrigin, Weight,
Preimage, Runtime, RuntimeCall, RuntimeEvent, RuntimeHoldReason, RuntimeOrigin, System, Weight,
};

parameter_types! {
Expand All @@ -20,6 +20,7 @@ parameter_types! {
}

impl pallet_multisig::Config for Runtime {
type BlockNumberProvider = System;
type Currency = Balances;
type DepositBase = DepositBase;
type DepositFactor = DepositFactor;
Expand Down
Loading