Type Alias pallet_quota::pallet::CurrencyOf

source ·
pub type CurrencyOf<T> = Pallet<T>;

Aliased Type§

struct CurrencyOf<T>(PhantomData<(T, ())>);

Fields§

§0: PhantomData<(T, ())>

Implementations

§

impl<T, I> Pallet<T, I>
where T: Config<I>, I: 'static,

pub fn ensure_upgraded(who: &<T as Config>::AccountId) -> bool

Ensure the account who is using the new logic.

Returns true if the account did get upgraded, false if it didn’t need upgrading.

pub fn free_balance( who: impl Borrow<<T as Config>::AccountId> ) -> <T as Config<I>>::Balance

Get the free balance of an account.

pub fn usable_balance( who: impl Borrow<<T as Config>::AccountId> ) -> <T as Config<I>>::Balance

Get the balance of an account that can be used for transfers, reservations, or any other non-locking, non-transaction-fee activity. Will be at most free_balance.

pub fn usable_balance_for_fees( who: impl Borrow<<T as Config>::AccountId> ) -> <T as Config<I>>::Balance

Get the balance of an account that can be used for paying transaction fees (not tipping, or any other kind of fees, though). Will be at most free_balance.

This requires that the account stays alive.

pub fn reserved_balance( who: impl Borrow<<T as Config>::AccountId> ) -> <T as Config<I>>::Balance

Get the reserved balance of an account.

§

impl<T, I> Pallet<T, I>
where T: Config<I>, I: 'static,

pub fn inactive_issuance() -> <T as Config<I>>::Balance

An auto-generated getter for [InactiveIssuance].

§

impl<T, I> Pallet<T, I>
where T: Config<I>, I: 'static,

pub fn locks<KArg>( k: KArg ) -> WeakBoundedVec<BalanceLock<<T as Config<I>>::Balance>, <T as Config<I>>::MaxLocks>
where KArg: EncodeLike<<T as Config>::AccountId>,

An auto-generated getter for [Locks].

§

impl<T, I> Pallet<T, I>
where T: Config<I>, I: 'static,

pub fn reserves<KArg>( k: KArg ) -> BoundedVec<ReserveData<<T as Config<I>>::ReserveIdentifier, <T as Config<I>>::Balance>, <T as Config<I>>::MaxReserves>
where KArg: EncodeLike<<T as Config>::AccountId>,

An auto-generated getter for [Reserves].

§

impl<T, I> Pallet<T, I>
where T: Config<I>, I: 'static,

pub fn total_issuance() -> <T as Config<I>>::Balance

An auto-generated getter for [TotalIssuance].

§

impl<T, I> Pallet<T, I>
where T: Config<I>, I: 'static,

pub fn transfer_allow_death( origin: <T as Config>::RuntimeOrigin, dest: <<T as Config>::Lookup as StaticLookup>::Source, value: <T as Config<I>>::Balance ) -> Result<(), DispatchError>

Transfer some liquid free balance to another account.

transfer_allow_death will set the FreeBalance of the sender and receiver. If the sender’s account is below the existential deposit as a result of the transfer, the account will be reaped.

The dispatch origin for this call must be Signed by the transactor.

pub fn force_transfer( origin: <T as Config>::RuntimeOrigin, source: <<T as Config>::Lookup as StaticLookup>::Source, dest: <<T as Config>::Lookup as StaticLookup>::Source, value: <T as Config<I>>::Balance ) -> Result<(), DispatchError>

Exactly as transfer_allow_death, except the origin must be root and the source account may be specified.

pub fn transfer_keep_alive( origin: <T as Config>::RuntimeOrigin, dest: <<T as Config>::Lookup as StaticLookup>::Source, value: <T as Config<I>>::Balance ) -> Result<(), DispatchError>

Same as the transfer_allow_death call, but with a check that the transfer will not kill the origin account.

99% of the time you want transfer_allow_death instead.

pub fn transfer_all( origin: <T as Config>::RuntimeOrigin, dest: <<T as Config>::Lookup as StaticLookup>::Source, keep_alive: bool ) -> Result<(), DispatchError>

Transfer the entire transferable balance from the caller account.

NOTE: This function only attempts to transfer transferable balances. This means that any locked, reserved, or existential deposits (when keep_alive is true), will not be transferred by this function. To ensure that this function results in a killed account, you might need to prepare the account by removing any reference counters, storage deposits, etc…

The dispatch origin of this call must be Signed.

  • dest: The recipient of the transfer.
  • keep_alive: A boolean to determine if the transfer_all operation should send all of the funds the account has, causing the sender account to be killed (false), or transfer everything except at least the existential deposit, which will guarantee to keep the sender account alive (true).

pub fn force_unreserve( origin: <T as Config>::RuntimeOrigin, who: <<T as Config>::Lookup as StaticLookup>::Source, amount: <T as Config<I>>::Balance ) -> Result<(), DispatchError>

Unreserve some balance from a user by force.

Can only be called by ROOT.

pub fn force_set_balance( origin: <T as Config>::RuntimeOrigin, who: <<T as Config>::Lookup as StaticLookup>::Source, new_free: <T as Config<I>>::Balance ) -> Result<(), DispatchError>

Upgrade a specified account.

  • origin: Must be Signed.
  • who: The account to be upgraded.

This will waive the transaction fee if at least all but 10% of the accounts needed to be upgraded. (We let some not have to be upgraded just in order to allow for the possibililty of churn). Set the regular balance of a given account.

The dispatch origin for this call is root.

