helper

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RandomBLSSignature added in v0.4.0

func RandomBLSSignature() []byte

RandomBLSSignature returns a valid BLS Signature of a bogus message.

func RandomBlock

func RandomBlock(height uint64, txBatchCount uint16) *block.Block

RandomBlock returns a random block for testing. For `height` see also helper.RandomHeader. For txBatchCount see also helper.RandomSliceOfTxs.

func RandomCertificate

func RandomCertificate() *block.Certificate

RandomCertificate returns a random block certificate for testing.

func RandomHeader

func RandomHeader(height uint64) *block.Header

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) []byte

RandomInput returns a random input for testing.

func RandomInputs

func RandomInputs(t *testing.T, size int) [][]byte

RandomInputs returns a slice of inputs of size `size` for testing.

func RandomOutput

func RandomOutput(t *testing.T) *transactions.Note

RandomOutput returns a random output for testing.

func RandomOutputs

func RandomOutputs(t *testing.T, size int) []*transactions.Note

RandomOutputs returns a slice of random outputs for testing.

func RandomSlice

func RandomSlice(size uint32) []byte

RandomSlice returns a random slice of size `size`.

func TwoLinkedBlocks

func TwoLinkedBlocks(t *testing.T) (*block.Block, *block.Block)

TwoLinkedBlocks returns two blocks that are linked via their headers.

func TxsToBuffer added in v0.2.0

func TxsToBuffer(t *testing.T, txs []transactions.ContractCall) *bytes.Buffer

TxsToBuffer converts a slice of transactions to a bytes.Buffer.

Types

This section is empty.

Jump to

Keyboard shortcuts

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