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

More exhaustive golden tests for Node-to-Client queries #167

Open
amesgen opened this issue Jun 20, 2023 · 0 comments
Open

More exhaustive golden tests for Node-to-Client queries #167

amesgen opened this issue Jun 20, 2023 · 0 comments

Comments

@amesgen
Copy link
Member

amesgen commented Jun 20, 2023

Currently, we have golden tests for some, but not all queries (both the encoded query and result messages):

queries = labelled [
("GetLedgerTip", SomeSecond GetLedgerTip)
, ("GetEpochNo", SomeSecond GetEpochNo)
, ("GetCurrentPParams", SomeSecond GetCurrentPParams)
, ("GetProposedPParamsUpdates", SomeSecond GetProposedPParamsUpdates)
, ("GetStakeDistribution", SomeSecond GetStakeDistribution)
, ("GetNonMyopicMemberRewards", SomeSecond $ GetNonMyopicMemberRewards sleRewardsCredentials)
, ("GetGenesisConfig", SomeSecond GetGenesisConfig)
]
results = labelled [
("LedgerTip", SomeResult GetLedgerTip (blockPoint blk))
, ("EpochNo", SomeResult GetEpochNo 10)
, ("EmptyPParams", SomeResult GetCurrentPParams srePParams)
, ("ProposedPParamsUpdates", SomeResult GetProposedPParamsUpdates sreProposedPPUpdates)
, ("StakeDistribution", SomeResult GetStakeDistribution srePoolDistr)
, ("NonMyopicMemberRewards", SomeResult (GetNonMyopicMemberRewards Set.empty)
(NonMyopicMemberRewards $ sreNonMyopicRewards))
, ("GenesisConfig", SomeResult GetGenesisConfig (compactGenesis sreShelleyGenesis))
]

The goal of this ticket is to extend this:

  • Add golden tests for all queries, which also includes adding necessary examples for ledger types to Ledger.
  • Make sure that the existing examples are sufficiently interesting; e.g. the example PoolDistr used for GetStakeDistribution has only one entry, which means that we couldn't notice that a recent Ledger update changed the encoding for maps with more than 23 elements.
  • Add regressions specific to PR Make Conway query constructors ill-typed in pre-Conway eras #922: check that Conway queries are decoder failures for era before Conway.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants