return rawTx when signer is not preset and noSend is true

This commit is contained in:
Madhur Shrimal 2024-07-26 12:54:01 -07:00
parent f94baab238
commit 752303432f
No known key found for this signature in database
GPG key ID: E22E262D6538929B

View file

@ -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)