pub fn force_adjust_total_issuance( origin: <T as Config>::RuntimeOrigin, direction: AdjustmentDirection, delta: <T as Config<I>>::Balance ) -> Result<(), DispatchError>

Adjust the total issuance in a saturating way.

Can only be called by root and always needs a positive delta.

§Example
#[test]
fn force_adjust_total_issuance_example() {
	ExtBuilder::default().build_and_execute_with(|| {
		// First we set the TotalIssuance to 64 by giving Alice a balance of 64.
		assert_ok!(Balances::force_set_balance(RuntimeOrigin::root(), ALICE, 64));
		let old_ti = Balances::total_issuance();
		assert_eq!(old_ti, 64, "TI should be 64");

		// Now test the increase:
		assert_ok!(Balances::force_adjust_total_issuance(RawOrigin::Root.into(), Inc, 32));
		let new_ti = Balances::total_issuance();
		assert_eq!(old_ti + 32, new_ti, "Should increase by 32");

		// If Alice tries to call it, it errors:
		assert_noop!(
			Balances::force_adjust_total_issuance(RawOrigin::Signed(ALICE).into(), Inc, 32),
			BadOrigin,
		);
	});
}

Trait Implementations

§

impl<T, I> AccountTouch<(), <T as Config>::AccountId> for Pallet<T, I>
where T: Config<I>, I: 'static,

§

type Balance = <T as Config<I>>::Balance

The type for currency units of the deposit.
§

fn deposit_required( _: () ) -> <Pallet<T, I> as AccountTouch<(), <T as Config>::AccountId>>::Balance

The deposit amount of a native currency required for touching an account of the asset.
§

fn should_touch(_: (), _: &<T as Config>::AccountId) -> bool

Check if an account for a given asset should be touched to meet the existence requirements.
§

fn touch( _: (), _: &<T as Config>::AccountId, _: &<T as Config>::AccountId ) -> Result<(), DispatchError>

Create an account for who of the asset with a deposit taken from the depositor.
§

impl<T, I> Balanced<<T as Config>::AccountId> for Pallet<T, I>
where T: Config<I>, I: 'static,

§

type OnDropCredit = DecreaseIssuance<<T as Config>::AccountId, Pallet<T, I>>

The type for managing what happens when an instance of Credit is dropped without being used.
§

type OnDropDebt = IncreaseIssuance<<T as Config>::AccountId, Pallet<T, I>>

The type for managing what happens when an instance of Debt is dropped without being used.
§

fn done_deposit( who: &<T as Config>::AccountId, amount: <Pallet<T, I> as Inspect<<T as Config>::AccountId>>::Balance )

§

fn done_withdraw( who: &<T as Config>::AccountId, amount: <Pallet<T, I> as Inspect<<T as Config>::AccountId>>::Balance )

§

fn done_issue( amount: <Pallet<T, I> as Inspect<<T as Config>::AccountId>>::Balance )

§

fn done_rescind( amount: <Pallet<T, I> as Inspect<<T as Config>::AccountId>>::Balance )

§

fn rescind( amount: Self::Balance ) -> Imbalance<Self::Balance, Self::OnDropDebt, Self::OnDropCredit>

Reduce the total issuance by amount and return the according imbalance. The imbalance will typically be used to reduce an account by the same amount with e.g. [Balanced::settle]. Read more
§

fn issue( amount: Self::Balance ) -> Imbalance<Self::Balance, Self::OnDropCredit, Self::OnDropDebt>

Increase the total issuance by amount and return the according imbalance. The imbalance will typically be used to increase an account by the same amount with e.g. [Balanced::resolve]. Read more
§

fn pair( amount: Self::Balance ) -> Result<(Imbalance<Self::Balance, Self::OnDropDebt, Self::OnDropCredit>, Imbalance<Self::Balance, Self::OnDropCredit, Self::OnDropDebt>), DispatchError>

Produce a pair of imbalances that cancel each other out exactly. Read more
§

fn deposit( who: &AccountId, value: Self::Balance, precision: Precision ) -> Result<Imbalance<Self::Balance, Self::OnDropDebt, Self::OnDropCredit>, DispatchError>

Mints value into the account of who, creating it as needed. Read more
§

fn withdraw( who: &AccountId, value: Self::Balance, precision: Precision, preservation: Preservation, force: Fortitude ) -> Result<Imbalance<Self::Balance, Self::OnDropCredit, Self::OnDropDebt>, DispatchError>

Removes value balance from who account if possible. Read more
§

fn resolve( who: &AccountId, credit: Imbalance<Self::Balance, Self::OnDropCredit, Self::OnDropDebt> ) -> Result<(), Imbalance<Self::Balance, Self::OnDropCredit, Self::OnDropDebt>>

The balance of who is increased in order to counter credit. If the whole of credit cannot be countered, then nothing is changed and the original credit is returned in an Err. Read more
§

fn settle( who: &AccountId, debt: Imbalance<Self::Balance, Self::OnDropDebt, Self::OnDropCredit>, preservation: Preservation ) -> Result<Imbalance<Self::Balance, Self::OnDropCredit, Self::OnDropDebt>, Imbalance<Self::Balance, Self::OnDropDebt, Self::OnDropCredit>>

The balance of who is decreased in order to counter debt. If the whole of debt cannot be countered, then nothing is changed and the original debt is returned in an Err.
§

impl<T, I> Balanced<<T as Config>::AccountId> for Pallet<T, I>
where T: Config<I>, I: 'static,

§

