-
Notifications
You must be signed in to change notification settings - Fork 669
/
vertex.go
32 lines (24 loc) · 915 Bytes
/
vertex.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved.
// See the file LICENSE for licensing terms.
package avalanche
import (
"context"
"github.com/ava-labs/avalanchego/snow/choices"
"github.com/ava-labs/avalanchego/snow/consensus/snowstorm"
)
// 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.
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) ([]snowstorm.Tx, error)
// Returns the binary representation of this vertex
Bytes() []byte
}