referrerpolicy=no-referrer-when-downgrade

Type Alias Module

Source
pub type Module<T> = Pallet<T>;
👎Deprecated: use Pallet instead
Expand description

Type alias to Pallet, to be used by construct_runtime.

Generated by pallet attribute macro.

Aliased Type§

struct Module<T>(/* private fields */);

Implementations

Source§

impl<T: Config> Pallet<T>

Source

pub fn ensure_personal_identity( origin: T::RuntimeOrigin, ) -> Result<PersonalId, DispatchError>

Ensure that the origin o represents a person. Returns Ok with the base identity of the person on success.

Source

pub fn ensure_personal_alias( origin: T::RuntimeOrigin, ) -> Result<ContextualAlias, DispatchError>

Ensure that the origin o represents a person. Returns Ok with the alias of the person together with the context in which it can be used on success.

Source

pub fn ensure_revised_personal_alias( origin: T::RuntimeOrigin, ) -> Result<RevisedContextualAlias, DispatchError>

Ensure that the origin o represents a person. On success returns Ok with the revised alias of the person together with the context in which it can be used and the revision of the ring the person is in.

Source

pub fn available_ring() -> (RingIndex, BoundedVec<MemberOf<T>, T::MaxRingSize>)

Source

pub fn do_insert_key(who: PersonalId, key: MemberOf<T>) -> DispatchResult

Source

pub fn queue_personhood_suspensions( suspensions: &[PersonalId], ) -> DispatchResult

Source

pub fn resume_personhood(who: PersonalId) -> DispatchResult

Source

pub fn ring_keys_and_info( ring_index: RingIndex, ) -> (BoundedVec<MemberOf<T>, T::MaxRingSize>, RingStatus)

Fetch the keys in a ring along with stored inclusion information.

Source§

impl<T: Config> Pallet<T>

Source

pub fn account_setup_time_tolerance() -> BlockNumberFor<T>

The amount of block number tolerance we allow for a setup account transaction.

set_alias_account and set_personal_id_account calls contains call_valid_at as a parameter, those calls are valid if the block number is within the tolerance period.

Source§

impl<T: Config> Pallet<T>

Source

pub fn build_ring_manual( origin: OriginFor<T>, ring_index: RingIndex, limit: Option<u32>, ) -> DispatchResultWithPostInfo

Build a ring root by including registered people.

This task is performed automatically by the pallet through the on_idle hook whenever there is leftover weight in a block. This call is meant to be a backup in case of extreme congestion and should be submitted by signed origins.

Source

pub fn onboard_people_manual(origin: OriginFor<T>) -> DispatchResultWithPostInfo

Onboard people into a ring by taking their keys from the onboarding queue and registering them into the ring. This does not compute the root, that is done using build_ring.

This task is performed automatically by the pallet through the on_idle hook whenever there is leftover weight in a block. This call is meant to be a backup in case of extreme congestion and should be submitted by signed origins.

Source

pub fn merge_rings( origin: OriginFor<T>, base_ring_index: RingIndex, target_ring_index: RingIndex, ) -> DispatchResultWithPostInfo

Merge the people in two rings into a single, new ring. In order for the rings to be eligible for merging, they must be below 1/2 of max capacity, have no pending suspensions and not be the top ring used for onboarding.

Source

pub fn under_alias( origin: OriginFor<T>, call: Box<<T as Config>::RuntimeCall>, ) -> DispatchResultWithPostInfo

Dispatch a call under an alias using the account <-> alias mapping.

This is a call version of the transaction extension AsPersonalAliasWithAccount. It is recommended to use the transaction extension instead when suitable.

Source

pub fn set_alias_account( origin: OriginFor<T>, account: T::AccountId, call_valid_at: BlockNumberFor<T>, ) -> DispatchResultWithPostInfo

This transaction is refunded if successful and no alias was previously set.

The call is valid from call_valid_at until call_valid_at + account_setup_time_tolerance. account_setup_time_tolerance is a constant available in the metadata.

Parameters:

  • account: The account to set the alias for.
  • call_valid_at: The block number when the call becomes valid.
Source

pub fn unset_alias_account(origin: OriginFor<T>) -> DispatchResult

Remove the mapping from a particular alias to its registered account.

Source

pub fn force_recognize_personhood( origin: OriginFor<T>, people: Vec<MemberOf<T>>, ) -> DispatchResultWithPostInfo

Recognize a set of people without any additional checks.

The people are identified by the provided list of keys and will each be assigned, in order, the next available personal ID.

The origin for this call must have root privileges.

Source

pub fn set_personal_id_account( origin: OriginFor<T>, account: T::AccountId, call_valid_at: BlockNumberFor<T>, ) -> DispatchResultWithPostInfo

Set a personal id account.

The account can then be used to sign transactions on behalf of the personal id, and provide replay protection with the nonce.

This transaction is refunded if successful and no account was previously set for the personal id.

The call is valid from call_valid_at until call_valid_at + account_setup_time_tolerance. account_setup_time_tolerance is a constant available in the metadata.

Parameters:

  • account: The account to set the alias for.
  • call_valid_at: The block number when the call becomes valid.
