Documentation ¶
Index ¶
- func IDGen(sid string) (id types.BlockID)
- func RBlock(id types.BlockID, opts ...RBlockOpt) result.Block
- func RLayer(lid types.LayerID, blocks ...result.Block) result.Layer
- func RLayerNonFinal(lid types.LayerID, blocks ...result.Block) result.Layer
- func RLayers(layers ...result.Layer) []result.Layer
- func ROpinion(lid types.LayerID, opinion types.Hash32, blocks ...result.Block) result.Layer
- type AtxsGenerator
- type RBlockOpt
- type TransactionResultGenerator
- func (g *TransactionResultGenerator) Next() *types.TransactionWithResult
- func (g *TransactionResultGenerator) WithAddresses(n int) *TransactionResultGenerator
- func (g *TransactionResultGenerator) WithBlocks(n int) *TransactionResultGenerator
- func (g *TransactionResultGenerator) WithLayers(start, n int) *TransactionResultGenerator
- func (g *TransactionResultGenerator) WithSeed(seed int64) *TransactionResultGenerator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AtxsGenerator ¶ added in v1.4.0
type AtxsGenerator struct { Epochs []types.EpochID Addrs []types.Address // contains filtered or unexported fields }
AtxsGenerator generates random activations. Activations are not syntactically or contextually valid. This is for testing databases and APIs.
func NewAtxsGenerator ¶ added in v1.4.0
func NewAtxsGenerator() *AtxsGenerator
NewAtxsGenerator with some random parameters.
func (*AtxsGenerator) Next ¶ added in v1.4.0
func (g *AtxsGenerator) Next() *types.VerifiedActivationTx
Next generates VerifiedActivationTx.
func (*AtxsGenerator) WithEpochs ¶ added in v1.4.0
func (g *AtxsGenerator) WithEpochs(start, n int) *AtxsGenerator
WithEpochs update epochs ids.
func (*AtxsGenerator) WithSeed ¶ added in v1.4.0
func (g *AtxsGenerator) WithSeed(seed int64) *AtxsGenerator
WithSeed update randomness source.
type TransactionResultGenerator ¶
type TransactionResultGenerator struct { Blocks []types.BlockID Addrs []types.Address Layers []types.LayerID // contains filtered or unexported fields }
TransactionResultGenerator generates random transaction with results. Transactions are not syntactically or contextually valid. This is for testing databases and APIs.
func NewTransactionResultGenerator ¶
func NewTransactionResultGenerator() *TransactionResultGenerator
NewTransactionResultGenerator with some random parameters.
func (*TransactionResultGenerator) Next ¶
func (g *TransactionResultGenerator) Next() *types.TransactionWithResult
Next generates TransactionWithResult.
func (*TransactionResultGenerator) WithAddresses ¶
func (g *TransactionResultGenerator) WithAddresses(n int) *TransactionResultGenerator
WithAddresses update addresses.
func (*TransactionResultGenerator) WithBlocks ¶
func (g *TransactionResultGenerator) WithBlocks(n int) *TransactionResultGenerator
WithBlocks update blocks ids.
func (*TransactionResultGenerator) WithLayers ¶
func (g *TransactionResultGenerator) WithLayers(start, n int) *TransactionResultGenerator
WithLayers updates layers.
func (*TransactionResultGenerator) WithSeed ¶
func (g *TransactionResultGenerator) WithSeed(seed int64) *TransactionResultGenerator
WithSeed update randomness source.