Description
A few changes are needed to the clearing queue library (#357).
Obligation ordering
First, the library should enforce a strict ordering of the withdrawal obligations being registered based on the id field.
In addition to that, a new query should be exposed that returns the latest registered withdrawal obligation id.
Single denom
The clearing queue should operate in a single denom mode.
The denom should be configured during the instantiation.
As a result, the RegisterObligation function can be simplified:
/// validates and enqueues a new withdrawal obligation
RegisterObligation {
/// where the payout is to be routed
recipient: String,
/// what is owed to the recipient
payout_coins: Vec<Coin>, // this can become payout_amount: Uint128
/// some unique identifier for the request
id: Uint64,
},
During the settlement requests, the library should construct the coin to be paid out by looking at a given obligation payout_amount and applying the configured denom to that amount.
Description
A few changes are needed to the clearing queue library (#357).
Obligation ordering
First, the library should enforce a strict ordering of the withdrawal obligations being registered based on the
idfield.In addition to that, a new query should be exposed that returns the latest registered withdrawal obligation id.
Single denom
The clearing queue should operate in a single denom mode.
The denom should be configured during the instantiation.
As a result, the
RegisterObligationfunction can be simplified:During the settlement requests, the library should construct the coin to be paid out by looking at a given obligation
payout_amountand applying the configured denom to that amount.