Repository navigation
Expand file tree
/
Copy pathsystem.go
More file actions
61 lines (50 loc) · 1.55 KB
/
Copy pathsystem.go
File metadata and controls
61 lines (50 loc) · 1.55 KB
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
package stack
import (
"time"
"github.com/ethereum-optimism/optimism/op-service/eth"
)
// System represents a collection of L1 and L2 chains, any superchains or clusters, and any peripherals.
type System interface {
Common
Superchain(m SuperchainMatcher) Superchain
Cluster(m ClusterMatcher) Cluster
L1Network(m L1NetworkMatcher) L1Network
L2Network(m L2NetworkMatcher) L2Network
Network(id eth.ChainID) Network
Supervisor(m SupervisorMatcher) Supervisor
TestSequencer(id TestSequencerMatcher) TestSequencer
SuperchainIDs() []SuperchainID
ClusterIDs() []ClusterID
L1NetworkIDs() []L1NetworkID
L2NetworkIDs() []L2NetworkID
SupervisorIDs() []SupervisorID
Superchains() []Superchain
Clusters() []Cluster
L1Networks() []L1Network
L2Networks() []L2Network
Supervisors() []Supervisor
TestSequencers() []TestSequencer
}
// ExtensibleSystem is an extension-interface to add new components to the system.
// Regular tests should not be modifying the system.
// Test gates may use this to remediate any shortcomings of an existing system.
type ExtensibleSystem interface {
System
AddSuperchain(v Superchain)
AddCluster(v Cluster)
AddL1Network(v L1Network)
AddL2Network(v L2Network)
AddSupervisor(v Supervisor)
AddTestSequencer(v TestSequencer)
AddSyncTester(v SyncTester)
}
type TimeTravelClock interface {
AdvanceTime(d time.Duration)
}
// TimeTravelSystem is an extension-interface to support time travel.
type TimeTravelSystem interface {
System
SetTimeTravelClock(cl TimeTravelClock)
TimeTravelEnabled() bool
AdvanceTime(amount time.Duration)
}