fn slash( reason: &Self::Reason, who: &AccountId, amount: Self::Balance ) -> (Imbalance<Self::Balance, Self::OnDropCredit, Self::OnDropDebt>, Self::Balance)

Reduce the balance of some funds on hold in an account. Read more
§

fn done_slash(_reason: &Self::Reason, _who: &AccountId, _amount: Self::Balance)

§

impl<T, I> BeforeAllRuntimeMigrations for Pallet<T, I>
where T: Config<I>, I: 'static,

§

fn before_all_runtime_migrations() -> Weight

Something that should happen before runtime migrations are executed.
§

impl<T, I> Benchmarking for Pallet<T, I>
where T: Config<I> + Config, I: 'static,

§

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
§

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.
§

impl<T, I> Callable<T> for Pallet<T, I>
where T: Config<I>, I: 'static,

§

type RuntimeCall = Call<T, I>

§

impl<T, I> Clone for Pallet<T, I>

§

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

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
§

impl<T, I> Currency<<T as Config>::AccountId> for Pallet<T, I>
where T: Config<I>, I: 'static, <T as Config<I>>::Balance: MaybeSerializeDeserialize + Debug,

§

fn slash( who: &<T as Config>::AccountId, value: <Pallet<T, I> as Currency<<T as Config>::AccountId>>::Balance ) -> (<Pallet<T, I> as Currency<<T as Config>::AccountId>>::NegativeImbalance, <Pallet<T, I> as Currency<<T as Config>::AccountId>>::Balance)

Slash a target account who, returning the negative imbalance created and any left over amount that could not be slashed.

Is a no-op if value to be slashed is zero or the account does not exist.

NOTE: slash() prefers free balance, but assumes that reserve balance can be drawn from in extreme circumstances. can_slash() should be used prior to slash() to avoid having to draw from reserved funds, however we err on the side of punishment if things are inconsistent or can_slash wasn’t used appropriately.

§

fn deposit_into_existing( who: &<T as Config>::AccountId, value: <Pallet<T, I> as Currency<<T as Config>::AccountId>>::Balance ) -> Result<<Pallet<T, I> as Currency<<T as Config>::AccountId>>::PositiveImbalance, DispatchError>

Deposit some value into the free balance of an existing target account who.

Is a no-op if the value to be deposited is zero.

§

fn deposit_creating( who: &<T as Config>::AccountId, value: <Pallet<T, I> as Currency<<T as Config>::AccountId>>::Balance ) -> <Pallet<T, I> as Currency<<T as Config>::AccountId>>::PositiveImbalance

Deposit some value into the free balance of who, possibly creating a new account.

This function is a no-op if:

  • the value to be deposited is zero; or
  • the value to be deposited is less than the required ED and the account does not yet exist; or
  • the deposit would necessitate the account to exist and there are no provider references; or
  • value is so large it would cause the balance of who to overflow.
§

fn withdraw( who: &<T as Config>::AccountId, value: <Pallet<T, I> as Currency<<T as Config>::AccountId>>::Balance, reasons: WithdrawReasons, liveness: ExistenceRequirement ) -> Result<<Pallet<T, I> as Currency<<T as Config>::AccountId>>::NegativeImbalance, DispatchError>

Withdraw some free balance from an account, respecting existence requirements.

Is a no-op if value to be withdrawn is zero.

§

fn make_free_balance_be( who: &<T as Config>::AccountId, value: <Pallet<T, I> as Currency<<T as Config>::AccountId>>::Balance ) -> SignedImbalance<<Pallet<T, I> as Currency<<T as Config>::AccountId>>::Balance, <Pallet<T, I> as Currency<<T as Config>::AccountId>>::PositiveImbalance>

Force the new free balance of a target account who to some new value balance.

§

type Balance = <T as Config<I>>::Balance

The balance of an account.
§

type PositiveImbalance = PositiveImbalance<T, I>

The opaque token type for an imbalance. This is returned by unbalanced operations and must be dealt with. It may be dropped but cannot be cloned.
§

type NegativeImbalance = NegativeImbalance<T, I>

The opaque token type for an imbalance. This is returned by unbalanced operations and must be dealt with. It may be dropped but cannot be cloned.
§

fn total_balance( who: &<T as Config>::AccountId ) -> <Pallet<T, I> as Currency<<T as Config>::AccountId>>::Balance

The combined balance of who.
§

fn can_slash( who: &<T as Config>::AccountId, value: <Pallet<T, I> as Currency<<T as Config>::AccountId>>::Balance ) -> bool

Same result as slash(who, value) (but without the side-effects) assuming there are no balance changes in the meantime and only the reserved balance is not taken into account.
§

fn total_issuance( ) -> <Pallet<T, I> as Currency<<T as Config>::AccountId>>::Balance

The total amount of issuance in the system.
§

fn active_issuance( ) -> <Pallet<T, I> as Currency<<T as Config>::AccountId>>::Balance

The total amount of issuance in the system excluding those which are controlled by the system.
§

fn deactivate( amount: <Pallet<T, I> as Currency<<T as Config>::AccountId>>::Balance )

Reduce the active issuance by some amount.
§

fn reactivate( amount: <Pallet<T, I> as Currency<<T as Config>::AccountId>>::Balance )

Increase the active issuance by some amount, up to the outstanding amount reduced.
§

fn minimum_balance( ) -> <Pallet<T, I> as Currency<<T as Config>::AccountId>>::Balance

The minimum balance any single account may have. This is equivalent to the Balances module’s ExistentialDeposit.
§

fn burn( amount: <Pallet<T, I> as Currency<<T as Config>::AccountId>>::Balance ) -> <Pallet<T, I> as Currency<<T as Config>::AccountId>>::PositiveImbalance

