Documentation ¶
Index ¶
- Constants
- Variables
- func NewTestNode(ctx context.Context, t testing.TB, cfg *TestNodeConfig) (lily.LilyAPI, node.StopFunc)
- type ActorStatesValidator
- type ActorValidator
- type BlockHeaderValidator
- type BlockMessagesValidator
- type BlockParentsValidator
- type ChainConsensusValidator
- type DrandBlockEntriesValidator
- type EpochValidator
- type ReceiptsValidator
- type TestNodeConfig
- type TestVector
- type TipSetState
- type TipSetStateValidator
- type VectorWalkValidator
- func (vw *VectorWalkValidator) Run(ctx context.Context) node.StopFunc
- func (vw *VectorWalkValidator) Validate(t *testing.T)
- func (vw *VectorWalkValidator) ValidateEpochState(t *testing.T, mv ...EpochValidator)
- func (vw *VectorWalkValidator) ValidateTipSetStates(t *testing.T, mv ...TipSetStateValidator)
- type VectorWalkValidatorBuilder
- func (b VectorWalkValidatorBuilder) Build(ctx context.Context, t testing.TB) *VectorWalkValidator
- func (b VectorWalkValidatorBuilder) WithDatabase(strg *storage.Database) VectorWalkValidatorBuilder
- func (b VectorWalkValidatorBuilder) WithNodeCfg(cfg *TestNodeConfig) VectorWalkValidatorBuilder
- func (b VectorWalkValidatorBuilder) WithRange(from, to int64) VectorWalkValidatorBuilder
- func (b VectorWalkValidatorBuilder) WithTasks(tasks ...string) VectorWalkValidatorBuilder
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"}, }
View Source
var TaskValidators = map[string][]interface{}{ tasktype.MessagesTask: {BlockMessagesValidator{}, ReceiptsValidator{}}, tasktype.BlocksTask: {BlockHeaderValidator{}, BlockParentsValidator{}, DrandBlockEntriesValidator{}}, tasktype.ChainConsensusTask: {ChainConsensusValidator{}}, tasktype.ActorStatesRawTask: {ActorStatesValidator{}, ActorValidator{}}, }
Functions ¶
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{}
type DrandBlockEntriesValidator ¶
type DrandBlockEntriesValidator struct{}
func (DrandBlockEntriesValidator) Validate ¶
func (DrandBlockEntriesValidator) Validate(t *testing.T, state *TipSetState, strg *storage.Database)
type EpochValidator ¶
type ReceiptsValidator ¶
type ReceiptsValidator struct{}
func (ReceiptsValidator) Validate ¶
func (ReceiptsValidator) Validate(t *testing.T, state *TipSetState, strg *storage.Database)
type TestNodeConfig ¶
type TestVector ¶
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 (vw *VectorWalkValidator) Run(ctx context.Context) node.StopFunc
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 (b VectorWalkValidatorBuilder) Build(ctx context.Context, t testing.TB) *VectorWalkValidator
func (VectorWalkValidatorBuilder) WithDatabase ¶
func (b VectorWalkValidatorBuilder) WithDatabase(strg *storage.Database) VectorWalkValidatorBuilder
func (VectorWalkValidatorBuilder) WithNodeCfg ¶
func (b VectorWalkValidatorBuilder) WithNodeCfg(cfg *TestNodeConfig) VectorWalkValidatorBuilder
func (VectorWalkValidatorBuilder) WithRange ¶
func (b VectorWalkValidatorBuilder) WithRange(from, to int64) VectorWalkValidatorBuilder
func (VectorWalkValidatorBuilder) WithTasks ¶
func (b VectorWalkValidatorBuilder) WithTasks(tasks ...string) VectorWalkValidatorBuilder
Click to show internal directories.
Click to hide internal directories.