-
Notifications
You must be signed in to change notification settings - Fork 658
/
types.go
76 lines (67 loc) · 1.77 KB
/
types.go
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
76
package etherman
import (
"time"
"github.com/0xPolygonHermez/zkevm-node/etherman/smartcontracts/polygonzkevm"
"github.com/ethereum/go-ethereum/common"
)
// Block struct
type Block struct {
BlockNumber uint64
BlockHash common.Hash
ParentHash common.Hash
GlobalExitRoots []GlobalExitRoot
ForcedBatches []ForcedBatch
SequencedBatches [][]SequencedBatch
VerifiedBatches []VerifiedBatch
SequencedForceBatches [][]SequencedForceBatch
ForkIDs []ForkID
ReceivedAt time.Time
}
// GlobalExitRoot struct
type GlobalExitRoot struct {
BlockNumber uint64
MainnetExitRoot common.Hash
RollupExitRoot common.Hash
GlobalExitRoot common.Hash
}
// SequencedBatch represents virtual batch
type SequencedBatch struct {
BatchNumber uint64
SequencerAddr common.Address
TxHash common.Hash
Nonce uint64
Coinbase common.Address
polygonzkevm.PolygonZkEVMBatchData
}
// ForcedBatch represents a ForcedBatch
type ForcedBatch struct {
BlockNumber uint64
ForcedBatchNumber uint64
Sequencer common.Address
GlobalExitRoot common.Hash
RawTxsData []byte
ForcedAt time.Time
}
// VerifiedBatch represents a VerifiedBatch
type VerifiedBatch struct {
BlockNumber uint64
BatchNumber uint64
Aggregator common.Address
StateRoot common.Hash
TxHash common.Hash
}
// SequencedForceBatch is a sturct to track the ForceSequencedBatches event.
type SequencedForceBatch struct {
BatchNumber uint64
Coinbase common.Address
TxHash common.Hash
Timestamp time.Time
Nonce uint64
polygonzkevm.PolygonZkEVMForcedBatchData
}
// ForkID is a sturct to track the ForkID event.
type ForkID struct {
BatchNumber uint64
ForkID uint64
Version string
}