core/types: reject empty authorizationList in SetCodeTx JSON

Check len(authorizationList) instead of nil so an empty array is
rejected with a clear error, consistent with blobVersionedHashes.
This commit is contained in:
Weixie Cui 2026-07-03 20:00:00 +08:00
parent d617f4fcdb
commit c64f335b8d

View file

@ -474,8 +474,8 @@ func (tx *Transaction) UnmarshalJSON(input []byte) error {
if dec.AccessList != nil { if dec.AccessList != nil {
itx.AccessList = *dec.AccessList itx.AccessList = *dec.AccessList
} }
if dec.AuthorizationList == nil { if len(dec.AuthorizationList) == 0 {
return errors.New("missing required field 'authorizationList' in transaction") return errors.New("'authorizationList' must contain at least one authorization")
} }
itx.AuthList = dec.AuthorizationList itx.AuthList = dec.AuthorizationList