referrerpolicy=no-referrer-when-downgrade
people_westend_runtime

Type Alias Identity

Source
pub type Identity = Pallet<Runtime>;

Aliased Type§

struct Identity(/* private fields */);

Implementations

Source§

impl<T> Pallet<T>
where T: Config,

Source

pub fn subs( who: &<T as Config>::AccountId, ) -> Vec<(<T as Config>::AccountId, Data)>

Get the subs of an account.

Source

pub fn has_identity( who: &<T as Config>::AccountId, fields: <<T as Config>::IdentityInformation as IdentityInformationProvider>::FieldsIdentifier, ) -> bool

Check if the account has corresponding identity information by the identity field.

Source

pub fn validate_signature( data: &[u8], signature: &<T as Config>::OffchainSignature, signer: &<T as Config>::AccountId, ) -> Result<(), DispatchError>

Validate a signature. Supports signatures on raw data or data wrapped in HTML <Bytes>.

Source

pub fn insert_username( who: &<T as Config>::AccountId, username: BoundedVec<u8, <T as Config>::MaxUsernameLength>, provider: Provider<<<T as Config>::Currency as Currency<<T as Config>::AccountId>>::Balance>, )

A username has met all conditions. Insert the relevant storage items.

Source

pub fn queue_acceptance( who: &<T as Config>::AccountId, username: BoundedVec<u8, <T as Config>::MaxUsernameLength>, provider: Provider<<<T as Config>::Currency as Currency<<T as Config>::AccountId>>::Balance>, )

A username was granted by an authority, but must be accepted by who. Put the username into a queue for acceptance.

Source

pub fn reap_identity( who: &<T as Config>::AccountId, ) -> Result<(u32, u32, u32), DispatchError>

Reap an identity, clearing associated storage items and refunding any deposits. This function is very similar to (a) clear_identity, but called on a target account instead of self; and (b) kill_identity, but without imposing a slash.

Parameters:

  • target: The account for which to reap identity state.

Return type is a tuple of the number of registrars, IdentityInfo bytes, and sub accounts, respectively.

NOTE: This function is here temporarily for migration of Identity info from the Polkadot Relay Chain into a system parachain. It will be removed after the migration.

Source

pub fn poke_deposit( target: &<T as Config>::AccountId, ) -> Result<(<<T as Config>::Currency as Currency<<T as Config>::AccountId>>::Balance, <<T as Config>::Currency as Currency<<T as Config>::AccountId>>::Balance), DispatchError>

Update the deposits held by target for its identity info.

Parameters:

  • target: The account for which to update deposits.

Return type is a tuple of the new Identity and Subs deposits, respectively.

NOTE: This function is here temporarily for migration of Identity info from the Polkadot Relay Chain into a system parachain. It will be removed after the migration.

Source

pub fn set_identity_no_deposit( who: &<T as Config>::AccountId, info: <T as Config>::IdentityInformation, ) -> Result<(), DispatchError>

Set an identity with zero deposit. Used for benchmarking and XCM emulator tests that involve rejig_deposit.

Source

pub fn set_subs_no_deposit( who: &<T as Config>::AccountId, subs: Vec<(<T as Config>::AccountId, Data)>, ) -> Result<(), DispatchError>

Set subs with zero deposit and default name. Only used for benchmarks that involve rejig_deposit.

Source§

impl<T> Pallet<T>
where T: Config,

Identity pallet declaration.

Source

pub fn add_registrar( origin: <T as Config>::RuntimeOrigin, account: <<T as Config>::Lookup as StaticLookup>::Source, ) -> Result<PostDispatchInfo, DispatchErrorWithPostInfo<PostDispatchInfo>>

Add a registrar to the system.

The dispatch origin for this call must be T::RegistrarOrigin.

  • account: the account of the registrar.

Emits RegistrarAdded if successful.

Source

pub fn set_identity( origin: <T as Config>::RuntimeOrigin, info: Box<<T as Config>::IdentityInformation>, ) -> Result<PostDispatchInfo, DispatchErrorWithPostInfo<PostDispatchInfo>>

Set an account’s identity information and reserve the appropriate deposit.

If the account already has identity information, the deposit is taken as part payment for the new deposit.

The dispatch origin for this call must be Signed.

  • info: The identity information.

Emits IdentitySet if successful.

Source