Source

pub fn unset_personal_id_account( origin: OriginFor<T>, ) -> DispatchResultWithPostInfo

Unset the personal id account.

Source

pub fn migrate_included_key( origin: OriginFor<T>, new_key: MemberOf<T>, ) -> DispatchResultWithPostInfo

Migrate the key for a person who was onboarded and is currently included in a ring. The migration is not instant as the key replacement and subsequent inclusion in a new ring root will happen only after the next mutation session.

Source

pub fn migrate_onboarding_key( origin: OriginFor<T>, new_key: MemberOf<T>, ) -> DispatchResultWithPostInfo

Migrate the key for a person who is currently onboarding. The operation is instant, replacing the old key in the onboarding queue.

Source

pub fn set_onboarding_size( origin: OriginFor<T>, onboarding_size: u32, ) -> DispatchResultWithPostInfo

Force set the onboarding size for new people. This call requires root privileges.

Trait Implementations

Source§

impl<T: Config> AddOnlyPeopleTrait for Pallet<T>

Source§

type Member = <<T as Config>::Crypto as GenerateVerifiable>::Member

Source§

type Secret = <<T as Config>::Crypto as GenerateVerifiable>::Secret

Source§

fn reserve_new_id() -> PersonalId

Reserve a new id for a future person. This id is not recognized, not reserved, and has never been reserved in the past.
Source§

fn cancel_id_reservation(personal_id: PersonalId) -> Result<(), DispatchError>

Cancel the reservation for a personal id Read more
Source§

fn renew_id_reservation(personal_id: PersonalId) -> Result<(), DispatchError>

Renew a reservation for a personal id. The id is not recognized, but has been reserved in the past. Read more
Source§

fn recognize_personhood( who: PersonalId, maybe_key: Option<MemberOf<T>>, ) -> Result<(), DispatchError>

Recognized a person. Read more
Source§

fn mock_key(who: PersonalId) -> (Self::Member, Self::Secret)

Source§

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

Source§

fn before_all_runtime_migrations() -> Weight

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

impl<T> Benchmarking for Pallet<T>
where T: Config + Send + Sync + Config, <T as Config>::RuntimeCall: Dispatchable<Info = DispatchInfo, PostInfo = PostDispatchInfo> + IsSubType<Call<T>> + From<Call<T>> + GetDispatchInfo, <T as Config>::RuntimeOrigin: AsTransactionAuthorizedOrigin,

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: Config> Callable<T> for Pallet<T>

Source§

impl<T> Clone for Pallet<T>

Source§

fn clone(&self) -> Self

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

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

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

Source§

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

Source§

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

Source§

type InCodeStorageVersion = NoStorageVersionSet

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

fn in_code_storage_version() -> Self::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.
§

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: Config> Hooks<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>

Source§

fn integrity_test()

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

fn on_poll(_: BlockNumberFor<T>, weight_meter: &mut WeightMeter)

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

fn on_idle(_block: BlockNumberFor<T>, limit: 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
§

fn on_initialize(_n: BlockNumber) -> Weight

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

fn on_finalize(_n: BlockNumber)

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

fn on_runtime_upgrade() -> Weight

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

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

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

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

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

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

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

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§

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

Source§

fn integrity_test()

See [Hooks::integrity_test].
Source§

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

Source§

fn offchain_worker(n: BlockNumberFor<T>)

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

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

Source§

fn on_finalize(n: BlockNumberFor<T>)

See [Hooks::on_finalize].
Source§

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

Source§

fn on_genesis()

Something that should happen at genesis.
Source§

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

Source§

fn on_idle(n: BlockNumberFor<T>, remaining_weight: Weight) -> Weight

See [Hooks::on_idle].
Source§

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

Source§

fn on_initialize(n: BlockNumberFor<T>) -> Weight

See [Hooks::on_initialize].
Source§

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

Source§

fn on_poll(n: BlockNumberFor<T>, weight: &mut WeightMeter)

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

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

Source§

fn on_runtime_upgrade() -> Weight

See [Hooks::on_runtime_upgrade].
Source§

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

See [Hooks::pre_upgrade].
Source§

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

See [Hooks::post_upgrade].
§

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: Config> PalletInfoAccess for Pallet<T>

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: Config> PalletsInfoAccess for Pallet<T>

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: &Self) -> 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: Config> PeopleTrait for Pallet<T>

Source§

fn suspend_personhood(suspensions: &[PersonalId]) -> DispatchResult

Suspend a set of people. This operation must be called within a mutation session. Read more
Source§

fn start_people_set_mutation_session() -> DispatchResult

Start a mutation session for setting people. Read more
Source§

fn end_people_set_mutation_session() -> DispatchResult

End a mutation session for setting people. Read more
Source§

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

Source§

fn storage_info() -> Vec<StorageInfo>

Source§

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

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: Config> TryState<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>

Source§

fn try_state( n: BlockNumberFor<T>, _s: TryStateSelect, ) -> Result<(), TryRuntimeError>

Execute the state checks.
Source§

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

Source§

fn prefix() -> [u8; 16]

Source§

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

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>