mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-24 05:36:46 +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.
|
// Config implements the EIP-7910 eth_config method.
|
||||||
func (api *BlockChainAPI) Config(ctx context.Context) (*configResponse, error) {
|
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 {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("unable to load genesis: %w", err)
|
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) {
|
for addr, c := range vm.ActivePrecompiledContracts(rules) {
|
||||||
precompiles[c.Name()] = addr
|
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{
|
return &config{
|
||||||
ActivationTime: t,
|
ActivationTime: t,
|
||||||
BlobSchedule: c.BlobConfig(c.LatestFork(t)),
|
BlobSchedule: c.BlobConfig(c.LatestFork(t)),
|
||||||
|
|
|
||||||
|
|
@ -3842,9 +3842,9 @@ func (b configTimeBackend) ChainConfig() *params.ChainConfig {
|
||||||
return b.genesis.Config
|
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 {
|
if n == 0 {
|
||||||
return b.genesis.ToBlock(), nil
|
return b.genesis.ToBlock().Header(), nil
|
||||||
}
|
}
|
||||||
panic("not implemented")
|
panic("not implemented")
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue