package
0.23.5
Repository: https://github.com/bitweb-project/bted.git
Documentation: pkg.go.dev

# README

fullblocktests

Build Status ISC License GoDoc

Package fullblocktests provides a set of full block tests to be used for testing the consensus validation rules. The tests are intended to be flexible enough to allow both unit-style tests directly against the blockchain code as well as integration style tests over the peer-to-peer network. To achieve that goal, each test contains additional information about the expected result, however that information can be ignored when doing comparison tests between two independent versions over the peer-to-peer network.

This package has intentionally been designed so it can be used as a standalone package for any projects needing to test their implementation against a full set of blocks that exercise the consensus validation rules.

Installation and Updating

$ go get -u github.com/bitweb-project/bted/blockchain/fullblocktests

License

Package fullblocktests is licensed under the copyfree ISC License.

# Functions

Generate returns a slice of tests that can be used to exercise the consensus validation rules.

# Structs

AcceptedBlock defines a test instance that expects a block to be accepted to the blockchain either by extending the main chain, on a side chain, or as an orphan.
ExpectedTip defines a test instance that expects a block to be the current tip of the main chain.
OrphanOrRejectedBlock defines a test instance that expects a block to either be accepted as an orphan or rejected.
RejectedBlock defines a test instance that expects a block to be rejected by the blockchain consensus rules.
RejectedNonCanonicalBlock defines a test instance that expects a serialized block that is not canonical and therefore should be rejected.

# Interfaces

TestInstance is an interface that describes a specific test instance returned by the tests generated in this package.