Skip to content

Commit

Permalink
cardano-testnet: add golden file for output of query stake-address-info
Browse files Browse the repository at this point in the history
  • Loading branch information
smelc committed Sep 5, 2024
1 parent 51fa20e commit a1cd926
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
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>"
}
]

0 comments on commit a1cd926

Please sign in to comment.