-
Notifications
You must be signed in to change notification settings - Fork 10
/
chainreader.go
33 lines (28 loc) · 1.11 KB
/
chainreader.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) 2018 ContentBox Authors.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
package service
import (
"github.com/BOXFoundation/boxd/core/types"
state "github.com/BOXFoundation/boxd/core/worldstate"
"github.com/BOXFoundation/boxd/crypto"
"github.com/BOXFoundation/boxd/vm"
)
// ChainReader defines basic operations blockchain exposes
type ChainReader interface {
// interface to read transactions
LoadBlockInfoByTxHash(crypto.HashType) (*types.Block, *types.Transaction, error)
ReadBlockFromDB(*crypto.HashType) (*types.Block, int, error)
GetEvmByHeight(msg types.Message, height uint32) (*vm.EVM, func() error, error)
GetLogs(from, to uint32, topicslist [][][]byte) ([]*types.Log, error)
FilterLogs(logs []*types.Log, topicslist [][][]byte) ([]*types.Log, error)
//
GetDataFromDB([]byte) ([]byte, error)
GetTxReceipt(*crypto.HashType) (*types.Receipt, error)
//interface to reader block status
GetBlockHeight() uint32
GetBlockHash(uint32) (*crypto.HashType, error)
EternalBlock() *types.Block
TailBlock() *types.Block
TailState() *state.StateDB
}