Reduce the total issuance by amount and return the according imbalance. The imbalance will typically be used to reduce an account by the same amount with e.g. settle. Read more
§

fn issue( amount: <Pallet<T, I> as Currency<<T as Config>::AccountId>>::Balance ) -> <Pallet<T, I> as Currency<<T as Config>::AccountId>>::NegativeImbalance

Increase the total issuance by amount and return the according imbalance. The imbalance will typically be used to increase an account by the same amount with e.g. resolve_into_existing or resolve_creating. Read more
§

fn free_balance( who: &<T as Config>::AccountId ) -> <Pallet<T, I> as Currency<<T as Config>::AccountId>>::Balance

The ‘free’ balance of a given account. Read more
§

fn ensure_can_withdraw( who: &<T as Config>::AccountId, amount: <T as Config<I>>::Balance, _reasons: WithdrawReasons, new_balance: <T as Config<I>>::Balance ) -> Result<(), DispatchError>

Returns Ok iff the account is able to make a withdrawal of the given amount for the given reason. Basically, it’s just a dry-run of withdraw. Read more
§

fn transfer( transactor: &<T as Config>::AccountId, dest: &<T as Config>::AccountId, value: <Pallet<T, I> as Currency<<T as Config>::AccountId>>::Balance, existence_requirement: ExistenceRequirement ) -> Result<(), DispatchError>

Transfer some liquid free balance to another staker. Read more
§

fn pair( amount: Self::Balance ) -> (Self::PositiveImbalance, Self::NegativeImbalance)

Produce a pair of imbalances that cancel each other out exactly. Read more
§

fn resolve_into_existing( who: &AccountId, value: Self::NegativeImbalance ) -> Result<(), Self::NegativeImbalance>

Similar to deposit_creating, only accepts a NegativeImbalance and returns nothing on success.
§

fn resolve_creating(who: &AccountId, value: Self::NegativeImbalance)

Similar to deposit_creating, only accepts a NegativeImbalance and returns nothing on success.
§

fn settle( who: &AccountId, value: Self::PositiveImbalance, reasons: WithdrawReasons, liveness: ExistenceRequirement ) -> Result<(), Self::PositiveImbalance>

Similar to withdraw, only accepts a PositiveImbalance and returns nothing on success.
§

impl<T, I> Debug for Pallet<T, I>

§

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

Formats the value using the given formatter. Read more
§

impl<T, I> GetStorageVersion for Pallet<T, I>
where T: Config<I>, I: 'static,

§

type InCodeStorageVersion = StorageVersion

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

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

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

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
§

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

§

fn integrity_test()

Check the integrity of this pallet’s configuration. 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_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
§

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

A hook to run logic after inherent application. 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 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
§

impl<T, I> Inspect<<T as Config>::AccountId> for Pallet<T, I>
where T: Config<I>, I: 'static,

§

type Balance = <T as Config<I>>::Balance

Scalar type for representing balance of an account.
§

fn total_issuance( ) -> <Pallet<T, I> as Inspect<<T as Config>::AccountId>>::Balance

The total amount of issuance in the system.
§

fn active_issuance( ) -> <Pallet<T, I> as Inspect<<T as Config>::AccountId>>::Balance

The total amount of issuance in the system excluding those which are controlled by the system.
§

fn minimum_balance( ) -> <Pallet<T, I> as Inspect<<T as Config>::AccountId>>::Balance

The minimum balance any single account may have.
§

fn total_balance( who: &<T as Config>::AccountId ) -> <Pallet<T, I> as Inspect<<T as Config>::AccountId>>::Balance

Get the total amount of funds whose ultimate beneficial ownership can be determined as who. Read more
§

fn balance( who: &<T as Config>::AccountId ) -> <Pallet<T, I> as Inspect<<T as Config>::AccountId>>::Balance

Get the balance of who which does not include funds which are exclusively allocated to subsystems of the chain (“on hold” or “reserved”). Read more
§

fn reducible_balance( who: &<T as Config>::AccountId, preservation: Preservation, force: Fortitude ) -> <Pallet<T, I> as Inspect<<T as Config>::AccountId>>::Balance

Get the maximum amount that who can withdraw/transfer successfully based on whether the account should be kept alive (preservation) or whether we are willing to force the reduction and potentially go below user-level restrictions on the minimum amount of the account. Read more
§

fn can_deposit( who: &<T as Config>::AccountId, amount: <Pallet<T, I> as Inspect<<T as Config>::AccountId>>::Balance, provenance: Provenance ) -> DepositConsequence

Returns true if the balance of who may be increased by amount. Read more
§

fn can_withdraw( who: &<T as Config>::AccountId, amount: <Pallet<T, I> as Inspect<<T as Config>::AccountId>>::Balance ) -> WithdrawConsequence<<Pallet<T, I> as Inspect<<T as Config>::AccountId>>::Balance>

Returns Success if the balance of who may be decreased by amount, otherwise the consequence.
§

impl<T, I> Inspect<<T as Config>::AccountId> for Pallet<T, I>
where T: Config<I>, I: 'static,

§

type Id = <T as Config<I>>::FreezeIdentifier

An identifier for a freeze.
§

fn balance_frozen( id: &<Pallet<T, I> as Inspect<<T as Config>::AccountId>>::Id, who: &<T as Config>::AccountId ) -> <Pallet<T, I> as Inspect<<T as Config>::AccountId>>::Balance

Amount of funds held in reserve by who for the given id.
§

