-
Notifications
You must be signed in to change notification settings - Fork 214
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Parameterize UTxO identifier type in internal coin selection modules. #3157
Merged
iohk-bors
merged 8 commits into
master
from
jonathanknowles/use-type-parameter-for-utxo-identifier-in-internal-coin-selection-modules
Feb 25, 2022
Merged
Parameterize UTxO identifier type in internal coin selection modules. #3157
iohk-bors
merged 8 commits into
master
from
jonathanknowles/use-type-parameter-for-utxo-identifier-in-internal-coin-selection-modules
Feb 25, 2022
Conversation
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
Before this change, `outputs` was always instantiated in one of two ways: - outputs ~ [ (Address, TokenBundle)] - outputs ~ NonEmpty (Address, TokenBundle) In both cases, the type of an individual output is `(Address, TokenBundle)`. The only difference between these instantiations is the container type. As a result of this change, the above instantiations are simplified to: - outputs ~ [] - outputs ~ NonEmpty This allows us to simplify the type signatures of many functions that use the `SelectionParamsOf` and `SelectionResultOf` types, because we now only need to specify the container type, and not the type of output.
As before, we use the `u` parameter to represent the type of unique UTxO identifiers (unique identifiers for individual unspent transaction outputs).
As before, we use the `u` parameter to represent the type of unique UTxO identifiers (unique identifiers for individual unspent transaction outputs).
As before, we use the `u` parameter to represent the type of unique UTxO identifiers (unique identifiers for individual unspent transaction outputs).
…ernal`. As before, we use the `u` parameter to represent the type of unique UTxO identifiers (unique identifiers for individual unspent transaction outputs).
jonathanknowles
force-pushed
the
jonathanknowles/use-type-parameter-for-utxo-identifier-in-internal-coin-selection-modules
branch
from
February 25, 2022 09:42
a693587
to
7120457
Compare
This fixes a slight inconsistency in the API, making `availableMap` consistent with `leftoverMap` and `selectedMap`.
Anviking
approved these changes
Feb 25, 2022
{ outputsToCover | ||
:: !outputs | ||
:: !(outputs (Address, TokenBundle)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👌
bors r+ |
iohk-bors bot
added a commit
that referenced
this pull request
Feb 25, 2022
3157: Parameterize UTxO identifier type in internal coin selection modules. r=Anviking a=jonathanknowles ## Issue Number ADP-1478 ## Summary This PR parameterizes the UTxO identifier type in all modules within the `CoinSelection.Internal` hierarchy. As before, we use the type parameter `u` to represent the type of unique identifiers for individual UTxOs (unspent transaction outputs). In general, callers of coin selection can instantiate `u` to any type for which there is an `Ord` instance. ## Not tackled by this PR A future PR will update the test suite to use a more general type of UTxO identifier. For now, we continue to generate arbitrary values of `(TxIn, Address)` to act as UTxO identifiers. Co-authored-by: Jonathan Knowles <[email protected]>
Build failed: src/Test/Integration/Scenario/API/Shelley/Wallets.hs:558:9:
1) API Specifications, SHELLEY_WALLETS, WALLETS_GET_02, WALLETS_DELETE_01 - Deleted wallet is not available
From the following response: Left
( DecodeFailure "Something went wrong" "Error in $: Failed reading: not a valid json value at 'Somethingwentwrong'" )
expected: Status {statusCode = 404, statusMessage = "Not Found"}
but got: Status {statusCode = 500, statusMessage = "Internal Server Error"} |
bors r+ |
Build succeeded: |
iohk-bors
bot
deleted the
jonathanknowles/use-type-parameter-for-utxo-identifier-in-internal-coin-selection-modules
branch
February 25, 2022 19:22
WilliamKingNoel-Bot
pushed a commit
that referenced
this pull request
Feb 25, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Issue Number
ADP-1478
Summary
This PR parameterizes the UTxO identifier type in all modules within the
CoinSelection.Internal
hierarchy.As before, we use the type parameter
u
to represent the type of unique identifiers for individual UTxOs (unspent transaction outputs).In general, callers of coin selection can instantiate
u
to any type for which there is anOrd
instance.Not tackled by this PR
A future PR will update the test suite to use a more general type of UTxO identifier. For now, we continue to generate arbitrary values of
(TxIn, Address)
to act as UTxO identifiers.