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

cardano-testnet: make call to query stake-address-info a golden test #5970

Merged
merged 1 commit into from
Sep 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -269,12 +269,28 @@ hprop_cli_queries = integrationWorkspace "cli-queries" $ \tempAbsBasePath' -> H.
TestQueryStakeAddressInfoCmd ->
-- stake-address-info
do
-- to stdout
let delegatorKeys = Defaults.defaultDelegatorStakeKeyPair 1
delegatorVKey :: VerificationKey StakeKey <- readVerificationKeyFromFile AsStakeKey work $ verificationKey delegatorKeys
let stakeAddress :: StakeAddress = verificationStakeKeyToStakeAddress testnetMagic delegatorVKey
H.noteM_ $ execCli' execConfig [ eraName, "query", "stake-address-info"
, "--address", T.unpack $ serialiseAddress stakeAddress
]
-- to a file
let stakeAddressInfoOutFile = work </> "stake-address-info-out.json"
redactedStakeAddressInfoOutFile = work </> "stake-address-info-out-redacted.json"
H.noteM_ $ execCli' execConfig [ eraName, "query", "stake-address-info"
, "--address", T.unpack $ serialiseAddress stakeAddress
, "--out-file", stakeAddressInfoOutFile
]

redactJsonFieldsInFile
(fromList (map (, "<redacted>") ["address", "stakeDelegation", "voteDelegation"]))
stakeAddressInfoOutFile
redactedStakeAddressInfoOutFile
H.diffFileVsGoldenFile
redactedStakeAddressInfoOutFile
"test/cardano-testnet-test/files/golden/queries/stakeAddressInfoOut.json"

TestQueryUTxOCmd ->
-- utxo
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[
{
"address": "<redacted>",
"delegationDeposit": 0,
"rewardAccountBalance": 0,
"stakeDelegation": "<redacted>",
"voteDelegation": "<redacted>"
}
]
Loading