forked from ava-labs/avalanchego
-
Notifications
You must be signed in to change notification settings - Fork 4
/
test_vertex.go
42 lines (32 loc) · 864 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
37
38
39
40
41
42
// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved.
// See the file LICENSE for licensing terms.
package avalanche
import (
"context"
"github.com/MetalBlockchain/metalgo/snow/choices"
"github.com/MetalBlockchain/metalgo/snow/consensus/snowstorm"
)
var _ Vertex = (*TestVertex)(nil)
// 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
}
func (v *TestVertex) Parents() ([]Vertex, error) {
return v.ParentsV, v.ParentsErrV
}
func (v *TestVertex) Height() (uint64, error) {
return v.HeightV, v.HeightErrV
}
func (v *TestVertex) Txs(context.Context) ([]snowstorm.Tx, error) {
return v.TxsV, v.TxsErrV
}
func (v *TestVertex) Bytes() []byte {
return v.BytesV
}