fixture

package
v1.5.0-alpha.5 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IDGen

func IDGen(sid string) (id types.BlockID)

func RBlock

func RBlock(id types.BlockID, opts ...RBlockOpt) result.Block

func RLayer

func RLayer(lid types.LayerID, blocks ...result.Block) result.Layer

func RLayerNonFinal

func RLayerNonFinal(lid types.LayerID, blocks ...result.Block) result.Layer

func RLayers

func RLayers(layers ...result.Layer) []result.Layer

func ROpinion

func ROpinion(lid types.LayerID, opinion types.Hash32, blocks ...result.Block) result.Layer

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

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 RBlockOpt

type RBlockOpt func(*result.Block)

func Data

func Data() RBlockOpt

func Good

func Good() RBlockOpt

func Hare

func Hare() RBlockOpt

func Invalid

func Invalid() RBlockOpt

func Valid

func Valid() RBlockOpt

type RewardsGenerator added in v1.4.0

type RewardsGenerator struct {
	UniqueCoinbase bool
	Addrs          []types.Address
	Layers         []types.LayerID
	// contains filtered or unexported fields
}

RewardsGenerator generates random rewards. Rewards are not syntactically or contextually valid. This is for testing databases and APIs.

func NewRewardsGenerator added in v1.4.0

func NewRewardsGenerator() *RewardsGenerator

NewRewardsGenerator with some random parameters.

func (*RewardsGenerator) Next added in v1.4.0

func (g *RewardsGenerator) Next() *types.Reward

Next generates Reward.

func (*RewardsGenerator) WithAddresses added in v1.4.0

func (g *RewardsGenerator) WithAddresses(n int) *RewardsGenerator

WithAddresses update addresses.

func (*RewardsGenerator) WithLayers added in v1.4.0

func (g *RewardsGenerator) WithLayers(start, n int) *RewardsGenerator

WithLayers updates layers.

func (*RewardsGenerator) WithSeed added in v1.4.0

func (g *RewardsGenerator) WithSeed(seed int64) *RewardsGenerator

WithSeed update randomness source.

func (*RewardsGenerator) WithUniqueCoinbase added in v1.4.0

func (g *RewardsGenerator) WithUniqueCoinbase() *RewardsGenerator

WithUniqueCoinbase will generate every reward with different address.

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

Next generates TransactionWithResult.

func (*TransactionResultGenerator) WithAddresses

WithAddresses update addresses.

func (*TransactionResultGenerator) WithBlocks

WithBlocks update blocks ids.

func (*TransactionResultGenerator) WithLayers

WithLayers updates layers.

func (*TransactionResultGenerator) WithSeed

WithSeed update randomness source.

Jump to

Keyboard shortcuts

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