@@ -37,7 +37,7 @@ contract ManagerStandaloneMigrateBasic is ManagerStandalone {
37
37
uint64 rateLimitDuration
38
38
) ManagerStandalone (token, mode, chainId, rateLimitDuration) {}
39
39
40
- function _migrate () internal override {
40
+ function _migrate () internal view override {
41
41
_checkThresholdInvariants ();
42
42
_checkEndpointsInvariants ();
43
43
revert ("Proper migrate called " );
@@ -96,7 +96,7 @@ contract WormholeEndpointStandaloneMigrateBasic is WormholeEndpointStandalone {
96
96
address wormholeRelayerAddr
97
97
) WormholeEndpointStandalone (manager, wormholeCoreBridge, wormholeRelayerAddr) {}
98
98
99
- function _migrate () internal override {
99
+ function _migrate () internal pure override {
100
100
revert ("Proper migrate called " );
101
101
}
102
102
}
@@ -107,7 +107,7 @@ contract WormholeEndpointStandaloneImmutableCheck is WormholeEndpointStandalone
107
107
address wormholeRelayerAddr
108
108
) WormholeEndpointStandalone (address (0x1 ), wormholeCoreBridge, wormholeRelayerAddr) {}
109
109
110
- function _migrate () internal override {
110
+ function _migrate () internal pure override {
111
111
revert ("Proper migrate called " );
112
112
}
113
113
}
@@ -171,7 +171,6 @@ contract TestUpgrades is Test, IManagerEvents, IRateLimiterEvents {
171
171
172
172
function setUp () public virtual {
173
173
string memory url = "https://ethereum-goerli.publicnode.com " ;
174
- IWormhole wormhole = IWormhole (0x706abc4E45D419950511e474C7B9Ed348A4a716c );
175
174
vm.createSelectFork (url);
176
175
initialBlockTimestamp = vm.getBlockTimestamp ();
177
176
@@ -251,9 +250,7 @@ contract TestUpgrades is Test, IManagerEvents, IRateLimiterEvents {
251
250
WormholeEndpointStandalone wormholeEndpointChain1Implementation = new WormholeEndpointStandalone (
252
251
address (managerChain1), address (wormhole), address (relayer)
253
252
);
254
- managerChain1.upgradeEndpoint (
255
- address (wormholeEndpointChain1), address (wormholeEndpointChain1Implementation)
256
- );
253
+ wormholeEndpointChain1.upgrade (address (wormholeEndpointChain1Implementation));
257
254
258
255
basicFunctionality ();
259
256
}
@@ -281,19 +278,12 @@ contract TestUpgrades is Test, IManagerEvents, IRateLimiterEvents {
281
278
WormholeEndpointStandalone wormholeEndpointChain1Implementation = new WormholeEndpointStandalone (
282
279
address (managerChain1), address (wormhole), address (relayer)
283
280
);
284
- managerChain1.upgradeEndpoint (
285
- address (wormholeEndpointChain1), address (wormholeEndpointChain1Implementation)
286
- );
281
+ wormholeEndpointChain1.upgrade (address (wormholeEndpointChain1Implementation));
287
282
288
283
basicFunctionality ();
289
284
290
285
// Basic call to upgrade with the same contact as well
291
- WormholeEndpointStandalone wormholeEndpointChain1Implementation2 = new WormholeEndpointStandalone (
292
- address (managerChain1), address (wormhole), address (relayer)
293
- );
294
- managerChain1.upgradeEndpoint (
295
- address (wormholeEndpointChain1), address (wormholeEndpointChain1Implementation2)
296
- );
286
+ wormholeEndpointChain1.upgrade (address (wormholeEndpointChain1Implementation));
297
287
298
288
basicFunctionality ();
299
289
}
@@ -319,7 +309,7 @@ contract TestUpgrades is Test, IManagerEvents, IRateLimiterEvents {
319
309
WormholeEndpointStandalone newImplementation = new WormholeEndpointStandaloneLayoutChange (
320
310
address (managerChain1), address (wormhole), address (relayer)
321
311
);
322
- managerChain1. upgradeEndpoint ( address (wormholeEndpointChain1), address (newImplementation));
312
+ wormholeEndpointChain1. upgrade ( address (newImplementation));
323
313
324
314
address oldOwner = managerChain1.owner ();
325
315
WormholeEndpointStandaloneLayoutChange (address (wormholeEndpointChain1)).setData ();
@@ -350,9 +340,7 @@ contract TestUpgrades is Test, IManagerEvents, IRateLimiterEvents {
350
340
);
351
341
352
342
vm.expectRevert ("Proper migrate called " );
353
- managerChain1.upgradeEndpoint (
354
- address (wormholeEndpointChain1), address (wormholeEndpointChain1Implementation)
355
- );
343
+ wormholeEndpointChain1.upgrade (address (wormholeEndpointChain1Implementation));
356
344
357
345
basicFunctionality ();
358
346
}
@@ -381,9 +369,7 @@ contract TestUpgrades is Test, IManagerEvents, IRateLimiterEvents {
381
369
new WormholeEndpointStandaloneImmutableCheck (address (wormhole), address (relayer));
382
370
383
371
vm.expectRevert (); // Reverts with a panic on the assert. So, no way to tell WHY this happened.
384
- managerChain1.upgradeEndpoint (
385
- address (wormholeEndpointChain1), address (wormholeEndpointChain1Implementation)
386
- );
372
+ wormholeEndpointChain1.upgrade (address (wormholeEndpointChain1Implementation));
387
373
388
374
require (
389
375
wormholeEndpointChain1.manager () == oldManager, "Manager updated when it shouldn't be "
@@ -410,9 +396,7 @@ contract TestUpgrades is Test, IManagerEvents, IRateLimiterEvents {
410
396
new WormholeEndpointStandaloneImmutableAllow (address (wormhole), address (relayer));
411
397
412
398
//vm.expectRevert(); // Reverts with a panic on the assert. So, no way to tell WHY this happened.
413
- managerChain1.upgradeEndpoint (
414
- address (wormholeEndpointChain1), address (wormholeEndpointChain1Implementation)
415
- );
399
+ wormholeEndpointChain1.upgrade (address (wormholeEndpointChain1Implementation));
416
400
417
401
require (
418
402
wormholeEndpointChain1.manager () == address (0x1 ), "Manager updated when it shouldn't be "
@@ -465,15 +449,13 @@ contract TestUpgrades is Test, IManagerEvents, IRateLimiterEvents {
465
449
vm.expectRevert (
466
450
abi.encodeWithSelector (OwnableUpgradeable.OwnableUnauthorizedAccount.selector , userA)
467
451
);
468
- managerChain1. upgradeEndpoint (address (wormholeEndpointChain1), address ( 0x1 ));
452
+ wormholeEndpointChain1. upgrade (address (0x01 ));
469
453
470
454
// Basic call so that we can easily see what the new endpoint is.
471
455
WormholeEndpointStandalone wormholeEndpointChain1Implementation = new WormholeEndpointStandalone (
472
456
address (managerChain1), address (wormhole), address (relayer)
473
457
);
474
- managerChain1.upgradeEndpoint (
475
- address (wormholeEndpointChain1), address (wormholeEndpointChain1Implementation)
476
- );
458
+ wormholeEndpointChain1.upgrade (address (wormholeEndpointChain1Implementation));
477
459
basicFunctionality (); // Ensure that the upgrade was proper
478
460
479
461
// Test if we can 'migrate' from this point
0 commit comments