fn can_freeze( id: &<Pallet<T, I> as Inspect<<T as Config>::AccountId>>::Id, who: &<T as Config>::AccountId ) -> bool

Returns true if it’s possible to introduce a freeze for the given id onto the account of who. This will be true as long as the implementor supports as many concurrent freeze locks as there are possible values of id.
§

fn balance_freezable(who: &AccountId) -> Self::Balance

The amount of the balance which can become frozen. Defaults to total_balance().
§

impl<T, I> Inspect<<T as Config>::AccountId> for Pallet<T, I>
where T: Config<I>, I: 'static,

§

type Reason = <T as Config<I>>::RuntimeHoldReason

An identifier for a hold. Used for disambiguating different holds so that they can be individually replaced or removed and funds from one hold don’t accidentally become unreserved or slashed for another.
§

fn total_balance_on_hold( who: &<T as Config>::AccountId ) -> <T as Config<I>>::Balance

Amount of funds on hold (for all hold reasons) of who.
§

fn reducible_total_balance_on_hold( who: &<T as Config>::AccountId, force: Fortitude ) -> <Pallet<T, I> as Inspect<<T as Config>::AccountId>>::Balance

Get the maximum amount that the total_balance_on_hold of who can be reduced successfully based on whether we are willing to force the reduction and potentially go below user-level restrictions on the minimum amount of the account. Note: This cannot bring the account into an inconsistent state with regards any required existential deposit. Read more
§

fn balance_on_hold( reason: &<Pallet<T, I> as Inspect<<T as Config>::AccountId>>::Reason, who: &<T as Config>::AccountId ) -> <T as Config<I>>::Balance

Amount of funds on hold (for the given reason) of who.
§

fn hold_available( reason: &<Pallet<T, I> as Inspect<<T as Config>::AccountId>>::Reason, who: &<T as Config>::AccountId ) -> bool

Returns true if it’s possible to place (additional) funds under a hold of a given reason. This may fail if the account has exhausted a limited number of concurrent holds or if it cannot be made to exist (e.g. there is no provider reference). Read more
§

fn ensure_can_hold( reason: &Self::Reason, who: &AccountId, amount: Self::Balance ) -> Result<(), DispatchError>

Check to see if some amount of funds of who may be placed on hold with the given reason. Reasons why this may not be true: Read more
§

fn can_hold( reason: &Self::Reason, who: &AccountId, amount: Self::Balance ) -> bool

Check to see if some amount of funds of who may be placed on hold for the given reason. Reasons why this may not be true: Read more
§

impl<T, I> IntegrityTest for Pallet<T, I>
where T: Config<I>, I: 'static,

§

fn integrity_test()

See [Hooks::integrity_test].
§

impl<T, I> LockableCurrency<<T as Config>::AccountId> for Pallet<T, I>
where T: Config<I>, I: 'static, <T as Config<I>>::Balance: MaybeSerializeDeserialize + Debug,

§

type Moment = <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number

The quantity used to denote time; usually just a BlockNumber.
§

type MaxLocks = <T as Config<I>>::MaxLocks

The maximum number of locks a user should have on their account.
§

fn set_lock( id: [u8; 8], who: &<T as Config>::AccountId, amount: <T as Config<I>>::Balance, reasons: WithdrawReasons )

Create a new balance lock on account who. Read more
§

fn extend_lock( id: [u8; 8], who: &<T as Config>::AccountId, amount: <T as Config<I>>::Balance, reasons: WithdrawReasons )

Changes a balance lock (selected by id) so that it becomes less liquid in all parameters or creates a new one if it does not exist. Read more
§

fn remove_lock(id: [u8; 8], who: &<T as Config>::AccountId)

Remove an existing lock.
§

impl<T, I> Mutate<<T as Config>::AccountId> for Pallet<T, I>
where T: Config<I>, I: 'static,

§

fn done_mint_into( who: &<T as Config>::AccountId, amount: <Pallet<T, I> as Inspect<<T as Config>::AccountId>>::Balance )

§

fn done_burn_from( who: &<T as Config>::AccountId, amount: <Pallet<T, I> as Inspect<<T as Config>::AccountId>>::Balance )

§

fn done_shelve( who: &<T as Config>::AccountId, amount: <Pallet<T, I> as Inspect<<T as Config>::AccountId>>::Balance )

§

fn done_restore( who: &<T as Config>::AccountId, amount: <Pallet<T, I> as Inspect<<T as Config>::AccountId>>::Balance )

§

fn done_transfer( source: &<T as Config>::AccountId, dest: &<T as Config>::AccountId, amount: <Pallet<T, I> as Inspect<<T as Config>::AccountId>>::Balance )

§

fn mint_into( who: &AccountId, amount: Self::Balance ) -> Result<Self::Balance, DispatchError>

Increase the balance of who by exactly amount, minting new tokens. If that isn’t possible then an Err is returned and nothing is changed.
§

fn burn_from( who: &AccountId, amount: Self::Balance, precision: Precision, force: Fortitude ) -> Result<Self::Balance, DispatchError>

Decrease the balance of who by at least amount, possibly slightly more in the case of minimum-balance requirements, burning the tokens. If that isn’t possible then an Err is returned and nothing is changed. If successful, the amount of tokens reduced is returned.
§

fn shelve( who: &AccountId, amount: Self::Balance ) -> Result<Self::Balance, DispatchError>

Attempt to decrease the asset balance of who by amount. Read more
§

fn restore( who: &AccountId, amount: Self::Balance ) -> Result<Self::Balance, DispatchError>

