prottest

package
v0.0.0-...-59fa258 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 26, 2016 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Overview

Package prottest provides utilities for Chain Protocol testing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeBlock

func MakeBlock(tb testing.TB, c *protocol.Chain) *bc.Block

MakeBlock makes a new block from the pool in c, commits it, and returns it. It assumes c's consensus program requires 0 signatures. (This is true for chains returned by NewChain.) If c requires more than 0 signatures, MakeBlock will fail. MakeBlock always makes a block; if there are no transactions in the pool, it makes an empty block.

func NewChain

func NewChain(tb testing.TB) *protocol.Chain

NewChain makes a new Chain using memstore and mempool for storage, along with an initial block using a 0/0 multisig program. It commits the initial block before returning the Chain.

func NewChainWithStorage

func NewChainWithStorage(tb testing.TB, store protocol.Store, pool protocol.Pool) *protocol.Chain

NewChainWithStorage makes a new Chain using store and pool for storage, along with an initial block using a 0/0 multisig program. It commits the initial block before returning the Chain.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL