Skip to content

Commit

Permalink
gas tip price estimation only for non legacy
Browse files Browse the repository at this point in the history
  • Loading branch information
gatsbyz committed Jun 29, 2023
1 parent ada49f5 commit 3abfe68
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions cmd/loadtest/loadtest.go
Original file line number Diff line number Diff line change
Expand Up @@ -327,12 +327,15 @@ func initializeLoadTestParams(ctx context.Context, c *ethclient.Client) error {
}
log.Trace().Interface("gasprice", gas).Msg("Retreived current gas price")

gasTipCap, err := c.SuggestGasTipCap(ctx)
if err != nil {
log.Error().Err(err).Msg("Unable to retrieve gas tip cap")
return err
if !*inputLoadTestParams.LegacyTransactionMode {
gasTipCap, err := c.SuggestGasTipCap(ctx)

Check failure on line 331 in cmd/loadtest/loadtest.go

View workflow job for this annotation

GitHub Actions / Lint

declaration of "err" shadows declaration at line 323
if err != nil {
log.Error().Err(err).Msg("Unable to retrieve gas tip cap")
return err
}
log.Trace().Interface("gastipcap", gasTipCap).Msg("Retreived current gas tip cap")
inputLoadTestParams.CurrentGasTipCap = gasTipCap
}
log.Trace().Interface("gastipcap", gasTipCap).Msg("Retreived current gas tip cap")

privateKey, err := ethcrypto.HexToECDSA(*inputLoadTestParams.PrivateKey)
if err != nil {
Expand Down Expand Up @@ -381,7 +384,6 @@ func initializeLoadTestParams(ctx context.Context, c *ethclient.Client) error {
inputLoadTestParams.CurrentNonce = &nonce
inputLoadTestParams.ECDSAPrivateKey = privateKey
inputLoadTestParams.FromETHAddress = &ethAddress
inputLoadTestParams.CurrentGasTipCap = gasTipCap

rand.Seed(*inputLoadTestParams.Seed)

Expand Down

0 comments on commit 3abfe68

Please sign in to comment.