-
Notifications
You must be signed in to change notification settings - Fork 646
/
vm.go
29 lines (23 loc) · 817 Bytes
/
vm.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
// Copyright (C) 2019-2021, Ava Labs, Inc. All rights reserved.
// See the file LICENSE for licensing terms.
package vertex
import (
"github.com/ava-labs/avalanchego/ids"
"github.com/ava-labs/avalanchego/snow/consensus/snowstorm"
"github.com/ava-labs/avalanchego/snow/engine/common"
)
// DAGVM defines the minimum functionality that an avalanche VM must
// implement
type DAGVM interface {
common.VM
Getter
// Return any transactions that have not been sent to consensus yet
PendingTxs() []snowstorm.Tx
// Convert a stream of bytes to a transaction or return an error
ParseTx(tx []byte) (snowstorm.Tx, error)
}
// Getter defines the functionality for fetching a tx/block by its ID.
type Getter interface {
// Retrieve a transaction that was submitted previously
GetTx(ids.ID) (snowstorm.Tx, error)
}