-
Notifications
You must be signed in to change notification settings - Fork 16
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
Add command to calculate plutus script costs from an already constructed transaction #1031
base: master
Are you sure you want to change the base?
Conversation
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.
If you look closely renderScriptCosts
could be refactored to accept Map ScriptWitnessIndex ScriptHash
as a parameter instead of [(ScriptWitnessIndex, AnyScriptWitness era)]
.
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.
Can you add a test case in cardano-testnet
for that command?
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 think this makes --calculate-plutus-script-cost
redundant. We should remove it or mark it as a deprecated and then remove it.
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.
Addressed here: 9548d1d
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.
Nice. I think we should print also a deprecation warning to stderr when using that option.
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.
^^ 👍
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.
Addressed here: 0d54cd9
2a75785
to
34d3d17
Compare
…utusScriptsCosts`
Co-authored-by: Mateusz Galazyn <[email protected]>
34d3d17
to
a639be4
Compare
27052c5
to
4d420e9
Compare
liftIO | ||
$ ( case outputFile of | ||
Just file -> LBS.writeFile (unFile file) | ||
Nothing -> putLByteString |
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.
this should go to stderr
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.
This is normal expected output. Is there a specific reason why you think it should go to stderr?
Co-authored-by: Mateusz Galazyn <[email protected]>
ff8b1b1
to
6debdee
Compare
874c63c
to
0d54cd9
Compare
d80e63d
to
8bd3765
Compare
8bd3765
to
3604f0c
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.
LGTM! Feel free to close this PR and re-open a new one so it is rightly counted as yours.
Oh and clean up the git history please!
Changelog
Context
This is a first step towards addressing this issue: #945.
This PR in
cardano-api
provides the required functionality: IntersectMBO/cardano-api#735. This PR must wait for the functionality in thecardano-api
PR to get in a release, and the source repo stanza must be removed before merging.How to trust this PR
Ensure the untyped bits are correct: serialisation, documentation, and interface design.
Check in conjunction with these PRs:
cardano-api
: Add functioncollectPlutusScriptHashes
to collect script hashes needed to validate a given transaction cardano-api#735cardano-node
: cardano-testnet: Test plutus script cost calculation command cardano-node#6097Checklist