-
Notifications
You must be signed in to change notification settings - Fork 217
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
2560: Validate output bundles when processing coin selection requests r=jonathanknowles a=jonathanknowles # Issue Number ADP-727 ADP-782 # Overview This PR adds validation to coin selection requests, checking all **user-specified outputs** meet the following pre-conditions: - output bundles do not include token quantities in excess of the maximum bound: `maxBound :: Word64` - output bundles, when serialized, are within the size limit specified by the protocol: `4000` bytes If either of the above pre-conditions are violated, an API error is returned, with a message that informs the user how they can solve the problem (usually by breaking up bundles into smaller bundles): - `ErrOutputTokenBundleSizeExceedsLimit` - `ErrOutputTokenQuantityExceedsLimit` # Testing This PR adds integration tests for both of the above scenarios: - `WALLETS_COIN_SELECTION_07` - `WALLETS_COIN_SELECTION_08` # Refactoring This PR also performs a small refactoring in the same spirit as the refactorings included in PR #2552. We extract out `partition` functions for `Coin` and `TokenQuantity` values into the modules that define their types, similarly to the `X.equipartition` functions. Co-authored-by: Jonathan Knowles <[email protected]>
- Loading branch information
Showing
15 changed files
with
471 additions
and
75 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
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.