mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2024-12-25 04:57:17 +00:00
068463dff4
* Store transactions individually * Store transactions individually * save progress * checkIndex * merge
25 lines
621 B
Go
25 lines
621 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"
|
|
"github.com/ledgerwatch/turbo-geth/ethdb"
|
|
)
|
|
|
|
func NewBlockGetter(dbReader ethdb.Database) *blockGetter {
|
|
return &blockGetter{dbReader}
|
|
}
|
|
|
|
type blockGetter struct {
|
|
dbReader ethdb.Database
|
|
}
|
|
|
|
func (g *blockGetter) GetBlockByHash(hash common.Hash) (*types.Block, error) {
|
|
return rawdb.ReadBlockByHash(g.dbReader, hash)
|
|
}
|
|
|
|
func (g *blockGetter) GetBlock(hash common.Hash, number uint64) *types.Block {
|
|
return rawdb.ReadBlock(g.dbReader, hash, number)
|
|
}
|