Documentation
¶
Overview ¶
Package goldentest holds the helpers a package's tests share when they check themselves against a committed test vector: a fixed test key, hex and transaction parsing that fail the test rather than return an error, and a chain tracker that knows only the roots the test hands it.
It carries no vector of its own. Each application keeps its vector, and the code that finds and reads it, in its own tree: a path resolved from this package's source file would point into the module cache once the package is imported from there.
It is a test helper that happens to live outside a _test file so that several packages can share it; no binary should import it.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FixedKey ¶
func FixedKey() *ec.PrivateKey
FixedKey is the TEST key vectors are generated from, fixed so that regenerating one reproduces it byte for byte. It must never be used for anything real: it is 32 bytes of 0x42.
func Tx ¶
func Tx(t testing.TB, s string) *transaction.Transaction
Tx parses a transaction from hex or fails the test.
Types ¶
type Tracker ¶
Tracker is a chain tracker that knows exactly the roots it was given, so a test proves a BUMP against a root it chose rather than against anything live. Any other height, and a nil root, answers (false, nil), as a header client answers a height it holds no header for: a test of an unproven parent then meets "not proven", not an error that would take a different refusal path.