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 the frame-executive pallet is called.
  • The OnChargeTransaction implementation in the duniter-account pallet checks if the paying account is linked to an identity.
  • If linked, the request_refund function in the quota pallet evaluates the eligibility for fee refund based on the identity’s quota.
  • Eligible refunds are added to the RefundQueue, managed by process_refund_queue during the on_idle phase.
  • Refunds are processed with try_refund, using quotas to refund fees via spend_quota, and then executing the refund through do_refund by transferring currency from the RefundAccount back to the paying account.

§Conditions for Refund

Refunds are executed under the following conditions:

  1. The paying account is linked to an identity.
  2. Quotas are allocated to the identity and have a non-zero value after updates.

Re-exports§

Modules§

Functions§