Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TestTx ¶
type TestTx struct {
choices.TestDecidable
DependenciesV set.Set[ids.ID]
DependenciesErrV error
VerifyV error
BytesV []byte
}
TestTx is a useful test tx
func (*TestTx) MissingDependencies ¶
type TestVertex ¶
type TestVertex struct {
choices.TestDecidable
ParentsV []Vertex
ParentsErrV error
HeightV uint64
HeightErrV error
TxsV []Tx
TxsErrV error
BytesV []byte
}
TestVertex is a useful test vertex
func (*TestVertex) Bytes ¶
func (v *TestVertex) Bytes() []byte
func (*TestVertex) Height ¶
func (v *TestVertex) Height() (uint64, error)
func (*TestVertex) Parents ¶
func (v *TestVertex) Parents() ([]Vertex, error)
type Tx ¶
type Tx interface {
choices.Decidable
// MissingDependencies returns the set of transactions that must be accepted
// before this transaction is accepted.
MissingDependencies() (set.Set[ids.ID], error)
// Verify that the state transition this transaction would make if it were
// accepted is valid. If the state transition is invalid, a non-nil error
// should be returned.
//
// It is guaranteed that when Verify is called, all the dependencies of
// this transaction have already been successfully verified.
Verify(context.Context) error
// Bytes returns the binary representation of this transaction.
//
// This is used for sending transactions to peers. Another node should be
// able to parse these bytes to the same transaction.
Bytes() []byte
}
Tx consumes state.
type Vertex ¶
type Vertex interface {
choices.Decidable
// Returns the vertices this vertex depends on
Parents() ([]Vertex, error)
// Returns the height of this vertex. A vertex's height is defined by one
// greater than the maximum height of the parents.
Height() (uint64, error)
// Returns a series of state transitions to be performed on acceptance
Txs(context.Context) ([]Tx, error)
// Returns the binary representation of this vertex
Bytes() []byte
}
Vertex is a collection of multiple transactions tied to other vertices
Note: Verify is not part of this interface because bootstrapping uses IDs to verify the vertex is valid.
Directories
¶
| Path | Synopsis |
|---|---|
|
vertexmock
Package vertexmock is a generated GoMock package.
|
Package vertexmock is a generated GoMock package. |
Click to show internal directories.
Click to hide internal directories.