diff --git a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/Query.hs b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/Query.hs index 6355eb188c1..a57847e2565 100644 --- a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/Query.hs +++ b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/Query.hs @@ -17,6 +17,7 @@ import Cardano.Api import qualified Cardano.Api.Genesis as Api import Cardano.Api.Ledger (Coin (Coin), EpochInterval (EpochInterval), StandardCrypto, extractHash, unboundRational) +import qualified Cardano.Api.Ledger as L import Cardano.Api.Shelley (StakeCredential (StakeCredentialByKey), StakePoolKey) import Cardano.CLI.Types.Key (VerificationKeyOrFile (VerificationKeyFilePath), @@ -350,9 +351,15 @@ hprop_cli_queries = integrationWorkspace "cli-queries" $ \tempAbsBasePath' -> H. drepStateRedactedOutFile "test/cardano-testnet-test/files/golden/queries/drepStateOut.json" - TestQueryDRepStakeDistributionCmd -> + TestQueryDRepStakeDistributionCmd -> do -- drep-stake-distribution - H.noteM_ $ execCli' execConfig [ eraName, "query", "drep-stake-distribution", "--all-dreps" ] + -- to stdout + drepStakeDistribution :: [(L.DRep StandardCrypto, L.Coin)] <- H.noteShowM $ execCliStdoutToJson execConfig [ eraName, "query", "drep-stake-distribution", "--all-dreps" ] + + -- TODO: we could check that the Coin amount below is the one reported + -- by query stake-address-info + + forM_ drepStakeDistribution $ \(_drep, coin) -> coin H.=== (Coin 300_000_000_000) TestQueryCommitteeMembersStateCmd -> -- committee-state @@ -459,4 +466,4 @@ redactJsonFields changes v = Aeson.Array $ Vector.map recurse vector _ -> v where - recurse = redactJsonFields changes + recurse = redactJsonFields changes \ No newline at end of file