Documentation
¶
Index ¶
- func FixedStandardTx(t *testing.T, seed uint64) transactions.Transaction
- func RandomBidTx(t *testing.T, malformed bool) (*transactions.Bid, error)
- func RandomBlock(t *testing.T, height uint64, txBatchCount uint16) *block.Block
- func RandomCertificate(t *testing.T) *block.Certificate
- func RandomCoinBaseTx(t *testing.T, malformed bool) *transactions.Coinbase
- func RandomHeader(t *testing.T, height uint64) *block.Header
- func RandomInput(t *testing.T) *transactions.Input
- func RandomInputs(t *testing.T, size int) transactions.Inputs
- func RandomOutput(t *testing.T) *transactions.Output
- func RandomOutputs(t *testing.T, size int) transactions.Outputs
- func RandomSlice(t *testing.T, size uint32) []byte
- func RandomSliceOfTxs(t *testing.T, txsBatchCount uint16) []transactions.Transaction
- func RandomStakeTx(t *testing.T, malformed bool) (*transactions.Stake, error)
- func RandomStandardTx(t *testing.T, malformed bool) *transactions.Standard
- func RandomTLockTx(t *testing.T, malformed bool) *transactions.Timelock
- func StartPeerReader(conn net.Conn, bus *eventbus.EventBus, rpcBus *rpcbus.RPCBus, ...) (*peer.Reader, error)
- func TwoLinkedBlocks(t *testing.T) (*block.Block, *block.Block)
- func TxsToBuffer(t *testing.T, txs []transactions.Transaction) *bytes.Buffer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FixedStandardTx ¶ added in v0.2.0
func FixedStandardTx(t *testing.T, seed uint64) transactions.Transaction
FixedStandardTx generates an encodable standard Tx with 1 input and 1 output It guarantees that for one seed the same standard Tx (incl. TxID) is always generated.
func RandomBidTx ¶
RandomBidTx returns a random bid transaction for testing
func RandomBlock ¶
RandomBlock returns a random block for testing. For `height` see also helper.RandomHeader For txBatchCount see also helper.RandomSliceOfTxs
func RandomCertificate ¶
func RandomCertificate(t *testing.T) *block.Certificate
RandomCertificate returns a random block certificate for testing
func RandomCoinBaseTx ¶
func RandomCoinBaseTx(t *testing.T, malformed bool) *transactions.Coinbase
RandomCoinBaseTx returns a random coinbase transaction for testing
func RandomHeader ¶
RandomHeader returns a random header for testing. `height` randomness is up to the caller. A global atomic counter per pkg can handle it
func RandomInput ¶
func RandomInput(t *testing.T) *transactions.Input
RandomInput returns a random input for testing
func RandomInputs ¶
func RandomInputs(t *testing.T, size int) transactions.Inputs
RandomInputs returns a slice of inputs of size `size` for testing
func RandomOutput ¶
func RandomOutput(t *testing.T) *transactions.Output
RandomOutput returns a random output for testing
func RandomOutputs ¶
func RandomOutputs(t *testing.T, size int) transactions.Outputs
RandomOutputs returns a slice of random outputs for testing
func RandomSlice ¶
RandomSlice returns a random slice of size `size`
func RandomSliceOfTxs ¶
func RandomSliceOfTxs(t *testing.T, txsBatchCount uint16) []transactions.Transaction
RandomSliceOfTxs returns a random slice of transactions for testing Each tx batch represents all 4 non-coinbase tx types
func RandomStakeTx ¶
RandomStakeTx returns a random stake tx for testing
func RandomStandardTx ¶
func RandomStandardTx(t *testing.T, malformed bool) *transactions.Standard
RandomStandardTx returns a random standard tx for testing
func RandomTLockTx ¶
func RandomTLockTx(t *testing.T, malformed bool) *transactions.Timelock
RandomTLockTx returns a random timelock transaction for testing
func StartPeerReader ¶
func TwoLinkedBlocks ¶
TwoLinkedBlocks returns two blocks that are linked via their headers
func TxsToBuffer ¶ added in v0.2.0
func TxsToBuffer(t *testing.T, txs []transactions.Transaction) *bytes.Buffer
TxsToBuffer converts a slice of transactions to a bytes.Buffer.
Types ¶
This section is empty.