Attempt to increase the asset balance of who by amount. Read more
§

fn transfer( source: &AccountId, dest: &AccountId, amount: Self::Balance, preservation: Preservation ) -> Result<Self::Balance, DispatchError>

Transfer funds from one account into another. Read more
§

fn set_balance(who: &AccountId, amount: Self::Balance) -> Self::Balance

Simple infallible function to force an account to have a particular balance, good for use in tests and benchmarks but not recommended for production code owing to the lack of error reporting. Read more
§

impl<T, I> Mutate<<T as Config>::AccountId> for Pallet<T, I>
where T: Config<I>, I: 'static,

§

fn set_freeze( id: &<Pallet<T, I> as Inspect<<T as Config>::AccountId>>::Id, who: &<T as Config>::AccountId, amount: <Pallet<T, I> as Inspect<<T as Config>::AccountId>>::Balance ) -> Result<(), DispatchError>

Prevent actions which would reduce the balance of the account of who below the given amount and identify this restriction though the given id. Unlike extend_freeze, any outstanding freeze in place for who under the id are dropped. Read more
§

fn extend_freeze( id: &<Pallet<T, I> as Inspect<<T as Config>::AccountId>>::Id, who: &<T as Config>::AccountId, amount: <Pallet<T, I> as Inspect<<T as Config>::AccountId>>::Balance ) -> Result<(), DispatchError>

Prevent the balance of the account of who from being reduced below the given amount and identify this restriction though the given id. Unlike set_freeze, this does not counteract any pre-existing freezes in place for who under the id. Also unlike set_freeze, in the case that amount is zero, this is no-op and never fails. Read more
§

fn thaw( id: &<Pallet<T, I> as Inspect<<T as Config>::AccountId>>::Id, who: &<T as Config>::AccountId ) -> Result<(), DispatchError>

Remove an existing lock.
§

fn set_frozen( id: &Self::Id, who: &AccountId, amount: Self::Balance, fortitude: Fortitude ) -> Result<(), DispatchError>

Attempt to alter the amount frozen under the given id to amount. Read more
§

fn ensure_frozen( id: &Self::Id, who: &AccountId, amount: Self::Balance, fortitude: Fortitude ) -> Result<(), DispatchError>

Attempt to set the amount frozen under the given id to amount, iff this would increase the amount frozen under id. Do nothing otherwise. Read more
§

fn decrease_frozen( id: &Self::Id, who: &AccountId, amount: Self::Balance ) -> Result<(), DispatchError>

Decrease the amount which is being frozen for a particular freeze, failing in the case of underflow.
§

fn increase_frozen( id: &Self::Id, who: &AccountId, amount: Self::Balance ) -> Result<(), DispatchError>

Increase the amount which is being frozen for a particular freeze, failing in the case that too little balance is available for being frozen.
§

impl<T, I> Mutate<<T as Config>::AccountId> for Pallet<T, I>
where T: Config<I>, I: 'static,

§

fn hold( reason: &Self::Reason, who: &AccountId, amount: Self::Balance ) -> Result<(), DispatchError>

Hold some funds in an account. If a hold for reason is already in place, then this will increase it.
§

fn release( reason: &Self::Reason, who: &AccountId, amount: Self::Balance, precision: Precision ) -> Result<Self::Balance, DispatchError>

Release up to amount held funds in an account. Read more
§

fn set_on_hold( reason: &Self::Reason, who: &AccountId, amount: Self::Balance ) -> Result<(), DispatchError>

Hold or release funds in the account of who to bring the balance on hold for reason to exactly amount.
§

fn release_all( reason: &Self::Reason, who: &AccountId, precision: Precision ) -> Result<Self::Balance, DispatchError>

Release all funds in the account of who on hold for reason. Read more
§

fn burn_held( reason: &Self::Reason, who: &AccountId, amount: Self::Balance, precision: Precision, force: Fortitude ) -> Result<Self::Balance, DispatchError>

Attempt to decrease the balance of who which is held for the given reason by amount. Read more
§

fn burn_all_held( reason: &Self::Reason, who: &AccountId, precision: Precision, force: Fortitude ) -> Result<Self::Balance, DispatchError>

Attempt to decrease the balance of who which is held for the given reason to zero. Read more
§

fn transfer_on_hold( reason: &Self::Reason, source: &AccountId, dest: &AccountId, amount: Self::Balance, precision: Precision, mode: Restriction, force: Fortitude ) -> Result<Self::Balance, DispatchError>

Transfer held funds into a destination account. Read more
§

fn transfer_and_hold( reason: &Self::Reason, source: &AccountId, dest: &AccountId, amount: Self::Balance, precision: Precision, expendability: Preservation, force: Fortitude ) -> Result<Self::Balance, DispatchError>

Transfer some amount of free balance from source to become owned by dest but on hold for reason. Read more
§

fn done_hold(_reason: &Self::Reason, _who: &AccountId, _amount: Self::Balance)

§

fn done_release( _reason: &Self::Reason, _who: &AccountId, _amount: Self::Balance )

§

fn done_burn_held( _reason: &Self::Reason, _who: &AccountId, _amount: Self::Balance )

§

fn done_transfer_on_hold( _reason: &Self::Reason, _source: &AccountId, _dest: &AccountId, _amount: Self::Balance )

§

fn done_transfer_and_hold( _reason: &Self::Reason, _source: &AccountId, _dest: &AccountId, _transferred: Self::Balance )

§

