Home / Input Output / ouroboros-network
116 commits this week Dec 06, 2019 - Dec 13, 2019

Merge #1337

1337: test-consensus: refactor PBft ChainState tests r=nfrisby a=nfrisby

This is a follow-up to PR #1317. That added EBBs to the PBFT chain state and to the corresponding property tests. This PR is a more thorough update of those tests: it’s clearer code and improves coverage some.

It’s a pretty big diff. Several of the properties are essentially the same. The generator is also essentially the same, but it’s more principled and better documented by the Haddock on the data type being generated. In particular, it almost exclusively relies on only two splitting functions (from the new Test.Util.Split module) instead of various takes, drops, filters, reverses, etc.

Co-authored-by: Nicolas Frisby [email protected]

Merge #1337

1337: test-consensus: refactor PBft ChainState tests r=nfrisby a=nfrisby

This is a follow-up to PR #1317. That added EBBs to the PBFT chain state and to the corresponding property tests. This PR is a more thorough update of those tests: it’s clearer code and improves coverage some.

It’s a pretty big diff. Several of the properties are essentially the same. The generator is also essentially the same, but it’s more principled and better documented by the Haddock on the data type being generated. In particular, it almost exclusively relies on only two splitting functions (from the new Test.Util.Split module) instead of various takes, drops, filters, reverses, etc.

Co-authored-by: Nicolas Frisby [email protected]

ChainDB: add a header envelope

If we extract the bytes corresponding to the header from a Byron block, we won’t be able to decode it as a header straightaway, as the CBOR listLen and tag are missing from the front. Therefore, we introduce nodeAddHeaderEnvelope to transform the extracted header bytes into a bytestring that can be decoded as a header. We pass it to the ChainDB (ImmDB and VolDB), which will be responsible (future commit) for adding this header envelope to any headers extracted directly from binary blocks.