pub fn set_subs( origin: <T as Config>::RuntimeOrigin, subs: Vec<(<T as Config>::AccountId, Data)>, ) -> Result<PostDispatchInfo, DispatchErrorWithPostInfo<PostDispatchInfo>>

Set the sub-accounts of the sender.

Payment: Any aggregate balance reserved by previous set_subs calls will be returned and an amount SubAccountDeposit will be reserved for each item in subs.

The dispatch origin for this call must be Signed and the sender must have a registered identity.

  • subs: The identity’s (new) sub-accounts.
Source

pub fn clear_identity( origin: <T as Config>::RuntimeOrigin, ) -> Result<PostDispatchInfo, DispatchErrorWithPostInfo<PostDispatchInfo>>

Clear an account’s identity info and all sub-accounts and return all deposits.

Payment: All reserved balances on the account are returned.

The dispatch origin for this call must be Signed and the sender must have a registered identity.

Emits IdentityCleared if successful.

Source

pub fn request_judgement( origin: <T as Config>::RuntimeOrigin, reg_index: u32, max_fee: <<T as Config>::Currency as Currency<<T as Config>::AccountId>>::Balance, ) -> Result<PostDispatchInfo, DispatchErrorWithPostInfo<PostDispatchInfo>>

Request a judgement from a registrar.

Payment: At most max_fee will be reserved for payment to the registrar if judgement given.

The dispatch origin for this call must be Signed and the sender must have a registered identity.

  • reg_index: The index of the registrar whose judgement is requested.
  • max_fee: The maximum fee that may be paid. This should just be auto-populated as:
Registrars::<T>::get().get(reg_index).unwrap().fee

Emits JudgementRequested if successful.

Source

pub fn cancel_request( origin: <T as Config>::RuntimeOrigin, reg_index: u32, ) -> Result<PostDispatchInfo, DispatchErrorWithPostInfo<PostDispatchInfo>>

Cancel a previous request.

Payment: A previously reserved deposit is returned on success.

The dispatch origin for this call must be Signed and the sender must have a registered identity.

  • reg_index: The index of the registrar whose judgement is no longer requested.

Emits JudgementUnrequested if successful.

Source

pub fn set_fee( origin: <T as Config>::RuntimeOrigin, index: u32, fee: <<T as Config>::Currency as Currency<<T as Config>::AccountId>>::Balance, ) -> Result<PostDispatchInfo, DispatchErrorWithPostInfo<PostDispatchInfo>>

Set the fee required for a judgement to be requested from a registrar.

The dispatch origin for this call must be Signed and the sender must be the account of the registrar whose index is index.

  • index: the index of the registrar whose fee is to be set.
  • fee: the new fee.
Source

pub fn set_account_id( origin: <T as Config>::RuntimeOrigin, index: u32, new: <<T as Config>::Lookup as StaticLookup>::Source, ) -> Result<PostDispatchInfo, DispatchErrorWithPostInfo<PostDispatchInfo>>

Change the account associated with a registrar.

The dispatch origin for this call must be Signed and the sender must be the account of the registrar whose index is index.

  • index: the index of the registrar whose fee is to be set.
  • new: the new account ID.
Source

pub fn set_fields( origin: <T as Config>::RuntimeOrigin, index: u32, fields: <<T as Config>::IdentityInformation as IdentityInformationProvider>::FieldsIdentifier, ) -> Result<PostDispatchInfo, DispatchErrorWithPostInfo<PostDispatchInfo>>

Set the field information for a registrar.

The dispatch origin for this call must be Signed and the sender must be the account of the registrar whose index is index.

  • index: the index of the registrar whose fee is to be set.
  • fields: the fields that the registrar concerns themselves with.
Source

pub fn provide_judgement( origin: <T as Config>::RuntimeOrigin, reg_index: u32, target: <<T as Config>::Lookup as StaticLookup>::Source, judgement: Judgement<<<T as Config>::Currency as Currency<<T as Config>::AccountId>>::Balance>, identity: <T as Config>::Hash, ) -> Result<PostDispatchInfo, DispatchErrorWithPostInfo<PostDispatchInfo>>

Provide a judgement for an account’s identity.

The dispatch origin for this call must be Signed and the sender must be the account of the registrar whose index is reg_index.

  • reg_index: the index of the registrar whose judgement is being made.
  • target: the account whose identity the judgement is upon. This must be an account with a registered identity.
  • judgement: the judgement of the registrar of index reg_index about target.
  • identity: The hash of the IdentityInformationProvider for that the judgement is provided.

Note: Judgements do not apply to a username.

Emits JudgementGiven if successful.

Source

pub fn kill_identity( origin: <T as Config>::RuntimeOrigin, target: <<T as Config>::Lookup as StaticLookup>::Source, ) -> Result<PostDispatchInfo, DispatchErrorWithPostInfo<PostDispatchInfo>>

Remove an account’s identity and sub-account information and slash the deposits.

Payment: Reserved balances from set_subs and set_identity are slashed and handled by Slash. Verification request deposits are not returned; they should be cancelled manually using cancel_request.

The dispatch origin for this call must match T::ForceOrigin.

  • target: the account whose identity the judgement is upon. This must be an account with a registered identity.

Emits IdentityKilled if successful.

Source

pub fn add_sub( origin: <T as Config>::RuntimeOrigin, sub: <<T as Config>::Lookup as StaticLookup>::Source, data: Data, ) -> Result<(), DispatchError>

Add the given account to the sender’s subs.

Payment: Balance reserved by a previous set_subs call for one sub will be repatriated to the sender.

The dispatch origin for this call must be Signed and the sender must have a registered sub identity of sub.

Source

pub fn rename_sub( origin: <T as Config>::RuntimeOrigin, sub: <<T as Config>::Lookup as StaticLookup>::Source, data: Data, ) -> Result<(), DispatchError>

Alter the associated name of the given sub-account.

The dispatch origin for this call must be Signed and the sender must have a registered sub identity of sub.

Source

pub fn remove_sub( origin: <T as Config>::RuntimeOrigin, sub: <<T as Config>::Lookup as StaticLookup>::Source, ) -> Result<(), DispatchError>

Remove the given account from the sender’s subs.

Payment: Balance reserved by a previous set_subs call for one sub will be repatriated to the sender.

The dispatch origin for this call must be Signed and the sender must have a registered sub identity of sub.

Source

pub fn quit_sub( origin: <T as Config>::RuntimeOrigin, ) -> Result<(), DispatchError>

Remove the sender as a sub-account.

Payment: Balance reserved by a previous set_subs call for one sub will be repatriated to the sender (not the original depositor).

The dispatch origin for this call must be Signed and the sender must have a registered super-identity.

NOTE: This should not normally be used, but is provided in the case that the non- controller of an account is maliciously registered as a sub-account.

Source

pub fn add_username_authority( origin: <T as Config>::RuntimeOrigin, authority: <<T as Config>::Lookup as StaticLookup>::Source, suffix: Vec<u8>, allocation: u32, ) -> Result<(), DispatchError>

Add an AccountId with permission to grant usernames with a given suffix appended.

The authority can grant up to allocation usernames. To top up the allocation or change the account used to grant usernames, this call can be used with the updated parameters to overwrite the existing configuration.

Source

pub fn remove_username_authority( origin: <T as Config>::RuntimeOrigin, suffix: Vec<u8>, authority: <<T as Config>::Lookup as StaticLookup>::Source, ) -> Result<(), DispatchError>

Remove authority from the username authorities.

Source

pub fn set_username_for( origin: <T as Config>::RuntimeOrigin, who: <<T as Config>::Lookup as StaticLookup>::Source, username: Vec<u8>, signature: Option<<T as Config>::OffchainSignature>, use_allocation: bool, ) -> Result<(), DispatchError>

Set the username for who. Must be called by a username authority.

If use_allocation is set, the authority must have a username allocation available to spend. Otherwise, the authority will need to put up a deposit for registering the username.

Users can either pre-sign their usernames or accept them later.

Usernames must:

  • Only contain lowercase ASCII characters or digits.
  • When combined with the suffix of the issuing authority be less than the MaxUsernameLength.
Source

pub fn accept_username( origin: <T as Config>::RuntimeOrigin, username: BoundedVec<u8, <T as Config>::MaxUsernameLength>, ) -> Result<PostDispatchInfo, DispatchErrorWithPostInfo<PostDispatchInfo>>

Accept a given username that an authority granted. The call must include the full username, as in username.suffix.

Source

pub fn remove_expired_approval( origin: <T as Config>::RuntimeOrigin, username: BoundedVec<u8, <T as Config>::MaxUsernameLength>, ) -> Result<PostDispatchInfo, DispatchErrorWithPostInfo<PostDispatchInfo>>

