IntersectMBO / cardano-ledger

The ledger implementation and specifications of the Cardano blockchain.
Apache License 2.0
256 stars 158 forks source link

Make Shelley test examples concrete #3117

Open Soupstraw opened 1 year ago

Soupstraw commented 1 year ago

Currently the functions in Shelley examples are parametrized by era even though the only valid instantiation of these era parameters is ShelleyEra C_Crypt. We should make these signatures concrete so that we don't have to thread constraints through the test libraries like in #3045.

If there are functions that can be used across eras, then we should move those into generic tests in cardano-ledger-test.

lehins commented 1 year ago

I think it would be better for all tests that are expected to run in other eras to be converted into era agnostic with the help of lenses and era agnostic constructors

lehins commented 1 year ago

If there are functions that can be used across eras, then we should move those into generic tests in cardano-ledger-test.

Let's hold off on that. I am afraid if we start moving everything in cardano-ledger-tests it will explode beyond comprehension

A better approach IMHO would be to make those tests era agnostic and make sure they are executed in test suites for all subsequent individual eras

Soupstraw commented 1 year ago

There's also the smaller sub-task of looking at the Shelley tests and seeing what cannot be generalized and make that concrete. I think that's something that could be done without disrupting the rest of the codebase too much.