impl<T, I> NamedReservableCurrency<<T as Config>::AccountId> for Pallet<T, I>
where T: Config<I>, I: 'static, <T as Config<I>>::Balance: MaybeSerializeDeserialize + Debug,

§

fn reserve_named( id: &<Pallet<T, I> as NamedReservableCurrency<<T as Config>::AccountId>>::ReserveIdentifier, who: &<T as Config>::AccountId, value: <Pallet<T, I> as Currency<<T as Config>::AccountId>>::Balance ) -> Result<(), DispatchError>

Move value from the free balance from who to a named reserve balance.

Is a no-op if value to be reserved is zero.

§

fn unreserve_named( id: &<Pallet<T, I> as NamedReservableCurrency<<T as Config>::AccountId>>::ReserveIdentifier, who: &<T as Config>::AccountId, value: <Pallet<T, I> as Currency<<T as Config>::AccountId>>::Balance ) -> <Pallet<T, I> as Currency<<T as Config>::AccountId>>::Balance

Unreserve some funds, returning any amount that was unable to be unreserved.

Is a no-op if the value to be unreserved is zero.

§

fn slash_reserved_named( id: &<Pallet<T, I> as NamedReservableCurrency<<T as Config>::AccountId>>::ReserveIdentifier, who: &<T as Config>::AccountId, value: <Pallet<T, I> as Currency<<T as Config>::AccountId>>::Balance ) -> (<Pallet<T, I> as Currency<<T as Config>::AccountId>>::NegativeImbalance, <Pallet<T, I> as Currency<<T as Config>::AccountId>>::Balance)

Slash from reserved balance, returning the negative imbalance created, and any amount that was unable to be slashed.

Is a no-op if the value to be slashed is zero.

§

fn repatriate_reserved_named( id: &<Pallet<T, I> as NamedReservableCurrency<<T as Config>::AccountId>>::ReserveIdentifier, slashed: &<T as Config>::AccountId, beneficiary: &<T as Config>::AccountId, value: <Pallet<T, I> as Currency<<T as Config>::AccountId>>::Balance, status: BalanceStatus ) -> Result<<Pallet<T, I> as Currency<<T as Config>::AccountId>>::Balance, DispatchError>

Move the reserved balance of one account into the balance of another, according to status. If status is Reserved, the balance will be reserved with given id.

Is a no-op if:

  • the value to be moved is zero; or
  • the slashed id equal to beneficiary and the status is Reserved.
§

type ReserveIdentifier = <T as Config<I>>::ReserveIdentifier

An identifier for a reserve. Used for disambiguating different reserves so that they can be individually replaced or removed.
§

fn reserved_balance_named( id: &<Pallet<T, I> as NamedReservableCurrency<<T as Config>::AccountId>>::ReserveIdentifier, who: &<T as Config>::AccountId ) -> <Pallet<T, I> as Currency<<T as Config>::AccountId>>::Balance

The amount of the balance of a given account that is externally reserved; this can still get slashed, but gets slashed last of all. Read more
§

fn ensure_reserved_named( id: &Self::ReserveIdentifier, who: &AccountId, value: Self::Balance ) -> Result<(), DispatchError>

Ensure the reserved balance is equal to value. Read more
§

fn unreserve_all_named( id: &Self::ReserveIdentifier, who: &AccountId ) -> Self::Balance

Unreserve all the named reserved balances, returning unreserved amount. Read more
§

fn slash_all_reserved_named( id: &Self::ReserveIdentifier, who: &AccountId ) -> Self::NegativeImbalance

Slash all the reserved balance, returning the negative imbalance created. Read more
§

fn repatriate_all_reserved_named( id: &Self::ReserveIdentifier, slashed: &AccountId, beneficiary: &AccountId, status: BalanceStatus ) -> Result<(), DispatchError>

Move all the named reserved balance of one account into the balance of another, according to status. If status is Reserved, the balance will be reserved with given id. Read more
§

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

§

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
§

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

§

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

See [Hooks::on_finalize].
§

impl<T, I> OnGenesis for Pallet<T, I>
where T: Config<I>, I: 'static,

§

fn on_genesis()

Something that should happen at genesis.
§

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

§

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

See [Hooks::on_idle].
§

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

§

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

See [Hooks::on_initialize].
§

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

§

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
§

impl<T, I> OnRuntimeUpgrade for Pallet<T, I>
where T: Config<I>, I: 'static,

§

fn on_runtime_upgrade() -> Weight

See [Hooks::on_runtime_upgrade].
§

impl<T, I> PalletInfoAccess for Pallet<T, I>
where T: Config<I>, I: 'static,

§

fn index() -> usize

Index of the pallet as configured in the runtime.
§

fn name() -> &'static str

Name of the pallet as configured in the runtime.
§

fn name_hash() -> [u8; 16]

Two128 hash of name.
§

fn module_name() -> &'static str

Name of the Rust module containing the pallet.
§

fn crate_version() -> CrateVersion

Version of the crate containing the pallet.
§

impl<T, I> PalletsInfoAccess for Pallet<T, I>
where T: Config<I>, I: 'static,

§

fn count() -> usize

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

fn infos() -> Vec<PalletInfoData>

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

impl<T, I> PartialEq for Pallet<T, I>

§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

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

impl<T, I> ReservableCurrency<<T as Config>::AccountId> for Pallet<T, I>
where T: Config<I>, I: 'static, <T as Config<I>>::Balance: MaybeSerializeDeserialize + Debug,

§

fn can_reserve( who: &<T as Config>::AccountId, value: <Pallet<T, I> as Currency<<T as Config>::AccountId>>::Balance ) -> bool

Check if who can reserve value from their free balance.

Always true if value to be reserved is zero.

§

fn reserve( who: &<T as Config>::AccountId, value: <Pallet<T, I> as Currency<<T as Config>::AccountId>>::Balance ) -> Result<(), DispatchError>

Move value from the free balance from who to their reserved balance.

Is a no-op if value to be reserved is zero.

§

fn unreserve( who: &<T as Config>::AccountId, value: <Pallet<T, I> as Currency<<T as Config>::AccountId>>::Balance ) -> <Pallet<T, I> as Currency<<T as Config>::AccountId>>::Balance

Unreserve some funds, returning any amount that was unable to be unreserved.

Is a no-op if the value to be unreserved is zero or the account does not exist.

NOTE: returns amount value which wasn’t successfully unreserved.

§

fn slash_reserved( who: &<T as Config>::AccountId, value: <Pallet<T, I> as Currency<<T as Config>::AccountId>>::Balance ) -> (<Pallet<T, I> as Currency<<T as Config>::AccountId>>::NegativeImbalance, <Pallet<T, I> as Currency<<T as Config>::AccountId>>::Balance)

Slash from reserved balance, returning the negative imbalance created, and any amount that was unable to be slashed.

Is a no-op if the value to be slashed is zero or the account does not exist.

§

fn repatriate_reserved( slashed: &<T as Config>::AccountId, beneficiary: &<T as Config>::AccountId, value: <Pallet<T, I> as Currency<<T as Config>::AccountId>>::Balance, status: BalanceStatus ) -> Result<<Pallet<T, I> as Currency<<T as Config>::AccountId>>::Balance, DispatchError>

Move the reserved balance of one account into the balance of another, according to status.

Is a no-op if:

  • the value to be moved is zero; or
  • the slashed id equal to beneficiary and the status is Reserved.

This is Polite and thus will not repatriate any funds which would lead the total balance to be less than the frozen amount. Returns Ok with the actual amount of funds moved, which may be less than value since the operation is done an a BestEffort basis.

§

fn reserved_balance( who: &<T as Config>::AccountId ) -> <Pallet<T, I> as Currency<<T as Config>::AccountId>>::Balance

The amount of the balance of a given account that is externally reserved; this can still get slashed, but gets slashed last of all. Read more
§

impl<T, I> StorageInfoTrait for Pallet<T, I>
where T: Config<I>, I: 'static,

§

fn storage_info() -> Vec<StorageInfo>

§

impl<T, I> Unbalanced<<T as Config>::AccountId> for Pallet<T, I>
where T: Config<I>, I: 'static,

§

fn handle_dust(dust: Dust<<T as Config>::AccountId, Pallet<T, I>>)

Do something with the dust which has been destroyed from the system. [Dust] can be converted into a [Credit] with the [Balanced] trait impl.
§

fn write_balance( who: &<T as Config>::AccountId, amount: <Pallet<T, I> as Inspect<<T as Config>::AccountId>>::Balance ) -> Result<Option<<Pallet<T, I> as Inspect<<T as Config>::AccountId>>::Balance>, DispatchError>

Forcefully set the balance of who to amount. Read more
§

fn set_total_issuance( amount: <Pallet<T, I> as Inspect<<T as Config>::AccountId>>::Balance )

Set the total issuance to amount.
§

fn deactivate( amount: <Pallet<T, I> as Inspect<<T as Config>::AccountId>>::Balance )

Reduce the active issuance by some amount.
§

fn reactivate( amount: <Pallet<T, I> as Inspect<<T as Config>::AccountId>>::Balance )

Increase the active issuance by some amount, up to the outstanding amount reduced.
§

fn handle_raw_dust(amount: Self::Balance)

Create some dust and handle it with [Unbalanced::handle_dust]. This is an unbalanced operation and it must only be used when an account is modified in a raw fashion, outside of the entire fungibles API. The amount is capped at [Inspect::minimum_balance()] - 1`. Read more
§

fn decrease_balance( who: &AccountId, amount: Self::Balance, precision: Precision, preservation: Preservation, force: Fortitude ) -> Result<Self::Balance, DispatchError>

Reduce the balance of who by amount. Read more
§

fn increase_balance( who: &AccountId, amount: Self::Balance, precision: Precision ) -> Result<Self::Balance, DispatchError>

Increase the balance of who by amount. Read more
§

impl<T, I> Unbalanced<<T as Config>::AccountId> for Pallet<T, I>
where T: Config<I>, I: 'static,

§

fn set_balance_on_hold( reason: &<Pallet<T, I> as Inspect<<T as Config>::AccountId>>::Reason, who: &<T as Config>::AccountId, amount: <Pallet<T, I> as Inspect<<T as Config>::AccountId>>::Balance ) -> Result<(), DispatchError>

Forcefully set the balance on hold of who to amount. This is independent of any other balances on hold or the main (“free”) balance. Read more
§

fn decrease_balance_on_hold( reason: &Self::Reason, who: &AccountId, amount: Self::Balance, precision: Precision ) -> Result<Self::Balance, DispatchError>

Reduce the balance on hold of who by amount. Read more
§

fn increase_balance_on_hold( reason: &Self::Reason, who: &AccountId, amount: Self::Balance, precision: Precision ) -> Result<Self::Balance, DispatchError>

Increase the balance on hold of who by amount. Read more
§

impl<T, I> WhitelistedStorageKeys for Pallet<T, I>
where T: Config<I>, I: 'static,

§

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.
§

impl<T, I> Eq for Pallet<T, I>