Skip to content

Commit

Permalink
fix: unecessary? gas estimation
Browse files Browse the repository at this point in the history
  • Loading branch information
praetoriansentry committed Dec 8, 2023
1 parent 67ba980 commit 407235e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 13 deletions.
2 changes: 1 addition & 1 deletion cmd/loadtest/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ cc, contract-call - call a contract method`)
ltp.RecallLength = LoadtestCmd.Flags().Uint64("recall-blocks", 50, "The number of blocks that we'll attempt to fetch for recall")
ltp.ContractAddress = LoadtestCmd.Flags().String("contract-address", "", "The address of the contract that will be used in `--mode contract-call`. This must be paired up with `--mode contract-call` and `--calldata`")
ltp.ContractCallData = LoadtestCmd.Flags().String("calldata", "", "The hex encoded calldata passed in. The format is function signature + arguments encoded together. This must be paired up with `--mode contract-call` and `--contract-address`")
ltp.ContractCallPayable = LoadtestCmd.Flags().Bool("contract-call-payable", false, "Use this flag if the `--function-sig` is a `payable` function, the value amount passed will be from `--eth-amount`. This must be paired up with `--mode contract-call` and `--contract-address`")
ltp.ContractCallPayable = LoadtestCmd.Flags().Bool("contract-call-payable", false, "Use this flag if the function is payable, the value amount passed will be from `--eth-amount`. This must be paired up with `--mode contract-call` and `--contract-address`")

inputLoadTestParams = *ltp

Expand Down
12 changes: 0 additions & 12 deletions cmd/loadtest/loadtest.go
Original file line number Diff line number Diff line change
Expand Up @@ -1276,18 +1276,6 @@ func loadTestContractCall(ctx context.Context, c *ethclient.Client, nonce uint64
log.Error().Err(err).Msg("Unable to decode calldata string")
return
}
estimateInput := ethereum.CallMsg{
From: *ltp.FromETHAddress,
To: to,
Value: amount,
Data: calldata,
}
tops.GasLimit, err = c.EstimateGas(ctx, estimateInput)
if err != nil {
log.Error().Err(err).Msg("Unable to estimate gas for transaction")
return
}

var tx *ethtypes.Transaction
if *ltp.LegacyTransactionMode {
tx = ethtypes.NewTx(&ethtypes.LegacyTx{
Expand Down

0 comments on commit 407235e

Please sign in to comment.