From 752303432fa6be290d362cc86e042cd47b0a722c Mon Sep 17 00:00:00 2001 From: Madhur Shrimal Date: Fri, 26 Jul 2024 12:54:01 -0700 Subject: [PATCH] return rawTx when signer is not preset and noSend is true --- accounts/abi/bind/base.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/accounts/abi/bind/base.go b/accounts/abi/bind/base.go index c8972a9dff..3abf32e10f 100644 --- a/accounts/abi/bind/base.go +++ b/accounts/abi/bind/base.go @@ -414,6 +414,10 @@ func (c *BoundContract) transact(opts *TransactOpts, contract *common.Address, i } // Sign the transaction and schedule it for execution if opts.Signer == nil { + if opts.NoSend { + // If no signer is provided, return the raw transaction + return rawTx, nil + } return nil, errors.New("no signer to authorize the transaction with") } signedTx, err := opts.Signer(opts.From, rawTx)