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: test value delegated to dreps in test of drep-stake-distribution #5961

Merged
merged 1 commit into from
Sep 4, 2024
Merged
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 @@ -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
Loading