-
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
Hash check in transaction build tests #6023
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.
LGTM! A few suggestions.
-- | Adds environment variables to an 'ExecConfig' that may already | ||
-- have some environment variables set. This is done by prepending the new | ||
-- environment variables to the existing ones. | ||
addEnvVarsToConfig :: H.ExecConfig -> [(String, String)] -> H.ExecConfig |
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.
We should modify mkExecConfig
to accept a list of environment variables.
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.
In this case, it is good to have it locally modified though, cause it is only relevant inside the serveFilesWhile
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.
Or we could expose lenses for ExecConfig
for that purpose?
, "--out-file", txbodyFp | ||
-- Create temporary HTTP server with files required by the call to `cardano-cli` | ||
-- In this case, the server emulates an IPFS gateway | ||
serveFilesWhile |
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 does a failure here look like?
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.
serveFilesWhile
doesn't seem to interfere with the output in case of failure, you can see an example here: https://github.com/IntersectMBO/cardano-node/pull/6023/checks?check_run_id=32024584074
Is that what you meant?
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.
That failure is coming from line 127. Can you induce one inside the serveFilesWhile
argument, e.g. in line 186?
@@ -0,0 +1,50 @@ | |||
Preamble | |||
|
|||
We, the zaniest inhabitants of the peculiar and bewildering land of Barataria, in honor of our illustrious Governor, Sancho Panza, renowned for his comically charming ordinances, do hereby present this Constitution to tickle your fancy and uphold the values of laughter, merriment, and the pursuit of hilarity for all our citizens. |
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.
Chat GPT?
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.
No idea, I downloaded it from the shortened link that was there before: https://tinyurl.com/2pahcy6z. It seems an old gist by @carloslodelar. @CarlosLopezDeLara, was that you? do you know the origin of it?
25cd53a
to
7e14eb8
Compare
d641b5f
to
e3fb8f9
Compare
|
||
H.note_ stderrOutput | ||
|
||
H.assert ("Hashes do not match!" `Text.isInfixOf` Text.pack stderrOutput) |
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.
Suggestion: use assertWith
for more verbose failure reporting.
void $ execCli' execConfig | ||
[ eraName, "stake-address", "registration-certificate" | ||
, "--stake-verification-key-file", stakeVkeyFp | ||
, "--key-reg-deposit-amt", show @Int 0 -- TODO: why this needs to be 0???? |
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 can't be 0
now. You can get the right value using:
getKeyDeposit :: (H.MonadAssertion m, MonadTest m, MonadIO m) |
There's a helper function for creating stake key registration certs: https://github.com/IntersectMBO/cardano-node/blob/master/cardano-testnet/src/Testnet/Process/Cli/SPO.hs#L178
execConfig' | ||
[ eraName, "governance", "action", "create-info" | ||
, "--testnet" | ||
, "--governance-action-deposit", show @Int 1_000_000 -- TODO: Get this from the node |
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.
use getMinGovActionDeposit
instead of hardcoding a value
e3fb8f9
to
6aea891
Compare
DO NOT MERGE: Need to remove the SRP stanza
Description
This PR updates tests in
cardano-testnet
to work with the new check of anchor hashes added totransaction build
(see IntersectMBO/cardano-cli#951).Related PRs
transaction build
cardano-cli#951Checklist
See Runnings tests for more details
CHANGELOG.md
for affected package.cabal
files are updatedhlint
. See.github/workflows/check-hlint.yml
to get thehlint
versionstylish-haskell
. See.github/workflows/stylish-haskell.yml
to get thestylish-haskell
versionghc-8.10.7
andghc-9.2.7