erigon-pulse/cmd/devnet/blocks/fees.go
Mark Holt c51573f333
Bor eth event flow (#8068)
Implemented polygon->eth flow
2023-08-25 12:19:39 +01:00

20 lines
408 B
Go

package blocks
import (
"context"
"fmt"
"github.com/ledgerwatch/erigon/cmd/devnet/devnet"
"github.com/ledgerwatch/erigon/rpc"
)
func BaseFeeFromBlock(ctx context.Context) (uint64, error) {
res, err := devnet.SelectNode(ctx).GetBlockByNumber(rpc.LatestBlockNumber, false)
if err != nil {
return 0, fmt.Errorf("failed to get base fee from block: %v\n", err)
}
return res.BaseFee.Uint64(), err
}