Skip to content

Commit

Permalink
internal/ethapi: support both input and data for personal_sendTransac…
Browse files Browse the repository at this point in the history
…tion (ethereum#23476)

Currently, setDefaults overwrites the transaction input value if only input is provided. This causes personal_sendTransaction to estimate the gas based on a transaction with empty data. eth_estimateGas never calls setDefaults so it was unaffected by this.
  • Loading branch information
lightclient authored and jagdeep sidhu committed Aug 27, 2021
1 parent 7458f5f commit 2cd32b3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion internal/ethapi/transaction_args.go
Expand Up @@ -146,14 +146,15 @@ func (args *TransactionArgs) setDefaults(ctx context.Context, b Backend) error {
if args.Gas == nil {
// These fields are immutable during the estimation, safe to
// pass the pointer directly.
data := args.data()
callArgs := TransactionArgs{
From: args.From,
To: args.To,
GasPrice: args.GasPrice,
MaxFeePerGas: args.MaxFeePerGas,
MaxPriorityFeePerGas: args.MaxPriorityFeePerGas,
Value: args.Value,
Data: args.Data,
Data: (*hexutil.Bytes)(&data),
AccessList: args.AccessList,
}
pendingBlockNr := rpc.BlockNumberOrHashWithNumber(rpc.PendingBlockNumber)
Expand Down

0 comments on commit 2cd32b3

Please sign in to comment.