From 14c789c055b08d570023cc2ac9419b4ee26ee226 Mon Sep 17 00:00:00 2001 From: Rachel Franks Date: Tue, 26 Jul 2022 20:38:42 -0500 Subject: [PATCH] add from field --- core/types/transaction_marshalling.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/types/transaction_marshalling.go b/core/types/transaction_marshalling.go index d24f3388618c..9c3b629cd408 100644 --- a/core/types/transaction_marshalling.go +++ b/core/types/transaction_marshalling.go @@ -139,6 +139,7 @@ func (t *Transaction) MarshalJSON() ([]byte, error) { enc.Data = (*hexutil.Bytes)(&tx.Data) case *ArbitrumDepositTx: enc.RequestId = &tx.L1RequestId + enc.From = &tx.From enc.ChainID = (*hexutil.Big)(tx.ChainId) enc.Value = (*hexutil.Big)(tx.Value) enc.To = t.To() @@ -437,6 +438,9 @@ func (t *Transaction) UnmarshalJSON(input []byte) error { if dec.To == nil { return errors.New("missing required field 'to' in transaction") } + if dec.From == nil { + return errors.New("missing required field 'from' in transaction") + } if dec.Value == nil { return errors.New("missing required field 'value' in transaction") } @@ -444,6 +448,7 @@ func (t *Transaction) UnmarshalJSON(input []byte) error { ChainId: (*big.Int)(dec.ChainID), L1RequestId: *dec.RequestId, To: *dec.To, + From: *dec.From, Value: (*big.Int)(dec.Value), }