Skip to content
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

Generalize UTxO identifier type within UTxOSelection. #3155

Conversation

jonathanknowles
Copy link
Member

@jonathanknowles jonathanknowles commented Feb 24, 2022

Issue Number

ADP-1450

Background

Within coin selection modules, we are steadily replacing all uses of TxIn, Address, TxOut with type parameters, so that the coin selection library does not depend on these concrete wallet types.

Summary

This PR replaces all uses of InputId (a temporary type synonym introduced in #3149) with a type parameter within module UTxOSelection.

We use the following convention for type parameters and identifier names:

  • u represents a unique identifier for an individual UTxO (unspent transaction output).
  • s represents a selection of type UTxOSelection.
  • b represents a TokenBundle value.
  • i represents an index of type UTxOIndex.

@jonathanknowles jonathanknowles self-assigned this Feb 24, 2022
Base automatically changed from jonathanknowles/coin-selection-compound-input-id to master February 24, 2022 08:31
We eventually intend to use `u` as a type parameter that represents
unique UTxO identifiers.

So using `s` as a type parameter to represent a type of selection makes
sense here.
The `UTxOSelection` module already uses the term "UTxO" to refer to a
single UTxO (single unspent transaction output).

We no longer depend on the wallet's `UTxO` type here, and since these
functions both return values of type `Map`, we can avoid ambiguity by
using the term `Map` in the names of these functions.
We use the following convention for identifier names:

  - `s` represents a selection of type `UTxOSelection`.
  - `u` represents a unique identifier for an individual UTxO (unspent
        transaction output).
  - `b` represents a `TokenBundle` value.
  - `i` represents an index of type `UTxOIndex`.
@jonathanknowles jonathanknowles force-pushed the jonathanknowles/use-type-parameter-for-utxo-identifier-in-utxo-selection branch from 9f390c0 to d75a860 Compare February 24, 2022 08:42
@jonathanknowles
Copy link
Member Author

bors r+

iohk-bors bot added a commit that referenced this pull request Feb 24, 2022
3155: Generalize UTxO identifier type within `UTxOSelection`. r=jonathanknowles a=jonathanknowles

## Issue Number

ADP-1450

## Background

Within coin selection modules, we are steadily replacing all uses of `TxIn`, `Address`, `TxOut` with type parameters, so that the coin selection library does not depend on these concrete wallet types.

## Summary

This PR replaces all uses of `InputId` (a temporary type synonym introduced in #3149) with a type parameter within module `UTxOSelection`.

We use the following convention for type parameters and identifier names:
- `u` represents a unique identifier for an individual UTxO (unspent transaction output).
- `s` represents a selection of type `UTxOSelection`.
- `b` represents a `TokenBundle` value.
- `i` represents an index of type `UTxOIndex`.


Co-authored-by: Jonathan Knowles <[email protected]>
@iohk-bors
Copy link
Contributor

iohk-bors bot commented Feb 24, 2022

Build failed:

Looks like the "Check Cabal Configure" stage failed:

Cabal update
/nix/store/ad9x92nd4fhckfkxyvvb6jx8v7j0wz36-cabal-install-exe-cabal-3.4.0.0/bin/cabal --project-file=/var/lib/buildkite-agent-iohk/builds/packet-ipxe-2-ci2-1/input-output-hk/cardano-wallet/.nix-shell-cabal.project update
Downloading the latest package list from hackage.haskell.org
cabal: Could not read index. Did you call 'checkForUpdates'?
🚨 Error: The command exited with status 1

@Anviking
Copy link
Member

bors r+

iohk-bors bot added a commit that referenced this pull request Feb 24, 2022
3155: Generalize UTxO identifier type within `UTxOSelection`. r=Anviking a=jonathanknowles

## Issue Number

ADP-1450

## Background

Within coin selection modules, we are steadily replacing all uses of `TxIn`, `Address`, `TxOut` with type parameters, so that the coin selection library does not depend on these concrete wallet types.

## Summary

This PR replaces all uses of `InputId` (a temporary type synonym introduced in #3149) with a type parameter within module `UTxOSelection`.

We use the following convention for type parameters and identifier names:
- `u` represents a unique identifier for an individual UTxO (unspent transaction output).
- `s` represents a selection of type `UTxOSelection`.
- `b` represents a `TokenBundle` value.
- `i` represents an index of type `UTxOIndex`.


Co-authored-by: Jonathan Knowles <[email protected]>
@iohk-bors
Copy link
Contributor

iohk-bors bot commented Feb 24, 2022

Build failed:

Another "Check Cabal Configure" failure:

Downloading the latest package list from hackage.haskell.org
cabal: Could not read index. Did you call 'checkForUpdates'?
🚨 Error: The command exited with status 1
user command error: exit status 1

@jonathanknowles
Copy link
Member Author

bors r+

iohk-bors bot added a commit that referenced this pull request Feb 24, 2022
3155: Generalize UTxO identifier type within `UTxOSelection`. r=jonathanknowles a=jonathanknowles

## Issue Number

ADP-1450

## Background

Within coin selection modules, we are steadily replacing all uses of `TxIn`, `Address`, `TxOut` with type parameters, so that the coin selection library does not depend on these concrete wallet types.

## Summary

This PR replaces all uses of `InputId` (a temporary type synonym introduced in #3149) with a type parameter within module `UTxOSelection`.

We use the following convention for type parameters and identifier names:
- `u` represents a unique identifier for an individual UTxO (unspent transaction output).
- `s` represents a selection of type `UTxOSelection`.
- `b` represents a `TokenBundle` value.
- `i` represents an index of type `UTxOIndex`.


Co-authored-by: Jonathan Knowles <[email protected]>
@iohk-bors
Copy link
Contributor

iohk-bors bot commented Feb 25, 2022

Build failed:

So the "Check Cabal Configure" stage failed, but it succeeds if it's run a second time.

@jonathanknowles
Copy link
Member Author

bors r+

@iohk-bors
Copy link
Contributor

iohk-bors bot commented Feb 25, 2022

Build succeeded:

@iohk-bors iohk-bors bot merged commit 3ecad89 into master Feb 25, 2022
@iohk-bors iohk-bors bot deleted the jonathanknowles/use-type-parameter-for-utxo-identifier-in-utxo-selection branch February 25, 2022 03: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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants