Skip to content
This repository was archived by the owner on Oct 20, 2024. It is now read-only.

Commit afcf309

Browse files
authored
Use HeaderByNumber instead of BlockByNumber (#119)
1 parent 927f3a7 commit afcf309

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

pkg/modules/builder/client.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,11 @@ func (b *BuilderClient) SendUserOperation() modules.BatchHandlerFunc {
7878
}
7979
blkNum := big.NewInt(0).SetUint64(bn)
8080
NxtBlkNum := big.NewInt(0).Add(blkNum, big.NewInt(1))
81-
blk, _ := b.eth.BlockByNumber(context.Background(), blkNum)
81+
blk, err := b.eth.HeaderByNumber(context.Background(), blkNum)
8282
if err != nil {
8383
return err
8484
}
85-
mbf := blk.BaseFee()
85+
mbf := blk.BaseFee
8686
for i := 0; i < b.blocksInTheFuture; i++ {
8787
a := big.NewInt(0).Mul(mbf, big.NewInt(1125))
8888
b := big.NewInt(0).Div(a, big.NewInt(1000))

pkg/modules/checks/utils.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,10 @@ func getBaseFeeWithEthClient(eth *ethclient.Client) GetBaseFeeFunc {
5454
return nil, err
5555
}
5656

57-
blk, _ := eth.BlockByNumber(context.Background(), big.NewInt(0).SetUint64(bn))
57+
blk, err := eth.HeaderByNumber(context.Background(), big.NewInt(0).SetUint64(bn))
5858
if err != nil {
5959
return nil, err
6060
}
61-
return blk.BaseFee(), nil
61+
return blk.BaseFee, nil
6262
}
6363
}

0 commit comments

Comments
 (0)