Documentation ¶
Index ¶
- type DAGVM
- type Heap
- type Manager
- type TestManager
- func (m *TestManager) BuildVertex(set ids.Set, txs []snowstorm.Tx) (avalanche.Vertex, error)
- func (m *TestManager) Default(cant bool)
- func (m *TestManager) Edge() []ids.ID
- func (m *TestManager) GetVertex(id ids.ID) (avalanche.Vertex, error)
- func (m *TestManager) ParseVertex(b []byte) (avalanche.Vertex, error)
- type TestVM
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DAGVM ¶
type DAGVM interface { common.VM // Return any transactions that have not been sent to consensus yet PendingTxs() []snowstorm.Tx // Convert a stream of bytes to a transaction or return an error ParseTx(tx []byte) (snowstorm.Tx, error) // Retrieve a transaction that was submitted previously GetTx(ids.ID) (snowstorm.Tx, error) }
DAGVM defines the minimum functionality that an avalanche VM must implement
type Heap ¶
type Heap interface { // Empty the heap. Clear() // Add the provided vertex to the heap. Vertices are de-duplicated, returns // true if the vertex was added, false if it was dropped. Push(avalanche.Vertex) bool // Remove the top vertex. Assumes that there is at least one element. Pop() avalanche.Vertex // Returns if a vertex with the provided ID is currently in the heap. Contains(ids.ID) bool // Returns the number of vertices in the heap. Len() int }
Heap defines the functionality of a heap of vertices with unique VertexIDs ordered by height
type Manager ¶
type Manager interface { // Create a new vertex from the contents of a vertex BuildVertex(parentIDs ids.Set, txs []snowstorm.Tx) (avalanche.Vertex, error) // Attempt to convert a stream of bytes into a vertex ParseVertex(vertex []byte) (avalanche.Vertex, error) // GetVertex attempts to load a vertex by hash from storage GetVertex(vtxID ids.ID) (avalanche.Vertex, error) // Edge returns a list of accepted vertex IDs with no accepted children Edge() (vtxIDs []ids.ID) }
Manager defines the persistant storage that is required by the consensus engine
type TestManager ¶
type TestManager struct { T *testing.T CantParseVertex, CantBuildVertex, CantGetVertex, CantEdge bool ParseVertexF func([]byte) (avalanche.Vertex, error) BuildVertexF func(ids.Set, []snowstorm.Tx) (avalanche.Vertex, error) GetVertexF func(ids.ID) (avalanche.Vertex, error) EdgeF func() []ids.ID }
TestManager ...
func (*TestManager) BuildVertex ¶
BuildVertex ...
func (*TestManager) ParseVertex ¶
func (m *TestManager) ParseVertex(b []byte) (avalanche.Vertex, error)
ParseVertex ...
type TestVM ¶
type TestVM struct { common.TestVM CantPendingTxs, CantParseTx, CantIssueTx, CantGetTx bool PendingTxsF func() []snowstorm.Tx ParseTxF func([]byte) (snowstorm.Tx, error) IssueTxF func([]byte, func(choices.Status), func(choices.Status)) (ids.ID, error) GetTxF func(ids.ID) (snowstorm.Tx, error) }
TestVM ...
Click to show internal directories.
Click to hide internal directories.