@@ -17,6 +17,7 @@ import Cardano.Api
17
17
import qualified Cardano.Api.Genesis as Api
18
18
import Cardano.Api.Ledger (Coin (Coin ), EpochInterval (EpochInterval ), StandardCrypto ,
19
19
extractHash , unboundRational )
20
+ import qualified Cardano.Api.Ledger as L
20
21
import Cardano.Api.Shelley (StakeCredential (StakeCredentialByKey ), StakePoolKey )
21
22
22
23
import Cardano.CLI.Types.Key (VerificationKeyOrFile (VerificationKeyFilePath ),
@@ -385,9 +386,18 @@ hprop_cli_queries = integrationWorkspace "cli-queries" $ \tempAbsBasePath' -> H.
385
386
drepStateRedactedOutFile
386
387
" test/cardano-testnet-test/files/golden/queries/drepStateOut.json"
387
388
388
- TestQueryDRepStakeDistributionCmd ->
389
+ TestQueryDRepStakeDistributionCmd -> do
389
390
-- drep-stake-distribution
390
- H. noteM_ $ execCli' execConfig [ eraName, " query" , " drep-stake-distribution" , " --all-dreps" ]
391
+ -- to stdout
392
+ drepStakeDistribution :: [(L. DRep StandardCrypto , L. Coin )] <- H. noteShowM $ execCliStdoutToJson execConfig [ eraName, " query" , " drep-stake-distribution" , " --all-dreps" ]
393
+
394
+ -- TODO: we could check that the Coin amount below is the one reported
395
+ -- by query stake-address-info
396
+
397
+ H. assertWith drepStakeDistribution $ \ dreps ->
398
+ length dreps == 3 -- Because, by default, 3 DReps are created
399
+
400
+ forM_ drepStakeDistribution $ \ (_drep, coin) -> Coin 15_000_003_000_000 H. === coin
391
401
392
402
TestQueryCommitteeMembersStateCmd ->
393
403
-- committee-state
@@ -491,4 +501,4 @@ redactJsonFields changes v =
491
501
Aeson. Array $ Vector. map recurse vector
492
502
_ -> v
493
503
where
494
- recurse = redactJsonFields changes
504
+ recurse = redactJsonFields changes
0 commit comments