Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: benchmark configuration runtime #850

Merged
merged 1 commit into from
Jan 16, 2025
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
24 changes: 18 additions & 6 deletions runtimes/peregrine/src/kilt/did/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,14 @@ use did::{
};
use frame_system::EnsureRoot;
use runtime_common::{
constants,
dot_names::{AllowedDotNameClaimer, AllowedUniqueLinkingAssociator},
AccountId, DidIdentifier, EnsureNoLinkedAccountDeletionHook, EnsureNoLinkedWeb3NameDeletionHook,
constants, AccountId, DidIdentifier, EnsureNoLinkedAccountDeletionHook, EnsureNoLinkedWeb3NameDeletionHook,
SendDustAndFeesToTreasury,
};
use sp_core::ConstBool;

use crate::{
weights::{self, rocksdb_weights::constants::RocksDbWeight},
Balances, DotNames, Migration, Runtime, RuntimeCall, RuntimeEvent, RuntimeHoldReason, RuntimeOrigin, UniqueLinking,
Balances, Migration, Runtime, RuntimeCall, RuntimeEvent, RuntimeHoldReason, RuntimeOrigin,
};

#[cfg(test)]
Expand Down Expand Up @@ -198,7 +196,15 @@ impl pallet_did_lookup::Config for Runtime {

pub(crate) type UniqueLinkingDeployment = pallet_did_lookup::Instance2;
impl pallet_did_lookup::Config<UniqueLinkingDeployment> for Runtime {
type AssociateOrigin = EnsureDidOrigin<DidIdentifier, AccountId, AllowedUniqueLinkingAssociator<UniqueLinking>>;
#[cfg(not(feature = "runtime-benchmarks"))]
type AssociateOrigin = EnsureDidOrigin<
DidIdentifier,
AccountId,
runtime_common::dot_names::AllowedUniqueLinkingAssociator<crate::UniqueLinking>,
>;
#[cfg(feature = "runtime-benchmarks")]
type AssociateOrigin = EnsureDidOrigin<DidIdentifier, AccountId, did::origin::Everyone>;

type BalanceMigrationManager = ();
type Currency = Balances;
type Deposit = constants::did_lookup::DidLookupDeposit;
Expand Down Expand Up @@ -238,7 +244,13 @@ pub(crate) type DotNamesDeployment = pallet_web3_names::Instance2;
impl pallet_web3_names::Config<DotNamesDeployment> for Runtime {
type BalanceMigrationManager = ();
type BanOrigin = EnsureRoot<AccountId>;
type ClaimOrigin = EnsureDidOrigin<DidIdentifier, AccountId, AllowedDotNameClaimer<DotNames>>;

#[cfg(not(feature = "runtime-benchmarks"))]
type ClaimOrigin =
EnsureDidOrigin<DidIdentifier, AccountId, runtime_common::dot_names::AllowedDotNameClaimer<crate::DotNames>>;
#[cfg(feature = "runtime-benchmarks")]
type ClaimOrigin = EnsureDidOrigin<DidIdentifier, AccountId, did::origin::Everyone>;

type Currency = Balances;
type Deposit = constants::dot_names::Web3NameDeposit;
type MaxNameLength = constants::dot_names::MaxNameLength;
Expand Down
26 changes: 19 additions & 7 deletions runtimes/spiritnet/src/kilt/did/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,14 @@ use did::{
};
use frame_system::EnsureRoot;
use runtime_common::{
constants,
did::EnsureNoLinkedAccountDeletionHook,
dot_names::{AllowedDotNameClaimer, AllowedUniqueLinkingAssociator},
AccountId, DidIdentifier, EnsureNoLinkedWeb3NameDeletionHook, SendDustAndFeesToTreasury,
constants, did::EnsureNoLinkedAccountDeletionHook, AccountId, DidIdentifier, EnsureNoLinkedWeb3NameDeletionHook,
SendDustAndFeesToTreasury,
};
use sp_core::ConstBool;

use crate::{
weights::{self, rocksdb_weights::constants::RocksDbWeight},
Balances, DotNames, Migration, Runtime, RuntimeCall, RuntimeEvent, RuntimeHoldReason, RuntimeOrigin, UniqueLinking,
Balances, Migration, Runtime, RuntimeCall, RuntimeEvent, RuntimeHoldReason, RuntimeOrigin,
};

#[cfg(test)]
Expand Down Expand Up @@ -198,7 +196,15 @@ impl pallet_did_lookup::Config for Runtime {

pub(crate) type UniqueLinkingDeployment = pallet_did_lookup::Instance2;
impl pallet_did_lookup::Config<UniqueLinkingDeployment> for Runtime {
type AssociateOrigin = EnsureDidOrigin<DidIdentifier, AccountId, AllowedUniqueLinkingAssociator<UniqueLinking>>;
#[cfg(not(feature = "runtime-benchmarks"))]
type AssociateOrigin = EnsureDidOrigin<
DidIdentifier,
AccountId,
runtime_common::dot_names::AllowedUniqueLinkingAssociator<crate::UniqueLinking>,
>;
#[cfg(feature = "runtime-benchmarks")]
type AssociateOrigin = EnsureDidOrigin<DidIdentifier, AccountId, did::origin::Everyone>;

type BalanceMigrationManager = ();
type Currency = Balances;
type Deposit = constants::did_lookup::DidLookupDeposit;
Expand Down Expand Up @@ -238,7 +244,13 @@ pub(crate) type DotNamesDeployment = pallet_web3_names::Instance2;
impl pallet_web3_names::Config<DotNamesDeployment> for Runtime {
type BalanceMigrationManager = ();
type BanOrigin = EnsureRoot<AccountId>;
type ClaimOrigin = EnsureDidOrigin<DidIdentifier, AccountId, AllowedDotNameClaimer<DotNames>>;

#[cfg(not(feature = "runtime-benchmarks"))]
type ClaimOrigin =
EnsureDidOrigin<DidIdentifier, AccountId, runtime_common::dot_names::AllowedDotNameClaimer<crate::DotNames>>;
#[cfg(feature = "runtime-benchmarks")]
type ClaimOrigin = EnsureDidOrigin<DidIdentifier, AccountId, did::origin::Everyone>;

type Currency = Balances;
type Deposit = constants::dot_names::Web3NameDeposit;
type MaxNameLength = constants::dot_names::MaxNameLength;
Expand Down
Loading