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

feat: balance tx fails fast on txcoll or collRet #3343

Merged
merged 1 commit into from
Jun 24, 2022

Conversation

Unisay
Copy link
Contributor

@Unisay Unisay commented Jun 20, 2022

balanceTransaction fails gracefully if Tx body contains either total collateral attribute or collateral return outputs attribute.

Issue Number

ADP-1653

Copy link
Member

@Anviking Anviking left a comment

Choose a reason for hiding this comment

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

Neat!

For testing I think it would be very nice if we could:

  1. make prop_balanceTransactionValid run in both Alonzo and Babbage which would be valuable irrespective of this task. I think and hope this is not that complicated.

  2. Generate a tiny amount of totalCollateral and returnCollateral in https://github.com/input-output-hk/cardano-wallet/blob/f5cff1c23260c6985f9007b0b5ac8fb29be631ae/lib/core/src/Cardano/Api/Gen.hs#L1335-L1337

And actually, we could then perhaps add some checks here to mimic the ledger rules

Skärmavbild 2022-06-20 kl  12 47 33

to make the tests fail unless we have guardExisting{Return, Total}Collateral .

lib/core/src/Cardano/Wallet/Api/Server.hs Outdated Show resolved Hide resolved
lib/core/src/Cardano/Wallet/Api/Server.hs Outdated Show resolved Hide resolved
Copy link
Member

@jonathanknowles jonathanknowles left a comment

Choose a reason for hiding this comment

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

Hi @Unisay

Thanks for making this PR! I've left a few suggestions and comments.

lib/core/src/Cardano/Wallet/Api/Server.hs Outdated Show resolved Hide resolved
lib/core/src/Cardano/Wallet/Api/Server.hs Outdated Show resolved Hide resolved
@Unisay Unisay force-pushed the yura/ADP-1653/fail-fast branch 3 times, most recently from a0d8556 to 4fa7e55 Compare June 23, 2022 12:19
Copy link
Member

@Anviking Anviking left a comment

Choose a reason for hiding this comment

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

Thanks a lot, LGTM! As discussed it would be cool to extend prop_balanceTransactionValid with the collateral rules for a "higher level" property, but we don't have to do that now.

But I would like ask to split up at least the swagger-reformatting into a separate commit before merging (see comments).

specifications/api/swagger.yaml Show resolved Hide resolved
specifications/api/swagger.yaml Outdated Show resolved Hide resolved
lib/core/src/Cardano/Wallet/Api/Server.hs Outdated Show resolved Hide resolved
@Unisay
Copy link
Contributor Author

Unisay commented Jun 24, 2022

bors r+

@iohk-bors
Copy link
Contributor

iohk-bors bot commented Jun 24, 2022

Build succeeded:

@iohk-bors iohk-bors bot merged commit b0b5f8c into master Jun 24, 2022
@iohk-bors iohk-bors bot deleted the yura/ADP-1653/fail-fast branch June 24, 2022 08:55
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.

3 participants