 Documentation
      ¶
      Documentation
      ¶
    
    
  
    
  
    Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsSortedAndUniqueHashOf ¶ added in v1.1.1
func SortHashOf ¶ added in v1.1.1
func SortHashOf(bytesSlice [][]byte)
Types ¶
type Builder ¶ added in v1.1.1
type Builder interface {
	// Build a new vertex from the contents of a vertex
	BuildVtx(
		epoch uint32,
		parentIDs []ids.ID,
		txs []snowstorm.Tx,
		restrictions []ids.ID,
	) (avalanche.Vertex, error)
}
    Builder builds a vertex given a set of parentIDs and transactions.
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 ¶
Manager defines all the vertex related functionality that is required by the consensus engine.
type Parser ¶ added in v1.1.1
type Parser interface {
	// Parse a vertex from a slice of bytes
	ParseVtx(vertex []byte) (avalanche.Vertex, error)
}
    Parser parses bytes into a vertex.
type StatelessVertex ¶ added in v1.1.1
type StatelessVertex interface {
	verify.Verifiable
	ID() ids.ID
	Bytes() []byte
	Version() uint16
	ChainID() ids.ID
	Height() uint64
	Epoch() uint32
	ParentIDs() []ids.ID
	Txs() [][]byte
	Restrictions() []ids.ID
}
    func Build ¶ added in v1.1.1
func Build( chainID ids.ID, height uint64, epoch uint32, parentIDs []ids.ID, txs [][]byte, restrictions []ids.ID, ) (StatelessVertex, error)
Build a new stateless vertex from the contents of a vertex
func Parse ¶ added in v1.1.1
func Parse(vertex []byte) (StatelessVertex, error)
Parse the provided vertex bytes into a stateless vertex
type Storage ¶ added in v1.1.1
type Storage interface {
	// Get a vertex by its hash from storage.
	GetVtx(vtxID ids.ID) (avalanche.Vertex, error)
	// Edge returns a list of accepted vertex IDs with no accepted children.
	Edge() (vtxIDs []ids.ID)
}
    Storage defines the persistent storage that is required by the consensus engine.
type TestBuilder ¶ added in v1.1.1
type TestBuilder struct {
	T            *testing.T
	CantBuildVtx bool
	BuildVtxF    func(
		epoch uint32,
		parentIDs []ids.ID,
		txs []snowstorm.Tx,
		restrictions []ids.ID,
	) (avalanche.Vertex, error)
}
    func (*TestBuilder) Default ¶ added in v1.1.1
func (b *TestBuilder) Default(cant bool)
type TestManager ¶
type TestManager struct {
	TestBuilder
	TestParser
	TestStorage
}
    func NewTestManager ¶ added in v1.1.1
func NewTestManager(t *testing.T) *TestManager
func (*TestManager) Default ¶
func (m *TestManager) Default(cant bool)
type TestParser ¶ added in v1.1.1
type TestParser struct {
	T            *testing.T
	CantParseVtx bool
	ParseVtxF    func([]byte) (avalanche.Vertex, error)
}
    func (*TestParser) Default ¶ added in v1.1.1
func (p *TestParser) Default(cant bool)
type TestStorage ¶ added in v1.1.1
type TestStorage struct {
	T                    *testing.T
	CantGetVtx, CantEdge bool
	GetVtxF              func(ids.ID) (avalanche.Vertex, error)
	EdgeF                func() []ids.ID
}
    func (*TestStorage) Default ¶ added in v1.1.1
func (s *TestStorage) Default(cant bool)
func (*TestStorage) Edge ¶ added in v1.1.1
func (s *TestStorage) Edge() []ids.ID
       Source Files
      ¶
      Source Files
      ¶
    
   Click to show internal directories. 
   Click to hide internal directories.