-
Notifications
You must be signed in to change notification settings - Fork 104
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
client/asset: Add AccounterRedeemer interface with methods for locking and unlocking funds for redemption. ReserveN is used to reserve funds for an order. Only the amount reserved is returned. All accounting from there is handled by Core, who will return funds proportionally according to match quantities and order size. The amount reserved is persisted in the OrderMetaData so that accounting can be picked up exactly as it was on restarts. This pattern was chosen over trying to figure out how much to lock on restart with calculations based on order info because you would need to consider changes in asset configuration and therefore persist more data and ... it gets messy. client/core: Add RedeemSig to orders redeeming to and AccountRedeemer. Track and return reserved redemption funds. Return funds manually for refunds and revocations. Handle dust that can arise from rounding error. Log inconsistencies. client/asset/eth: Implement asset.AccountRedeemer. Track redemption reserves separately than swap reserves, but add them when calculating locked balance.
- Loading branch information
Showing
11 changed files
with
901 additions
and
153 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.