mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-18 10:50:44 +00:00
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:
parent
d617f4fcdb
commit
c64f335b8d
1 changed files with 2 additions and 2 deletions
|
|
@ -474,8 +474,8 @@ func (tx *Transaction) UnmarshalJSON(input []byte) error {
|
|||
if dec.AccessList != nil {
|
||||
itx.AccessList = *dec.AccessList
|
||||
}
|
||||
if dec.AuthorizationList == nil {
|
||||
return errors.New("missing required field 'authorizationList' in transaction")
|
||||
if len(dec.AuthorizationList) == 0 {
|
||||
return errors.New("'authorizationList' must contain at least one authorization")
|
||||
}
|
||||
itx.AuthList = dec.AuthorizationList
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue