ipld-eth-server/pkg/repositories/inmemory/in_memory.go

31 lines
813 B
Go
Raw Normal View History

package inmemory
2017-11-06 16:42:33 +00:00
import (
2018-01-06 20:31:53 +00:00
"github.com/vulcanize/vulcanizedb/pkg/core"
2018-01-26 00:08:26 +00:00
"github.com/vulcanize/vulcanizedb/pkg/filters"
)
const (
blocksFromHeadBeforeFinal = 20
2017-11-06 16:42:33 +00:00
)
type InMemory struct {
blocks map[int64]core.Block
receipts map[string]core.Receipt
contracts map[string]core.Contract
logs map[string][]core.Log
logFilters map[string]filters.LogFilter
CreateOrUpdateBlockCallCount int
}
func NewInMemory() *InMemory {
return &InMemory{
CreateOrUpdateBlockCallCount: 0,
blocks: make(map[int64]core.Block),
receipts: make(map[string]core.Receipt),
contracts: make(map[string]core.Contract),
logs: make(map[string][]core.Log),
logFilters: make(map[string]filters.LogFilter),
}
}