1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
// Code generated by github.com/fjl/gencodec. DO NOT EDIT.
package ethclient
import (
"encoding/json"
"math/big"
"github.com/ethereum-optimism/optimism/l2geth/common"
"github.com/ethereum-optimism/optimism/l2geth/common/hexutil"
"github.com/ethereum-optimism/optimism/l2geth/core/types"
)
var _ = (*rpcTransactionMetaMarshaling)(nil)
// MarshalJSON marshals as JSON.
func (r rpcTransactionMeta) MarshalJSON() ([]byte, error) {
type rpcTransactionMeta struct {
L1BlockNumber *hexutil.Big `json:"l1BlockNumber"`
L1Timestamp hexutil.Uint64 `json:"l1Timestamp"`
L1MessageSender *common.Address `json:"l1MessageSender"`
QueueOrigin types.QueueOrigin `json:"queueOrigin"`
Index *hexutil.Uint64 `json:"index"`
QueueIndex *hexutil.Uint64 `json:"queueIndex"`
RawTransaction hexutil.Bytes `json:"rawTransaction"`
}
var enc rpcTransactionMeta
enc.L1BlockNumber = (*hexutil.Big)(r.L1BlockNumber)
enc.L1Timestamp = hexutil.Uint64(r.L1Timestamp)
enc.L1MessageSender = r.L1MessageSender
enc.QueueOrigin = r.QueueOrigin
enc.Index = (*hexutil.Uint64)(r.Index)
enc.QueueIndex = (*hexutil.Uint64)(r.QueueIndex)
enc.RawTransaction = r.RawTransaction
return json.Marshal(&enc)
}
// UnmarshalJSON unmarshals from JSON.
func (r *rpcTransactionMeta) UnmarshalJSON(input []byte) error {
type rpcTransactionMeta struct {
L1BlockNumber *hexutil.Big `json:"l1BlockNumber"`
L1Timestamp *hexutil.Uint64 `json:"l1Timestamp"`
L1MessageSender *common.Address `json:"l1MessageSender"`
QueueOrigin *types.QueueOrigin `json:"queueOrigin"`
Index *hexutil.Uint64 `json:"index"`
QueueIndex *hexutil.Uint64 `json:"queueIndex"`
RawTransaction *hexutil.Bytes `json:"rawTransaction"`
}
var dec rpcTransactionMeta
if err := json.Unmarshal(input, &dec); err != nil {
return err
}
if dec.L1BlockNumber != nil {
r.L1BlockNumber = (*big.Int)(dec.L1BlockNumber)
}
if dec.L1Timestamp != nil {
r.L1Timestamp = uint64(*dec.L1Timestamp)
}
if dec.L1MessageSender != nil {
r.L1MessageSender = dec.L1MessageSender
}
if dec.QueueOrigin != nil {
r.QueueOrigin = *dec.QueueOrigin
}
if dec.Index != nil {
r.Index = (*uint64)(dec.Index)
}
if dec.QueueIndex != nil {
r.QueueIndex = (*uint64)(dec.QueueIndex)
}
if dec.RawTransaction != nil {
r.RawTransaction = *dec.RawTransaction
}
return nil
}