Remove an expired username approval. The username was approved by an authority but never accepted by the user and must now be beyond its expiration. The call must include the full username, as in username.suffix.

Source

pub fn set_primary_username( origin: <T as Config>::RuntimeOrigin, username: BoundedVec<u8, <T as Config>::MaxUsernameLength>, ) -> Result<(), DispatchError>

Set a given username as the primary. The username should include the suffix.

Source

pub fn unbind_username( origin: <T as Config>::RuntimeOrigin, username: BoundedVec<u8, <T as Config>::MaxUsernameLength>, ) -> Result<(), DispatchError>

Start the process of removing a username by placing it in the unbinding usernames map. Once the grace period has passed, the username can be deleted by calling remove_username.

Source

pub fn remove_username( origin: <T as Config>::RuntimeOrigin, username: BoundedVec<u8, <T as Config>::MaxUsernameLength>, ) -> Result<PostDispatchInfo, DispatchErrorWithPostInfo<PostDispatchInfo>>

Permanently delete a username which has been unbinding for longer than the grace period. Caller is refunded the fee if the username expired and the removal was successful.

Source

pub fn kill_username( origin: <T as Config>::RuntimeOrigin, username: BoundedVec<u8, <T as Config>::MaxUsernameLength>, ) -> Result<PostDispatchInfo, DispatchErrorWithPostInfo<PostDispatchInfo>>

Call with ForceOrigin privileges which deletes a username and slashes any deposit associated with it.

Trait Implementations

Source§

impl<T> BeforeAllRuntimeMigrations for Pallet<T>
where T: Config,

Source§

fn before_all_runtime_migrations() -> Weight

Something that should happen before runtime migrations are executed.
Source§

impl<T> Benchmarking for Pallet<T>

Source§

fn benchmarks(extra: bool) -> Vec<BenchmarkMetadata>

Get the benchmarks available for this pallet. Generally there is one benchmark per extrinsic, so these are sometimes just called “extrinsics”. Read more
Source§

fn run_benchmark( extrinsic: &[u8], c: &[(BenchmarkParameter, u32)], whitelist: &[TrackedStorageKey], verify: bool, internal_repeats: u32, ) -> Result<Vec<BenchmarkResult>, BenchmarkError>

Run the benchmarks for this pallet.
Source§

impl<T> Callable<T> for Pallet<T>
where T: Config,

Source§

impl<T> Clone for Pallet<T>

Source§

fn clone(&self) -> Pallet<T>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<T> Debug for Pallet<T>

Source§

