github.com/MetalBlockchain/metalgo@v1.11.9/snow/consensus/avalanche/vertex.go (about)

     1  // Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved.
     2  // See the file LICENSE for licensing terms.
     3  
     4  package avalanche
     5  
     6  import (
     7  	"context"
     8  
     9  	"github.com/MetalBlockchain/metalgo/snow/choices"
    10  	"github.com/MetalBlockchain/metalgo/snow/consensus/snowstorm"
    11  )
    12  
    13  // Vertex is a collection of multiple transactions tied to other vertices
    14  //
    15  // Note: Verify is not part of this interface because bootstrapping uses IDs to
    16  // verify the vertex is valid.
    17  type Vertex interface {
    18  	choices.Decidable
    19  
    20  	// Returns the vertices this vertex depends on
    21  	Parents() ([]Vertex, error)
    22  
    23  	// Returns the height of this vertex. A vertex's height is defined by one
    24  	// greater than the maximum height of the parents.
    25  	Height() (uint64, error)
    26  
    27  	// Returns a series of state transitions to be performed on acceptance
    28  	Txs(context.Context) ([]snowstorm.Tx, error)
    29  
    30  	// Returns the binary representation of this vertex
    31  	Bytes() []byte
    32  }