mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-31 12:11:02 +00:00
Disable Calls to Identity Pallet (#1476)
This PR filters calls from the Identity pallet from all Relay Chain runtimes as preparation to move the identity state and logic to a system parachain within each network. After this change is deployed to a runtime, no more changes such as adding new sub-identities will be possible. The frozen state will be part of the genesis state of the system chain. After the system chain launches, the pallet and all state will be removed from each Relay Chain. Applications and UIs that render display information from this pallet will need to read from the system chain when it launches.
This commit is contained in:
@@ -29,8 +29,9 @@ use frame_election_provider_support::{bounds::ElectionBoundsBuilder, onchain, Se
|
||||
use frame_support::{
|
||||
construct_runtime, parameter_types,
|
||||
traits::{
|
||||
fungible::HoldConsideration, ConstU32, InstanceFilter, KeyOwnerProofSystem,
|
||||
LinearStoragePrice, ProcessMessage, ProcessMessageError, WithdrawReasons,
|
||||
fungible::HoldConsideration, ConstU32, Contains, EverythingBut, InstanceFilter,
|
||||
KeyOwnerProofSystem, LinearStoragePrice, ProcessMessage, ProcessMessageError,
|
||||
WithdrawReasons,
|
||||
},
|
||||
weights::{ConstantMultiplier, WeightMeter},
|
||||
PalletId,
|
||||
@@ -141,13 +142,24 @@ pub fn native_version() -> NativeVersion {
|
||||
NativeVersion { runtime_version: VERSION, can_author_with: Default::default() }
|
||||
}
|
||||
|
||||
/// A type to identify calls to the Identity pallet. These will be filtered to prevent invocation,
|
||||
/// locking the state of the pallet and preventing further updates to identities and sub-identities.
|
||||
/// The locked state will be the genesis state of a new system chain and then removed from the Relay
|
||||
/// Chain.
|
||||
pub struct IdentityCalls;
|
||||
impl Contains<RuntimeCall> for IdentityCalls {
|
||||
fn contains(c: &RuntimeCall) -> bool {
|
||||
matches!(c, RuntimeCall::Identity(_))
|
||||
}
|
||||
}
|
||||
|
||||
parameter_types! {
|
||||
pub const Version: RuntimeVersion = VERSION;
|
||||
pub const SS58Prefix: u8 = 42;
|
||||
}
|
||||
|
||||
impl frame_system::Config for Runtime {
|
||||
type BaseCallFilter = frame_support::traits::Everything;
|
||||
type BaseCallFilter = EverythingBut<IdentityCalls>;
|
||||
type BlockWeights = BlockWeights;
|
||||
type BlockLength = BlockLength;
|
||||
type RuntimeOrigin = RuntimeOrigin;
|
||||
|
||||
Reference in New Issue
Block a user