Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // Accepted represents an accepted status Accepted = choices.Accepted // Rejected represents a rejected status Rejected = choices.Rejected // Processing represents a processing status Processing = choices.Processing // Unknown represents an unknown status Unknown = choices.Unknown // XChainID is a test X-Chain ID XChainID = ids.ID{5, 4, 3, 2, 1} )
Status constants for test assertions
var CChainID = ids.GenerateTestID()
CChainID is a test chain ID
var ErrTest = errors.New("test error")
ErrTest is a test error.
Functions ¶
func ConsensusContext ¶
ConsensusContext returns the context as-is (for compatibility)
Types ¶
type BlockFactory ¶
type BlockFactory struct {
// contains filtered or unexported fields
}
BlockFactory creates test blocks.
func NewBlockFactory ¶
func NewBlockFactory() *BlockFactory
NewBlockFactory creates a new block factory.
type MockPoll ¶
type MockPoll struct {
// contains filtered or unexported fields
}
MockPoll is a mock poll for testing.
func (*MockPoll) SetFinished ¶
SetFinished sets the poll as finished.
type PollFactory ¶
type PollFactory struct {
// contains filtered or unexported fields
}
PollFactory creates test polls.
func NewPollFactory ¶
func NewPollFactory(alpha int) *PollFactory
NewPollFactory creates a new poll factory.
type TestBlock ¶
type TestBlock struct {
TestDecidable
ParentV ids.ID
HeightV uint64
TimeV uint64
VerifyV error
BytesV []byte
}
TestBlock is a test implementation of a block.
type TestDecidable ¶
TestDecidable is a test implementation of choices.Decidable.
func (*TestDecidable) Accept ¶
func (d *TestDecidable) Accept(context.Context) error
Accept accepts this element.
func (*TestDecidable) Reject ¶
func (d *TestDecidable) Reject(context.Context) error
Reject rejects this element.
func (*TestDecidable) Status ¶
func (d *TestDecidable) Status() choices.Status
Status returns the status of this element.
type TestPoll ¶
type TestPoll struct {
// contains filtered or unexported fields
}
TestPoll is a test poll implementation.
type TestVertex ¶
type TestVertex struct {
TestDecidable
ParentsV []ids.ID
HeightV uint64
EpochV uint32
VerifyV error
BytesV []byte
}
TestVertex is a test implementation of a vertex.
func (*TestVertex) Bytes ¶
func (v *TestVertex) Bytes() []byte
Bytes returns the byte representation.
func (*TestVertex) Epoch ¶
func (v *TestVertex) Epoch() uint32
Epoch returns the epoch of this vertex.
func (*TestVertex) Height ¶
func (v *TestVertex) Height() uint64
Height returns the height of this vertex.
func (*TestVertex) Parents ¶
func (v *TestVertex) Parents() []ids.ID
Parents returns the parents of this vertex.
func (*TestVertex) Verify ¶
func (v *TestVertex) Verify(context.Context) error
Verify returns the verification error.
func (*TestVertex) Vertex ¶
func (v *TestVertex) Vertex() ids.ID
Vertex returns the ID of this vertex.
type VertexFactory ¶
type VertexFactory struct {
// contains filtered or unexported fields
}
VertexFactory creates test vertices.
func NewVertexFactory ¶
func NewVertexFactory() *VertexFactory
NewVertexFactory creates a new vertex factory.
func (*VertexFactory) New ¶
func (f *VertexFactory) New(parents []ids.ID) *TestVertex
New creates a new test vertex.