@@ -41,6 +41,7 @@ contract TestUpgrades is Test, IManagerEvents, IRateLimiterEvents {
41
41
0xcfb12303a19cde580bb4dd771639b0d26bc68353645571a8cff516ab2ee113a0 ;
42
42
WormholeSimulator guardian;
43
43
uint256 initialBlockTimestamp;
44
+ uint8 constant FAST_CONSISTENCY_LEVEL = 200 ;
44
45
45
46
WormholeEndpoint wormholeEndpointChain1;
46
47
WormholeEndpoint wormholeEndpointChain2;
@@ -68,7 +69,11 @@ contract TestUpgrades is Test, IManagerEvents, IRateLimiterEvents {
68
69
managerChain1.initialize ();
69
70
70
71
WormholeEndpoint wormholeEndpointChain1Implementation = new MockWormholeEndpointContract (
71
- address (managerChain1), address (wormhole), address (relayer), address (0x0 )
72
+ address (managerChain1),
73
+ address (wormhole),
74
+ address (relayer),
75
+ address (0x0 ),
76
+ FAST_CONSISTENCY_LEVEL
72
77
);
73
78
wormholeEndpointChain1 = MockWormholeEndpointContract (
74
79
address (new ERC1967Proxy (address (wormholeEndpointChain1Implementation), "" ))
@@ -90,7 +95,11 @@ contract TestUpgrades is Test, IManagerEvents, IRateLimiterEvents {
90
95
managerChain2.initialize ();
91
96
92
97
WormholeEndpoint wormholeEndpointChain2Implementation = new MockWormholeEndpointContract (
93
- address (managerChain2), address (wormhole), address (relayer), address (0x0 )
98
+ address (managerChain2),
99
+ address (wormhole),
100
+ address (relayer),
101
+ address (0x0 ),
102
+ FAST_CONSISTENCY_LEVEL
94
103
);
95
104
wormholeEndpointChain2 = MockWormholeEndpointContract (
96
105
address (new ERC1967Proxy (address (wormholeEndpointChain2Implementation), "" ))
@@ -131,7 +140,11 @@ contract TestUpgrades is Test, IManagerEvents, IRateLimiterEvents {
131
140
function test_basicUpgradeEndpoint () public {
132
141
// Basic call to upgrade with the same contact as well
133
142
WormholeEndpoint wormholeEndpointChain1Implementation = new MockWormholeEndpointContract (
134
- address (managerChain1), address (wormhole), address (relayer), address (0x0 )
143
+ address (managerChain1),
144
+ address (wormhole),
145
+ address (relayer),
146
+ address (0x0 ),
147
+ FAST_CONSISTENCY_LEVEL
135
148
);
136
149
wormholeEndpointChain1.upgrade (address (wormholeEndpointChain1Implementation));
137
150
@@ -159,7 +172,11 @@ contract TestUpgrades is Test, IManagerEvents, IRateLimiterEvents {
159
172
function test_doubleUpgradeEndpoint () public {
160
173
// Basic call to upgrade with the same contact as well
161
174
WormholeEndpoint wormholeEndpointChain1Implementation = new MockWormholeEndpointContract (
162
- address (managerChain1), address (wormhole), address (relayer), address (0x0 )
175
+ address (managerChain1),
176
+ address (wormhole),
177
+ address (relayer),
178
+ address (0x0 ),
179
+ FAST_CONSISTENCY_LEVEL
163
180
);
164
181
wormholeEndpointChain1.upgrade (address (wormholeEndpointChain1Implementation));
165
182
@@ -190,7 +207,11 @@ contract TestUpgrades is Test, IManagerEvents, IRateLimiterEvents {
190
207
function test_storageSlotEndpoint () public {
191
208
// Basic call to upgrade with the same contact as ewll
192
209
WormholeEndpoint newImplementation = new MockWormholeEndpointLayoutChange (
193
- address (managerChain1), address (wormhole), address (relayer), address (0x0 )
210
+ address (managerChain1),
211
+ address (wormhole),
212
+ address (relayer),
213
+ address (0x0 ),
214
+ FAST_CONSISTENCY_LEVEL
194
215
);
195
216
wormholeEndpointChain1.upgrade (address (newImplementation));
196
217
@@ -219,7 +240,11 @@ contract TestUpgrades is Test, IManagerEvents, IRateLimiterEvents {
219
240
function test_callMigrateEndpoint () public {
220
241
// Basic call to upgrade with the same contact as well
221
242
MockWormholeEndpointMigrateBasic wormholeEndpointChain1Implementation = new MockWormholeEndpointMigrateBasic (
222
- address (managerChain1), address (wormhole), address (relayer), address (0x0 )
243
+ address (managerChain1),
244
+ address (wormhole),
245
+ address (relayer),
246
+ address (0x0 ),
247
+ FAST_CONSISTENCY_LEVEL
223
248
);
224
249
225
250
vm.expectRevert ("Proper migrate called " );
@@ -248,7 +273,11 @@ contract TestUpgrades is Test, IManagerEvents, IRateLimiterEvents {
248
273
249
274
address oldManager = wormholeEndpointChain1.manager ();
250
275
WormholeEndpoint wormholeEndpointChain1Implementation = new MockWormholeEndpointMigrateBasic (
251
- address (managerChain2), address (wormhole), address (relayer), address (0x0 )
276
+ address (managerChain2),
277
+ address (wormhole),
278
+ address (relayer),
279
+ address (0x0 ),
280
+ FAST_CONSISTENCY_LEVEL
252
281
);
253
282
254
283
vm.expectRevert (); // Reverts with a panic on the assert. So, no way to tell WHY this happened.
@@ -276,7 +305,11 @@ contract TestUpgrades is Test, IManagerEvents, IRateLimiterEvents {
276
305
277
306
function test_immutableBlockUpdateSuccessEndpoint () public {
278
307
WormholeEndpoint wormholeEndpointChain1Implementation = new MockWormholeEndpointImmutableAllow (
279
- address (managerChain1), address (wormhole), address (relayer), address (0x0 )
308
+ address (managerChain1),
309
+ address (wormhole),
310
+ address (relayer),
311
+ address (0x0 ),
312
+ FAST_CONSISTENCY_LEVEL
280
313
);
281
314
282
315
//vm.expectRevert(); // Reverts with a panic on the assert. So, no way to tell WHY this happened.
@@ -338,7 +371,11 @@ contract TestUpgrades is Test, IManagerEvents, IRateLimiterEvents {
338
371
339
372
// Basic call so that we can easily see what the new endpoint is.
340
373
WormholeEndpoint wormholeEndpointChain1Implementation = new MockWormholeEndpointContract (
341
- address (managerChain1), address (wormhole), address (relayer), address (0x0 )
374
+ address (managerChain1),
375
+ address (wormhole),
376
+ address (relayer),
377
+ address (0x0 ),
378
+ FAST_CONSISTENCY_LEVEL
342
379
);
343
380
wormholeEndpointChain1.upgrade (address (wormholeEndpointChain1Implementation));
344
381
basicFunctionality (); // Ensure that the upgrade was proper
0 commit comments