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

Adjust available UTxO to account for collateral inputs #2819

Merged
merged 6 commits into from
Aug 19, 2021

Conversation

jonathanknowles
Copy link
Contributor

@jonathanknowles jonathanknowles commented Aug 11, 2021

Issue Number

ADP-1038

Comments

This PR:

  • adjusts the availableUTxO function to account for collateral inputs.
  • adds property tests for availableUTxO.
  • adds a property test relating availableUTxO to availableBalance.

@jonathanknowles jonathanknowles self-assigned this Aug 11, 2021
@jonathanknowles jonathanknowles force-pushed the jonathanknowles/tx-collateral-inputs branch from 05b8429 to 55a7d0f Compare August 12, 2021 03:13
@jonathanknowles jonathanknowles force-pushed the jonathanknowles/available-utxo-collateral-inputs branch from ab2688d to 65b05c9 Compare August 12, 2021 03:14
@jonathanknowles jonathanknowles force-pushed the jonathanknowles/tx-collateral-inputs branch from 55a7d0f to cd90151 Compare August 12, 2021 03:21
@jonathanknowles jonathanknowles force-pushed the jonathanknowles/available-utxo-collateral-inputs branch 2 times, most recently from 5915731 to 3aa5ae9 Compare August 12, 2021 07:49
@jonathanknowles jonathanknowles force-pushed the jonathanknowles/tx-collateral-inputs branch 2 times, most recently from fd0c082 to 73203d5 Compare August 13, 2021 06:58
Base automatically changed from jonathanknowles/tx-collateral-inputs to master August 16, 2021 06:13
@jonathanknowles jonathanknowles force-pushed the jonathanknowles/available-utxo-collateral-inputs branch 4 times, most recently from 959242d to a7c9034 Compare August 16, 2021 09:42
iohk-bors bot added a commit that referenced this pull request Aug 17, 2021
2829: Rewrite generators to use the QC size parameter r=jonathanknowles a=jonathanknowles

### Issue Number

Follow-up from #2768
Supports work for #2819 

### Comments

This PR adjusts generators for the following types to use the QC size parameter:
- `Address`
- `Hash "Tx"`
- `TxIndex` (`Word32`)
- `TxIn`
- `TxOut`
- `UTxO`
- `UTxOIndex`

Some minor adjustments to coverage conditions were necessary (but surprisingly few).

This PR also:
- Adds the module `UTxO.Gen`, so that we can generate values of `UTxO` without having to generate indices (which add extra overhead), and redefines the `UTxOIndex` generators in terms of these generators.
- Adds the functions `genSized2` and `genSized2With`, which restore size linearity to generators of compound values (those defined in terms of other generators).

Co-authored-by: Jonathan Knowles <[email protected]>
iohk-bors bot added a commit that referenced this pull request Aug 17, 2021
2829: Rewrite generators to use the QC size parameter r=jonathanknowles a=jonathanknowles

### Issue Number

Follow-up from #2768
Supports work for #2819 

### Comments

This PR adjusts generators for the following types to use the QC size parameter:
- `Address`
- `Hash "Tx"`
- `TxIndex` (`Word32`)
- `TxIn`
- `TxOut`
- `UTxO`
- `UTxOIndex`

Some minor adjustments to coverage conditions were necessary (but surprisingly few).

This PR also:
- Adds the module `UTxO.Gen`, so that we can generate values of `UTxO` without having to generate indices (which add extra overhead), and redefines the `UTxOIndex` generators in terms of these generators.
- Adds the functions `genSized2` and `genSized2With`, which restore size linearity to generators of compound values (those defined in terms of other generators).

Co-authored-by: Jonathan Knowles <[email protected]>
@jonathanknowles jonathanknowles force-pushed the jonathanknowles/available-utxo-collateral-inputs branch from a7c9034 to d4c816f Compare August 17, 2021 08:22
@jonathanknowles jonathanknowles changed the base branch from master to jonathanknowles/sized-generators-shrinkers August 17, 2021 08:22
iohk-bors bot added a commit that referenced this pull request Aug 17, 2021
2829: Rewrite generators to use the QC size parameter r=jonathanknowles a=jonathanknowles

### Issue Number

Follow-up from #2768
Supports work for #2819 

### Comments

This PR adjusts generators for the following types to use the QC size parameter:
- `Address`
- `Hash "Tx"`
- `TxIndex` (`Word32`)
- `TxIn`
- `TxOut`
- `UTxO`
- `UTxOIndex`

Some minor adjustments to coverage conditions were necessary (but surprisingly few).

This PR also:
- Adds the module `UTxO.Gen`, so that we can generate values of `UTxO` without having to generate indices (which add extra overhead), and redefines the `UTxOIndex` generators in terms of these generators.
- Adds the functions `genSized2` and `genSized2With`, which restore size linearity to generators of compound values (those defined in terms of other generators).

Co-authored-by: Jonathan Knowles <[email protected]>
Base automatically changed from jonathanknowles/sized-generators-shrinkers to master August 17, 2021 10:08
This commit makes the name of the test consistent with the name of the
property.
@jonathanknowles jonathanknowles force-pushed the jonathanknowles/available-utxo-collateral-inputs branch 3 times, most recently from 0c89302 to fb7f597 Compare August 18, 2021 05:02
@jonathanknowles jonathanknowles force-pushed the jonathanknowles/available-utxo-collateral-inputs branch from fb7f597 to b9565a7 Compare August 18, 2021 06:42
@jonathanknowles jonathanknowles marked this pull request as ready for review August 18, 2021 08:32
@jonathanknowles jonathanknowles force-pushed the jonathanknowles/available-utxo-collateral-inputs branch from 5b2efc7 to 8675453 Compare August 18, 2021 08:40
@@ -128,7 +128,7 @@ spec =
property prop_insert_delete
it "prop_insert_lookup" $
property prop_insert_lookup
it "prop_insert_lookup" $
it "prop_insert_size" $
Copy link
Contributor Author

@jonathanknowles jonathanknowles Aug 18, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I discovered this while making PR #2829, but forgot to include it in that PR.

Copy link
Contributor

@sevanspowell sevanspowell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@jonathanknowles
Copy link
Contributor Author

bors r+

@iohk-bors
Copy link
Contributor

iohk-bors bot commented Aug 19, 2021

Build succeeded:

@iohk-bors iohk-bors bot merged commit e870e5f into master Aug 19, 2021
@iohk-bors iohk-bors bot deleted the jonathanknowles/available-utxo-collateral-inputs branch August 19, 2021 08:02
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