mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-11 01:11:37 +00:00
core: fix genesis BAL hash
This commit is contained in:
parent
991887c6ee
commit
8fdccca0b7
2 changed files with 39 additions and 32 deletions
|
|
@ -34,6 +34,7 @@ func (g Genesis) MarshalJSON() ([]byte, error) {
|
||||||
BaseFee *math.HexOrDecimal256 `json:"baseFeePerGas"`
|
BaseFee *math.HexOrDecimal256 `json:"baseFeePerGas"`
|
||||||
ExcessBlobGas *math.HexOrDecimal64 `json:"excessBlobGas"`
|
ExcessBlobGas *math.HexOrDecimal64 `json:"excessBlobGas"`
|
||||||
BlobGasUsed *math.HexOrDecimal64 `json:"blobGasUsed"`
|
BlobGasUsed *math.HexOrDecimal64 `json:"blobGasUsed"`
|
||||||
|
BlockAccessListHash *common.Hash `json:"BlockAccessListHash,omitempty"`
|
||||||
SlotNumber *uint64 `json:"slotNumber"`
|
SlotNumber *uint64 `json:"slotNumber"`
|
||||||
}
|
}
|
||||||
var enc Genesis
|
var enc Genesis
|
||||||
|
|
@ -57,6 +58,7 @@ func (g Genesis) MarshalJSON() ([]byte, error) {
|
||||||
enc.BaseFee = (*math.HexOrDecimal256)(g.BaseFee)
|
enc.BaseFee = (*math.HexOrDecimal256)(g.BaseFee)
|
||||||
enc.ExcessBlobGas = (*math.HexOrDecimal64)(g.ExcessBlobGas)
|
enc.ExcessBlobGas = (*math.HexOrDecimal64)(g.ExcessBlobGas)
|
||||||
enc.BlobGasUsed = (*math.HexOrDecimal64)(g.BlobGasUsed)
|
enc.BlobGasUsed = (*math.HexOrDecimal64)(g.BlobGasUsed)
|
||||||
|
enc.BlockAccessListHash = g.BlockAccessListHash
|
||||||
enc.SlotNumber = g.SlotNumber
|
enc.SlotNumber = g.SlotNumber
|
||||||
return json.Marshal(&enc)
|
return json.Marshal(&enc)
|
||||||
}
|
}
|
||||||
|
|
@ -79,6 +81,7 @@ func (g *Genesis) UnmarshalJSON(input []byte) error {
|
||||||
BaseFee *math.HexOrDecimal256 `json:"baseFeePerGas"`
|
BaseFee *math.HexOrDecimal256 `json:"baseFeePerGas"`
|
||||||
ExcessBlobGas *math.HexOrDecimal64 `json:"excessBlobGas"`
|
ExcessBlobGas *math.HexOrDecimal64 `json:"excessBlobGas"`
|
||||||
BlobGasUsed *math.HexOrDecimal64 `json:"blobGasUsed"`
|
BlobGasUsed *math.HexOrDecimal64 `json:"blobGasUsed"`
|
||||||
|
BlockAccessListHash *common.Hash `json:"BlockAccessListHash,omitempty"`
|
||||||
SlotNumber *uint64 `json:"slotNumber"`
|
SlotNumber *uint64 `json:"slotNumber"`
|
||||||
}
|
}
|
||||||
var dec Genesis
|
var dec Genesis
|
||||||
|
|
@ -136,6 +139,9 @@ func (g *Genesis) UnmarshalJSON(input []byte) error {
|
||||||
if dec.BlobGasUsed != nil {
|
if dec.BlobGasUsed != nil {
|
||||||
g.BlobGasUsed = (*uint64)(dec.BlobGasUsed)
|
g.BlobGasUsed = (*uint64)(dec.BlobGasUsed)
|
||||||
}
|
}
|
||||||
|
if dec.BlockAccessListHash != nil {
|
||||||
|
g.BlockAccessListHash = dec.BlockAccessListHash
|
||||||
|
}
|
||||||
if dec.SlotNumber != nil {
|
if dec.SlotNumber != nil {
|
||||||
g.SlotNumber = dec.SlotNumber
|
g.SlotNumber = dec.SlotNumber
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -125,6 +125,7 @@ func ReadGenesis(db ethdb.Database) (*Genesis, error) {
|
||||||
genesis.ExcessBlobGas = genesisHeader.ExcessBlobGas
|
genesis.ExcessBlobGas = genesisHeader.ExcessBlobGas
|
||||||
genesis.BlobGasUsed = genesisHeader.BlobGasUsed
|
genesis.BlobGasUsed = genesisHeader.BlobGasUsed
|
||||||
genesis.SlotNumber = genesisHeader.SlotNumber
|
genesis.SlotNumber = genesisHeader.SlotNumber
|
||||||
|
genesis.BlockAccessListHash = genesisHeader.BlockAccessListHash
|
||||||
|
|
||||||
return &genesis, nil
|
return &genesis, nil
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue