Skip to content

Commit

Permalink
EstimateGas ignores provided nonce and sets correct nonce from state
Browse files Browse the repository at this point in the history
  • Loading branch information
jdowning100 committed Oct 30, 2024
1 parent 7246e14 commit 3025495
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions internal/quaiapi/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -573,14 +573,12 @@ func DoCall(ctx context.Context, b Backend, args TransactionArgs, blockNrOrHash
// this makes sure resources are cleaned up.
defer cancel()

if args.Nonce == nil {
internal, err := args.from(b.NodeLocation()).InternalAndQuaiAddress()
if err != nil {
return nil, err
}
nonce := state.GetNonce(internal)
args.Nonce = (*hexutil.Uint64)(&nonce)
internal, err := args.from(b.NodeLocation()).InternalAndQuaiAddress()
if err != nil {
return nil, err
}
nonce := state.GetNonce(internal)
args.Nonce = (*hexutil.Uint64)(&nonce) // Ignore provided nonce, reset to correct nonce

// Get a new instance of the EVM.
msg, err := args.ToMessage(globalGasCap, header.BaseFee(), b.NodeLocation())
Expand Down

0 comments on commit 3025495

Please sign in to comment.