-
Notifications
You must be signed in to change notification settings - Fork 210
/
interface.go
34 lines (28 loc) · 1.01 KB
/
interface.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
package txs
import (
"context"
"time"
"github.com/spacemeshos/go-spacemesh/common/types"
"github.com/spacemeshos/go-spacemesh/log"
"github.com/spacemeshos/go-spacemesh/system"
)
//go:generate mockgen -typed -package=txs -destination=./txs_mocks.go -source=./interface.go
type conservativeState interface {
HasTx(types.TransactionID) (bool, error)
Validation(types.RawTx) system.ValidationRequest
AddToCache(context.Context, *types.Transaction, time.Time) error
AddToDB(*types.Transaction) error
GetMeshTransaction(types.TransactionID) (*types.MeshTransaction, error)
}
type vmState interface {
Validation(types.RawTx) system.ValidationRequest
GetStateRoot() (types.Hash32, error)
GetLayerStateRoot(types.LayerID) (types.Hash32, error)
GetLayerApplied(types.TransactionID) (types.LayerID, error)
GetAllAccounts() ([]*types.Account, error)
GetBalance(types.Address) (uint64, error)
GetNonce(types.Address) (types.Nonce, error)
}
type conStateCache interface {
GetMempool(log.Log) map[types.Address][]*NanoTX
}