testutil

package
v0.1.8-alpha.4 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2019 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeBlock

func MakeBlock(bc types.Blockchain, ch types.Chainer, sender, receiver *crypto.Key) types.Block

MakeBlock creates a block

func MakeBlockWithParentHash

func MakeBlockWithParentHash(bc types.Blockchain, ch types.Chainer, sender *crypto.Key,
	parentHash util.Hash) types.Block

MakeBlockWithParentHash creates a block with one balance transaction and a given parent block hash

func MakeBlockWithTDAndNonce

func MakeBlockWithTDAndNonce(bc types.Blockchain, ch types.Chainer, sender *crypto.Key,
	senderNonce uint64, td *big.Int) types.Block

MakeBlockWithTDAndNonce creates a block with one transaction, a given total difficulty and sender tx nonce

func MakeBlockWithTotalDifficulty

func MakeBlockWithTotalDifficulty(bc types.Blockchain, ch types.Chainer, sender *crypto.Key,
	td *big.Int) types.Block

MakeBlockWithTotalDifficulty creates a block with one balance transaction and a given total difficulty

func MakeBlockWithTx

func MakeBlockWithTx(bc types.Blockchain, ch types.Chainer, sender *crypto.Key,
	senderNonce uint64) types.Block

MakeBlockWithTx creates a block with only one balance transaction. The sender param is used as the transaction sender and receiver. The sender nonce must be consistent with the provided chain.

func MakeBlockWithTxAndReceiver

func MakeBlockWithTxAndReceiver(bc types.Blockchain, ch types.Chainer, sender, receiver *crypto.Key,
	senderNonce uint64) types.Block

MakeBlockWithTxAndReceiver is like MakeBlockWithTx but it also accepts a receiver address.

func MakeBlockWithTxAndTime

func MakeBlockWithTxAndTime(bc types.Blockchain, ch types.Chainer, sender *crypto.Key,
	senderNonce uint64, blockTime int64) types.Block

MakeBlockWithTxAndTime creates a block with only one balance transaction. It overrides the block time using blockTime. The sender nonce must be consistent with the provided chain.

func MakeBlockWithTxNotInPool

func MakeBlockWithTxNotInPool(bc types.Blockchain, ch types.Chainer,
	sender *crypto.Key) types.Block

MakeBlockWithTxNotInPool is like MakeBlockWithTx but does not add the transactions in the pool

func MakeTestBlock

func MakeTestBlock(bc types.Blockchain, chain types.Chainer,
	gp *types.GenerateBlockParams) types.Block

MakeTestBlock creates a block and adds the transactions in the transactions pool attached to the blockchain instance

Types

This section is empty.

Jump to

Keyboard shortcuts

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