fn fmt(&self, fmt: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl<T> DispatchViewFunction for Pallet<T>
where T: Config,

Source§

fn dispatch_view_function<O>( id: &ViewFunctionId, input: &mut &[u8], output: &mut O, ) -> Result<(), ViewFunctionDispatchError>
where O: Output,

Source§

impl<T> GetStorageVersion for Pallet<T>
where T: Config,

Source§

type InCodeStorageVersion = StorageVersion

This type is generated by the pallet macro. Read more
Source§

fn in_code_storage_version() -> <Pallet<T> as GetStorageVersion>::InCodeStorageVersion

Returns the in-code storage version as specified in the storage_version attribute, or NoStorageVersionSet if the attribute is missing.
Source§

fn on_chain_storage_version() -> StorageVersion

Returns the storage version of the pallet as last set in the actual on-chain storage.
Source§

fn current_storage_version() -> Self::InCodeStorageVersion

👎Deprecated: This method has been renamed to in_code_storage_version and will be removed after March 2024.
DEPRECATED: Use Self::current_storage_version instead. Read more
Source§

impl<T> Hooks<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
where T: Config,

Source§

fn on_initialize(_n: BlockNumber) -> Weight

Block initialization hook. This is called at the very beginning of block execution. Read more
Source§

fn on_finalize(_n: BlockNumber)

Block finalization hook. This is called at the very end of block execution. Read more
Source§

fn on_idle(_n: BlockNumber, _remaining_weight: Weight) -> Weight

Hook to consume a block’s idle time. This will run when the block is being finalized (before Hooks::on_finalize). Read more
Source§

fn on_poll(_n: BlockNumber, _weight: &mut WeightMeter)

A hook to run logic after inherent application. Read more
Source§

fn on_runtime_upgrade() -> Weight

Hook executed when a code change (aka. a “runtime upgrade”) is detected by the FRAME Executive pallet. Read more
Source§

fn try_state(_n: BlockNumber) -> Result<(), DispatchError>

Execute the sanity checks of this pallet, per block. Read more
Source§

fn pre_upgrade() -> Result<Vec<u8>, DispatchError>

Execute some pre-checks prior to a runtime upgrade. Read more
Source§

fn post_upgrade(_state: Vec<u8>) -> Result<(), DispatchError>

Execute some post-checks after a runtime upgrade. Read more
Source§

fn offchain_worker(_n: BlockNumber)

Implementing this function on a pallet allows you to perform long-running tasks that are dispatched as separate threads, and entirely independent of the main blockchain execution. Read more
Source§

fn integrity_test()

Check the integrity of this pallet’s configuration. Read more
Source§

impl<T> IntegrityTest for Pallet<T>
where T: Config,

Source§

impl<T> OffchainWorker<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
where T: Config,

Source§

fn offchain_worker( n: <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number, )

This function is being called after every block import (when fully synced). Read more
Source§

impl<T> OnFinalize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
where T: Config,

Source§

fn on_finalize( n: <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number, )

Source§

impl<T> OnGenesis for Pallet<T>
where T: Config,

Source§

fn on_genesis()

Something that should happen at genesis.
Source§

impl<T> OnIdle<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
where T: Config,

Source§

fn on_idle( n: <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number, remaining_weight: Weight, ) -> Weight

Source§

impl<T> OnInitialize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
where T: Config,

Source§

fn on_initialize( n: <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number, ) -> Weight

Source§

impl<T> OnPoll<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
where T: Config,

Source§

fn on_poll( n: <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number, weight: &mut WeightMeter, )

Code to execute every now and then at the beginning of the block after inherent application. Read more
Source§

impl<T> OnRuntimeUpgrade for Pallet<T>
where T: Config,

Source§

fn on_runtime_upgrade() -> Weight

Source§

fn pre_upgrade() -> Result<Vec<u8>, DispatchError>

Source§

fn post_upgrade(state: Vec<u8>) -> Result<(), DispatchError>

Source§

fn try_on_runtime_upgrade(checks: bool) -> Result<Weight, DispatchError>

The expected and default behavior of this method is to handle executing pre_upgrade -> on_runtime_upgrade -> post_upgrade hooks for a migration. Read more
Source§

impl<T> PalletInfoAccess for Pallet<T>
where T: Config,

Source§

fn index() -> usize

Index of the pallet as configured in the runtime.
Source§

fn name() -> &'static str

Name of the pallet as configured in the runtime.
Source§

fn name_hash() -> [u8; 16]

Two128 hash of name.
Source§

fn module_name() -> &'static str

Name of the Rust module containing the pallet.
Source§

fn crate_version() -> CrateVersion

Version of the crate containing the pallet.
Source§

impl<T> PalletsInfoAccess for Pallet<T>
where T: Config,

Source§

fn count() -> usize

The number of pallets’ information that this type represents. Read more
Source§

fn infos() -> Vec<PalletInfoData>

All of the pallets’ information that this type represents.
Source§

impl<T> PartialEq for Pallet<T>

Source§

fn eq(&self, other: &Pallet<T>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<T> StorageInfoTrait for Pallet<T>
where T: Config,

Source§

impl<T> TryDecodeEntireStorage for Pallet<T>
where T: Config,

Source§

fn try_decode_entire_state() -> Result<usize, Vec<TryDecodeEntireStorageError>>

Decode the entire data under the given storage, returning Ok(bytes_decoded) if success.
Source§

impl<T> TryState<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
where T: Config,

Source§

fn try_state( n: <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number, _s: Select, ) -> Result<(), DispatchError>

Execute the state checks.
Source§

impl<T> ViewFunctionIdPrefix for Pallet<T>
where T: Config,

Source§

fn prefix() -> [u8; 16]

Source§

impl<T> WhitelistedStorageKeys for Pallet<T>
where T: Config,

Source§

fn whitelisted_storage_keys() -> Vec<TrackedStorageKey>

Returns a Vec<TrackedStorageKey> indicating the storage keys that should be whitelisted during benchmarking. This means that those keys will be excluded from the benchmarking performance calculation.
Source§

impl<T> Eq for Pallet<T>