itests

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2023 License: Apache-2.0, MIT Imports: 46 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Calibnet = "calibnet"
	Mainnet  = "mainnet"
)

Variables

View Source
var CalibnetTestVectors []*TestVector
View Source
var MainnetTestVectors []*TestVector
View Source
var TaskModels = map[string][]string{
	tasktype.MessagesTask:       {"receipts", "block_messages"},
	tasktype.BlocksTask:         {"block_headers", "block_parents", "drand_block_entries"},
	tasktype.ChainConsensusTask: {"chain_consensus"},
	tasktype.ActorStatesRawTask: {"actors", "actor_states"},
}

Functions

func NewTestNode

func NewTestNode(ctx context.Context, t testing.TB, cfg *TestNodeConfig) (lily.LilyAPI, node.StopFunc)

Types

type ActorStatesValidator

type ActorStatesValidator struct{}

func (ActorStatesValidator) Validate

func (ActorStatesValidator) Validate(t *testing.T, state *TipSetState, strg *storage.Database)

type ActorValidator

type ActorValidator struct{}

func (ActorValidator) Validate

func (ActorValidator) Validate(t *testing.T, state *TipSetState, strg *storage.Database)

type BlockHeaderValidator

type BlockHeaderValidator struct{}

func (BlockHeaderValidator) Validate

func (BlockHeaderValidator) Validate(t *testing.T, state *TipSetState, strg *storage.Database)

type BlockMessagesValidator

type BlockMessagesValidator struct{}

func (BlockMessagesValidator) Validate

func (BlockMessagesValidator) Validate(t *testing.T, state *TipSetState, strg *storage.Database)

type BlockParentsValidator

type BlockParentsValidator struct{}

func (BlockParentsValidator) Validate

func (BlockParentsValidator) Validate(t *testing.T, state *TipSetState, strg *storage.Database)

type ChainConsensusValidator

type ChainConsensusValidator struct{}

func (ChainConsensusValidator) Validate

func (ChainConsensusValidator) Validate(t *testing.T, epoch int64, ts *types.TipSet, strg *storage.Database, api *lily.LilyNodeAPI)

type DrandBlockEntriesValidator

type DrandBlockEntriesValidator struct{}

func (DrandBlockEntriesValidator) Validate

func (DrandBlockEntriesValidator) Validate(t *testing.T, state *TipSetState, strg *storage.Database)

type EpochValidator

type EpochValidator interface {
	Validate(t *testing.T, epoch int64, ts *types.TipSet, strg *storage.Database, api *lily.LilyNodeAPI)
}

type ReceiptsValidator

type ReceiptsValidator struct{}

func (ReceiptsValidator) Validate

func (ReceiptsValidator) Validate(t *testing.T, state *TipSetState, strg *storage.Database)

type TestNodeConfig

type TestNodeConfig struct {
	LilyConfig  *config.Conf
	CacheConfig *lutil.CacheConfig
	RepoPath    string
	Snapshot    fs.File
	Genesis     fs.File
	APIEndpoint string
}

type TestVector

type TestVector struct {
	From, To int64
	File     *os.File
	Snapshot *os.File
	Genesis  *os.File
}

func (*TestVector) Close

func (tv *TestVector) Close() error

type TipSetState

type TipSetState struct {
	// contains filtered or unexported fields
}

TipSetState contains the state of actors, blocks, messages, and receipts for the tipset it was derived from.

func StateForTipSet

func StateForTipSet(ctx context.Context, n *lily.LilyNodeAPI, ts *types.TipSet) (*TipSetState, error)

StateForTipSet returns a TipSetState for Current `ts`. All state is derived from Lotus API calls.

type TipSetStateValidator

type TipSetStateValidator interface {
	Validate(t *testing.T, state *TipSetState, strg *storage.Database)
}

type VectorWalkValidator

type VectorWalkValidator struct {
	// contains filtered or unexported fields
}

func (*VectorWalkValidator) Run

func (*VectorWalkValidator) Validate

func (vw *VectorWalkValidator) Validate(t *testing.T)

func (*VectorWalkValidator) ValidateEpochState

func (vw *VectorWalkValidator) ValidateEpochState(t *testing.T, mv ...EpochValidator)

func (*VectorWalkValidator) ValidateTipSetStates

func (vw *VectorWalkValidator) ValidateTipSetStates(t *testing.T, mv ...TipSetStateValidator)

ValidateModels validates that the data in the database for the passed models matches the results returned by the lotus api.

type VectorWalkValidatorBuilder

type VectorWalkValidatorBuilder struct {
	// contains filtered or unexported fields
}

func NewVectorWalkValidatorBuilder

func NewVectorWalkValidatorBuilder(tv *TestVector) VectorWalkValidatorBuilder

func (VectorWalkValidatorBuilder) Build

func (VectorWalkValidatorBuilder) WithDatabase

func (VectorWalkValidatorBuilder) WithNodeCfg

func (VectorWalkValidatorBuilder) WithRange

func (VectorWalkValidatorBuilder) WithTasks

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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