signer/core/apitypes: require blob txs to have tx.to set (#32197)

Check the `to` address before building the blob tx.

---------

Co-authored-by: jwasinger <j-wasinger@hotmail.com>
This commit is contained in:
maskpp 2025-07-14 15:07:47 +08:00 committed by GitHub
parent b992b105ef
commit 055e1e6291
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -150,6 +150,9 @@ func (args *SendTxArgs) ToTransaction() (*types.Transaction, error) {
if args.AccessList != nil {
al = *args.AccessList
}
if to == nil {
return nil, fmt.Errorf("transaction recipient must be set for blob transactions")
}
data = &types.BlobTx{
To: *to,
ChainID: uint256.MustFromBig((*big.Int)(args.ChainID)),