-
Notifications
You must be signed in to change notification settings - Fork 669
/
vertex.go
33 lines (24 loc) · 917 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
33
// Copyright (C) 2019-2022, 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
type Vertex interface {
choices.Decidable
snowstorm.Whitelister
// Vertex verification should be performed before issuance.
Verify(context.Context) error
// 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
}