Crate pallet_quota
source ·Expand description
§Duniter Quota Pallet
§Overview
This pallet is designed to manage transaction fee refunds based on quotas allocated to identities within the Duniter identity system. Quotas are linked to transaction fees, ensuring efficient handling of fee refunds when transactions occur.
§Refund Mechanism
When a transaction is processed:
- The
OnChargeTransaction
implementation in theframe-executive
pallet is called. - The
OnChargeTransaction
implementation in theduniter-account
pallet checks if the paying account is linked to an identity. - If linked, the
request_refund
function in thequota
pallet evaluates the eligibility for fee refund based on the identity’s quota. - Eligible refunds are added to the
RefundQueue
, managed byprocess_refund_queue
during theon_idle
phase. - Refunds are processed with
try_refund
, using quotas to refund fees viaspend_quota
, and then executing the refund throughdo_refund
by transferring currency from theRefundAccount
back to the paying account.
§Conditions for Refund
Refunds are executed under the following conditions:
- The paying account is linked to an identity.
- Quotas are allocated to the identity and have a non-zero value after updates.
Re-exports§
pub use weights::WeightInfo;
pub use pallet::*;
Modules§
- The
pallet
module in each FRAME pallet hosts the most important items needed to construct this pallet.
Functions§
- Checks if an identity is eligible for a refund.