Skip to content

Commit

Permalink
cardano-testnet: test value delegated to dreps in test of drep-stake-…
Browse files Browse the repository at this point in the history
…distribution
  • Loading branch information
smelc committed Aug 26, 2024
1 parent fecf2bf commit 9547c48
Showing 1 changed file with 10 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 @@ -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)

Check warning on line 362 in cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/Query.hs

View workflow job for this annotation

GitHub Actions / build

Suggestion in hprop_cli_queries in module Cardano.Testnet.Test.Cli.Query: Redundant bracket ▫︎ Found: "coin H.=== (Coin 300_000_000_000)" ▫︎ Perhaps: "coin H.=== Coin 300_000_000_000"

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

0 comments on commit 9547c48

Please sign in to comment.