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
OnChargeTransactionimplementation in theframe-executivepallet is called. - The
OnChargeTransactionimplementation in theduniter-accountpallet checks if the paying account is linked to an identity. - If linked, the
request_refundfunction in thequotapallet evaluates the eligibility for fee refund based on the identity’s quota. - Eligible refunds are added to the
RefundQueue, managed byprocess_refund_queueduring theon_idlephase. - Refunds are processed with
try_refund, using quotas to refund fees viaspend_quota, and then executing the refund throughdo_refundby transferring currency from theRefundAccountback 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
palletmodule in each FRAME pallet hosts the most important items needed to construct this pallet.
Functions§
- Checks if an identity is eligible for a refund.