Skip to content

Commit

Permalink
Populate all current chain fork fields.
Browse files Browse the repository at this point in the history
Potential fix for #55
  • Loading branch information
mcdee committed May 27, 2024
1 parent 2a9f319 commit bebfd33
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion conn/currentbasefee.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,25 @@ func (c *Conn) CurrentBaseFee(ctx context.Context) (*big.Int, error) {
if err != nil {
return nil, errors.Wrap(err, fmt.Sprintf("failed to obtain block %d", blockNum))
}
zeroTime := uint64(0)
baseFee := eip1559.CalcBaseFee(&params.ChainConfig{
LondonBlock: big.NewInt(0),
HomesteadBlock: big.NewInt(0),
DAOForkBlock: big.NewInt(0),
EIP150Block: big.NewInt(0),
EIP155Block: big.NewInt(0),
EIP158Block: big.NewInt(0),
ByzantiumBlock: big.NewInt(0),
ConstantinopleBlock: big.NewInt(0),
PetersburgBlock: big.NewInt(0),
IstanbulBlock: big.NewInt(0),
MuirGlacierBlock: big.NewInt(0),
BerlinBlock: big.NewInt(0),
LondonBlock: big.NewInt(0),
ArrowGlacierBlock: big.NewInt(0),
GrayGlacierBlock: big.NewInt(0),
MergeNetsplitBlock: big.NewInt(0),
ShanghaiTime: &zeroTime,
CancunTime: &zeroTime,
}, block.Header())

return baseFee, nil
Expand Down

0 comments on commit bebfd33

Please sign in to comment.