2017-11-06 16:52:07 +00:00
|
|
|
package repositories
|
|
|
|
|
2017-11-06 18:53:43 +00:00
|
|
|
import "github.com/8thlight/vulcanizedb/pkg/core"
|
2017-11-06 16:52:07 +00:00
|
|
|
|
2017-12-20 20:06:22 +00:00
|
|
|
const (
|
|
|
|
blocksFromHeadBeforeFinal = 20
|
|
|
|
)
|
|
|
|
|
2017-11-06 16:52:07 +00:00
|
|
|
type Repository interface {
|
2017-12-19 20:14:41 +00:00
|
|
|
CreateOrUpdateBlock(block core.Block) error
|
2017-11-06 20:15:02 +00:00
|
|
|
BlockCount() int
|
2017-12-13 16:51:11 +00:00
|
|
|
FindBlockByNumber(blockNumber int64) (core.Block, error)
|
2017-11-06 20:36:12 +00:00
|
|
|
MaxBlockNumber() int64
|
|
|
|
MissingBlockNumbers(startingBlockNumber int64, endingBlockNumber int64) []int64
|
2018-01-03 17:23:43 +00:00
|
|
|
FindReceipt(txHash string) (core.Receipt, error)
|
2017-12-04 22:54:35 +00:00
|
|
|
CreateContract(contract core.Contract) error
|
|
|
|
ContractExists(contractHash string) bool
|
2017-12-13 16:51:11 +00:00
|
|
|
FindContract(contractHash string) (core.Contract, error)
|
2017-12-12 21:55:26 +00:00
|
|
|
CreateLogs(log []core.Log) error
|
|
|
|
FindLogs(address string, blockNumber int64) []core.Log
|
2017-12-20 20:06:22 +00:00
|
|
|
SetBlocksStatus(chainHead int64)
|
2017-11-06 16:52:07 +00:00
|
|
|
}
|