mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2024-12-25 21:17:16 +00:00
1dcc2b141a
* share config object * create default config and logger * move db connection to common func * move server start to cli package * clear * clear * rename cli to rpc * use unified SetupLogger func * make all root flag persistent * use common flags in different packages * use common flags in different packages * move TraceTx method to eth package * use native slice flags * create package "turbo" * disable geth api * disable geth api * move more data types to turbo/adapter package * add support for customApiList * run more * run more * run more * dog-food * move DoCall * move DoCall * fix tests * fix test
25 lines
582 B
Go
25 lines
582 B
Go
package adapter
|
|
|
|
import (
|
|
"github.com/ledgerwatch/turbo-geth/common"
|
|
"github.com/ledgerwatch/turbo-geth/core/rawdb"
|
|
"github.com/ledgerwatch/turbo-geth/core/types"
|
|
)
|
|
|
|
func NewBlockGetter(dbReader rawdb.DatabaseReader) *blockGetter {
|
|
return &blockGetter{dbReader}
|
|
}
|
|
|
|
type blockGetter struct {
|
|
dbReader rawdb.DatabaseReader
|
|
}
|
|
|
|
func (g *blockGetter) GetBlockByHash(hash common.Hash) *types.Block {
|
|
return rawdb.ReadBlockByHash(g.dbReader, hash)
|
|
|
|
}
|
|
|
|
func (g *blockGetter) GetBlock(hash common.Hash, number uint64) *types.Block {
|
|
return rawdb.ReadBlock(g.dbReader, hash, number)
|
|
}
|