-
Notifications
You must be signed in to change notification settings - Fork 720
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
Update build command to automatically calculate the total and return collateral values #4198
Update build command to automatically calculate the total and return collateral values #4198
Conversation
cardano-api/src/Cardano/Api/Fees.hs
Outdated
$ reqAmt % 100 | ||
enoughCollateral = totalCollateralLovelace * 100 >= requiredCollateral | ||
Lovelace amt = totalCollateralLovelace * 100 - requiredCollateral | ||
returnCollateral = fromShelleyLovelace . Ledger.rationalToCoinViaCeiling $ amt % 100 |
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.
What's the 100
factor for?
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.
I updated the comments in the code
(TxReturnCollateralNone,tc@TxTotalCollateral{}) -> (dummyRetCol, tc) | ||
(TxReturnCollateralNone, TxTotalCollateralNone) -> (dummyRetCol, dummyTotCol) | ||
|
||
calcReturnAndTotalCollateral |
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.
Please add docs and links to any supporting documentation.
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.
Updated comments in the code
Can you paste/attach the commands/files you used to test? |
b9ac31e
to
4f92308
Compare
Removing the fields:
from the shell script |
00dbc14
to
1b9da84
Compare
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.
The PR pass in all our regression tests related to plutus V2.
Also new tests was added to comprove that the collateral amount charged are accorging to the collateral percentage present in protocol parameters and that the change address is now the default address to return the excess of the collaterals amount.
Related issue on cardano-node-tests:
IntersectMBO/cardano-node-tests#1265
1b9da84
to
102be57
Compare
collateral values when they are not explicitly specified via the cli
102be57
to
74a81ac
Compare
bors r+ |
Build succeeded: |
The build command will now automatically calculate these values and returns the excess collateral to the change address
Resolves: #4075