From c63c2d855e6febeb351fa190a442cb37f6609ca1 Mon Sep 17 00:00:00 2001 From: Nicolas Feignon Date: Thu, 17 Jun 2021 14:04:24 +0200 Subject: [PATCH] accounts/abi/bind: call ensureContext on every context --- accounts/abi/bind/base.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/accounts/abi/bind/base.go b/accounts/abi/bind/base.go index 71648059c8..0543c05ffa 100644 --- a/accounts/abi/bind/base.go +++ b/accounts/abi/bind/base.go @@ -229,13 +229,13 @@ func (c *BoundContract) transact(opts *TransactOpts, contract *common.Address, i if opts.GasPrice != nil && (opts.GasFeeCap != nil || opts.GasTipCap != nil) { return nil, errors.New("both gasPrice and (maxFeePerGas or maxPriorityFeePerGas) specified") } - head, err := c.transactor.HeaderByNumber(opts.Context, nil) + head, err := c.transactor.HeaderByNumber(ensureContext(opts.Context), nil) if err != nil { return nil, err } if head.BaseFee != nil && opts.GasPrice == nil { if opts.GasTipCap == nil { - tip, err := c.transactor.SuggestGasTipCap(opts.Context) + tip, err := c.transactor.SuggestGasTipCap(ensureContext(opts.Context)) if err != nil { return nil, err } @@ -256,7 +256,7 @@ func (c *BoundContract) transact(opts *TransactOpts, contract *common.Address, i return nil, errors.New("maxFeePerGas or maxPriorityFeePerGas specified but london is not active yet") } if opts.GasPrice == nil { - price, err := c.transactor.SuggestGasTipCap(opts.Context) + price, err := c.transactor.SuggestGasTipCap(ensureContext(opts.Context)) if err != nil { return nil, err }