mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-23 21:26:42 +00:00
internal/ethapi: use genesis header instead of block object
This commit is contained in:
parent
4a63b16bde
commit
815a841993
2 changed files with 4 additions and 4 deletions
|
|
@ -1171,7 +1171,7 @@ type configResponse struct {
|
|||
|
||||
// Config implements the EIP-7910 eth_config method.
|
||||
func (api *BlockChainAPI) Config(ctx context.Context) (*configResponse, error) {
|
||||
genesis, err := api.b.BlockByNumber(ctx, 0)
|
||||
genesis, err := api.b.HeaderByNumber(ctx, 0)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("unable to load genesis: %w", err)
|
||||
}
|
||||
|
|
@ -1188,7 +1188,7 @@ func (api *BlockChainAPI) Config(ctx context.Context) (*configResponse, error) {
|
|||
for addr, c := range vm.ActivePrecompiledContracts(rules) {
|
||||
precompiles[c.Name()] = addr
|
||||
}
|
||||
forkid := forkid.NewID(c, genesis, ^uint64(0), t).Hash
|
||||
forkid := forkid.NewID(c, types.NewBlockWithHeader(genesis), ^uint64(0), t).Hash
|
||||
return &config{
|
||||
ActivationTime: t,
|
||||
BlobSchedule: c.BlobConfig(c.LatestFork(t)),
|
||||
|
|
|
|||
|
|
@ -3842,9 +3842,9 @@ func (b configTimeBackend) ChainConfig() *params.ChainConfig {
|
|||
return b.genesis.Config
|
||||
}
|
||||
|
||||
func (b configTimeBackend) BlockByNumber(_ context.Context, n rpc.BlockNumber) (*types.Block, error) {
|
||||
func (b configTimeBackend) HeaderByNumber(_ context.Context, n rpc.BlockNumber) (*types.Header, error) {
|
||||
if n == 0 {
|
||||
return b.genesis.ToBlock(), nil
|
||||
return b.genesis.ToBlock().Header(), nil
|
||||
}
|
||||
panic("not implemented")
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue