From 0a6941be8e024d40cf09b909276f10d06071f0dc Mon Sep 17 00:00:00 2001 From: Hadrien Croubois Date: Thu, 7 Mar 2024 18:20:08 +0100 Subject: [PATCH] force presente of to in eip-5806 delegate tx --- core/types/transaction_marshalling.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/types/transaction_marshalling.go b/core/types/transaction_marshalling.go index 9d2bb6b61c..eeeb297ce6 100644 --- a/core/types/transaction_marshalling.go +++ b/core/types/transaction_marshalling.go @@ -420,9 +420,10 @@ func (tx *Transaction) UnmarshalJSON(input []byte) error { return errors.New("missing required field 'nonce' in transaction") } itx.Nonce = uint64(*dec.Nonce) - if dec.To != nil { - itx.To = dec.To + if dec.To == nil { + return errors.New("missing required field 'to' in transaction") } + itx.To = *dec.To if dec.Gas == nil { return errors.New("missing required field 'gas' for txdata") }