@@ -9,9 +9,12 @@ import (
9
9
10
10
"github.com/ethereum/go-ethereum/common"
11
11
"github.com/ethereum/go-ethereum/common/hexutil"
12
+ "github.com/ethereum/go-ethereum/log"
12
13
"github.com/ethereum/go-ethereum/rpc"
13
14
14
15
"github.com/stretchr/testify/require"
16
+
17
+ "github.com/ethereum-optimism/optimism/op-service/testlog"
15
18
)
16
19
17
20
func TestConfigDataMarshalUnmarshal (t * testing.T ) {
@@ -23,6 +26,8 @@ func TestConfigDataMarshalUnmarshal(t *testing.T) {
23
26
require .NoError (t , dec .Decode (decoded ))
24
27
require .EqualValues (t , "non-default value" , string (decoded .L2GenesisBlockExtraData ))
25
28
29
+ require .NoError (t , decoded .Check (testlog .Logger (t , log .LevelDebug )))
30
+
26
31
encoded , err := json .MarshalIndent (decoded , "" , " " )
27
32
require .NoError (t , err )
28
33
require .JSONEq (t , string (b ), string (encoded ))
@@ -39,25 +44,37 @@ func TestUnmarshalL1StartingBlockTag(t *testing.T) {
39
44
40
45
func TestRegolithTimeZero (t * testing.T ) {
41
46
regolithOffset := hexutil .Uint64 (0 )
42
- config := & DeployConfig {L2GenesisRegolithTimeOffset : & regolithOffset }
47
+ config := & DeployConfig {
48
+ L2InitializationConfig : L2InitializationConfig {
49
+ UpgradeScheduleDeployConfig : UpgradeScheduleDeployConfig {
50
+ L2GenesisRegolithTimeOffset : & regolithOffset }}}
43
51
require .Equal (t , uint64 (0 ), * config .RegolithTime (1234 ))
44
52
}
45
53
46
54
func TestRegolithTimeAsOffset (t * testing.T ) {
47
55
regolithOffset := hexutil .Uint64 (1500 )
48
- config := & DeployConfig {L2GenesisRegolithTimeOffset : & regolithOffset }
56
+ config := & DeployConfig {
57
+ L2InitializationConfig : L2InitializationConfig {
58
+ UpgradeScheduleDeployConfig : UpgradeScheduleDeployConfig {
59
+ L2GenesisRegolithTimeOffset : & regolithOffset }}}
49
60
require .Equal (t , uint64 (1500 + 5000 ), * config .RegolithTime (5000 ))
50
61
}
51
62
52
63
func TestCanyonTimeZero (t * testing.T ) {
53
64
canyonOffset := hexutil .Uint64 (0 )
54
- config := & DeployConfig {L2GenesisCanyonTimeOffset : & canyonOffset }
65
+ config := & DeployConfig {
66
+ L2InitializationConfig : L2InitializationConfig {
67
+ UpgradeScheduleDeployConfig : UpgradeScheduleDeployConfig {
68
+ L2GenesisCanyonTimeOffset : & canyonOffset }}}
55
69
require .Equal (t , uint64 (0 ), * config .CanyonTime (1234 ))
56
70
}
57
71
58
72
func TestCanyonTimeOffset (t * testing.T ) {
59
73
canyonOffset := hexutil .Uint64 (1500 )
60
- config := & DeployConfig {L2GenesisCanyonTimeOffset : & canyonOffset }
74
+ config := & DeployConfig {
75
+ L2InitializationConfig : L2InitializationConfig {
76
+ UpgradeScheduleDeployConfig : UpgradeScheduleDeployConfig {
77
+ L2GenesisCanyonTimeOffset : & canyonOffset }}}
61
78
require .Equal (t , uint64 (1234 + 1500 ), * config .CanyonTime (1234 ))
62
79
}
63
80
0 commit comments