Skip to content

Commit

Permalink
Merge pull request ethereum#134 from OffchainLabs/fix-deposit-seriali…
Browse files Browse the repository at this point in the history
…zation

Fix Deposit deserialization
  • Loading branch information
rachel-bousfield authored Jul 27, 2022
2 parents 8c03425 + 14c789c commit 3b4acd1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions core/types/transaction_marshalling.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -437,13 +438,17 @@ 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")
}
inner = &ArbitrumDepositTx{
ChainId: (*big.Int)(dec.ChainID),
L1RequestId: *dec.RequestId,
To: *dec.To,
From: *dec.From,
Value: (*big.Int)(dec.Value),
}

Expand Down

0 comments on commit 3b4acd1

Please sign in to comment.