Skip to content

Commit

Permalink
txfuzz: add more error logs (#53)
Browse files Browse the repository at this point in the history
  • Loading branch information
MariusVanDerWijden authored May 15, 2024
1 parent 75cb788 commit 2ffc423
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions transactions.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/crypto/kzg4844"
"github.com/ethereum/go-ethereum/ethclient"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/params"
"github.com/ethereum/go-ethereum/rpc"
"github.com/holiman/uint256"
Expand Down Expand Up @@ -61,12 +62,14 @@ func initDefaultTxConf(rpc *rpc.Client, f *filler.Filler, sender common.Address,
if gasPrice == nil {
gasPrice, err = client.SuggestGasPrice(context.Background())
if err != nil {
log.Warn("Error suggesting gas price: %v", err)
gasPrice = big.NewInt(1)
}
}
if chainID == nil {
chainID, err = client.ChainID(context.Background())
if err != nil {
log.Warn("Error fetching chain id: %v", err)
chainID = big.NewInt(1)
}
}
Expand All @@ -82,6 +85,7 @@ func initDefaultTxConf(rpc *rpc.Client, f *filler.Filler, sender common.Address,
Data: code,
})
if err == nil {
log.Warn("Error estimating gas: %v", err)
gasCost = gas
}
}
Expand Down

0 comments on commit 2ffc423

Please sign in to comment.