laconicd/types/indexer.go

20 lines
614 B
Go
Raw Normal View History

2022-10-10 10:38:33 +00:00
package types
import (
"github.com/ethereum/go-ethereum/common"
abci "github.com/tendermint/tendermint/abci/types"
tmtypes "github.com/tendermint/tendermint/types"
)
// EVMTxIndexer defines the interface of custom eth tx indexer.
type EVMTxIndexer interface {
// LastIndexedBlock returns -1 if indexer db is empty
LastIndexedBlock() (int64, error)
IndexBlock(*tmtypes.Block, []*abci.ResponseDeliverTx) error
// GetByTxHash returns nil if tx not found.
GetByTxHash(common.Hash) (*TxResult, error)
// GetByBlockAndIndex returns nil if tx not found.
GetByBlockAndIndex(int64, int32) (*TxResult, error)
}