Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
New messages:
MsgWithdrawReserve
: withdraws tokens from the reserve (available both from CLI and REST). Only allowed if the withdrawer is the bond's controller DID, and if the bond is in theOPEN
state and has enough available reserve.New fields in
bond
type:ReserveWithdrawalAddress
: destination address of any reserve tokens withdrawn via theMsgWithdrawReserve
message. This is specified during bond creation and is not optional.AvailableReserve
: coins value specifying the remaining reserve out of the current (virtual) reserve. This will only ever not match with the current reserve if theMsgWithdrawReserve
message is used. This defaults tonil
(empty coins) and is not specified during bond creation.AllowReserveWithdrawals
: bool specifying whether reserve withdrawals by the controller DID are allowed. This is specified during bond creation and is not optional (however if excluded from the CLI, it is assumed to be False).New queries:
QueryAvailableReserve
: gets the bond's available reserve (available both from CLI and REST)New invariants:
AvailableReserveInvariant
: ensures that the sum of all the 'available reserve' values being reported by the bonds matches the balance in the global reserve pool.Other changes:
WithdrawReserve
function toWithdrawFromReserve
to avoid clash with new messageDepositReserve
function toDepositIntoReserve
to match above changeInteresting points:
setReserveBalances
, we now also update the available reserve viasetAvailableReserve