Skip to content

Commit

Permalink
Merge pull request #5961 from IntersectMBO/smelc/check-query-drep-sta…
Browse files Browse the repository at this point in the history
…ke-distribution-value

cardano-testnet: test value delegated to dreps in test of drep-stake-distribution
  • Loading branch information
smelc authored Sep 4, 2024
2 parents d113bdc + de5e092 commit 602d5ec
Showing 1 changed file with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down Expand Up @@ -385,9 +386,18 @@ 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

H.assertWith drepStakeDistribution $ \dreps ->
length dreps == 3 -- Because, by default, 3 DReps are created

forM_ drepStakeDistribution $ \(_drep, coin) -> Coin 15_000_003_000_000 H.=== coin

TestQueryCommitteeMembersStateCmd ->
-- committee-state
Expand Down Expand Up @@ -491,4 +501,4 @@ redactJsonFields changes v =
Aeson.Array $ Vector.map recurse vector
_ -> v
where
recurse = redactJsonFields changes
recurse = redactJsonFields changes

0 comments on commit 602d5ec

Please sign in to comment.