Skip to content

Commit

Permalink
accounts/abi.bind: don't fetch head in transact unless required (#25988)
Browse files Browse the repository at this point in the history
If GasFeeCap and GasTipCap are specified, we don't need to retrieve the head block for constructing a transaction
  • Loading branch information
saman-pasha authored Nov 4, 2022
1 parent 6d55908 commit 33e23ee
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions accounts/abi/bind/base.go
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,8 @@ func (c *BoundContract) transact(opts *TransactOpts, contract *common.Address, i
)
if opts.GasPrice != nil {
rawTx, err = c.createLegacyTx(opts, contract, input)
} else if opts.GasFeeCap != nil && opts.GasTipCap != nil {
rawTx, err = c.createDynamicTx(opts, contract, input, nil)
} else {
// Only query for basefee if gasPrice not specified
if head, errHead := c.transactor.HeaderByNumber(ensureContext(opts.Context), nil); errHead != nil {
Expand Down

0 comments on commit 33e23ee

Please sign in to comment.