IntersectMBO / IntersectMBO/ouroboros-consensus

Make golden tests easier to interpret

Open
#685 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Haskell
Stars
67
Forks
43
Avg merge
5d 13h
Merged PRs (30d)
43

Description

The consensus types that have golden tests contain types from `cardano-ledger` and `cardano-ledger-specs` (in a nested fashion). Maintaining compatibility for the ledger types is not directly our responsibility, but since we actually store them on disk and send them across the network, we have golden tests that test them.

Idea: instead of writing down the expected CBOR for those types, write the expected hash for the corresponding bytestring. This makes it more obvious that these types are not our responsibility and that our tests does not focus on them, but we still keep a basic check that they haven't accidentally changed.

Also, some golden tests mention the same type: the block contains the header, `ExtLedgerState` contains `LedgerState`, etc. By using variables in the expected CBOR, these connections would be clearer.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.