Skip to content

Commit fcd7bdc

Browse files
authored
Merge pull request ethereum#23062 from nfeignon/fix-abi-bind-ensure-context
accounts/abi/bind: call ensureContext on every context
2 parents 1e44c35 + c63c2d8 commit fcd7bdc

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

accounts/abi/bind/base.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -229,13 +229,13 @@ func (c *BoundContract) transact(opts *TransactOpts, contract *common.Address, i
229229
if opts.GasPrice != nil && (opts.GasFeeCap != nil || opts.GasTipCap != nil) {
230230
return nil, errors.New("both gasPrice and (maxFeePerGas or maxPriorityFeePerGas) specified")
231231
}
232-
head, err := c.transactor.HeaderByNumber(opts.Context, nil)
232+
head, err := c.transactor.HeaderByNumber(ensureContext(opts.Context), nil)
233233
if err != nil {
234234
return nil, err
235235
}
236236
if head.BaseFee != nil && opts.GasPrice == nil {
237237
if opts.GasTipCap == nil {
238-
tip, err := c.transactor.SuggestGasTipCap(opts.Context)
238+
tip, err := c.transactor.SuggestGasTipCap(ensureContext(opts.Context))
239239
if err != nil {
240240
return nil, err
241241
}
@@ -256,7 +256,7 @@ func (c *BoundContract) transact(opts *TransactOpts, contract *common.Address, i
256256
return nil, errors.New("maxFeePerGas or maxPriorityFeePerGas specified but london is not active yet")
257257
}
258258
if opts.GasPrice == nil {
259-
price, err := c.transactor.SuggestGasTipCap(opts.Context)
259+
price, err := c.transactor.SuggestGasTipCap(ensureContext(opts.Context))
260260
if err != nil {
261261
return nil, err
262262
}

0 commit comments

Comments
 (0)