-
Notifications
You must be signed in to change notification settings - Fork 669
/
test_vertex.go
36 lines (27 loc) · 987 Bytes
/
test_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
34
35
36
// Copyright (C) 2019-2021, Ava Labs, Inc. All rights reserved.
// See the file LICENSE for licensing terms.
package avalanche
import (
"github.com/ava-labs/avalanchego/snow/choices"
"github.com/ava-labs/avalanchego/snow/consensus/snowstorm"
)
var _ Vertex = &TestVertex{}
// TestVertex is a useful test vertex
type TestVertex struct {
choices.TestDecidable
ParentsV []Vertex
ParentsErrV error
HeightV uint64
HeightErrV error
TxsV []snowstorm.Tx
TxsErrV error
BytesV []byte
}
// Parents implements the Vertex interface
func (v *TestVertex) Parents() ([]Vertex, error) { return v.ParentsV, v.ParentsErrV }
// Height implements the Vertex interface
func (v *TestVertex) Height() (uint64, error) { return v.HeightV, v.HeightErrV }
// Txs implements the Vertex interface
func (v *TestVertex) Txs() ([]snowstorm.Tx, error) { return v.TxsV, v.TxsErrV }
// Bytes implements the Vertex interface
func (v *TestVertex) Bytes() []byte { return v.BytesV }