@@ -6,6 +6,8 @@ import "openzeppelin-foundry-upgrades/Upgrades.sol";
66import "../contracts/DstackKms.sol " ;
77import "../contracts/DstackApp.sol " ;
88import "../contracts/IAppAuth.sol " ;
9+ import "../contracts/test-utils/DstackKmsV2.sol " ;
10+ import "../contracts/test-utils/DstackAppV2.sol " ;
911
1012contract UpgradesWithPluginTest is Test {
1113 address public owner;
@@ -73,7 +75,7 @@ contract UpgradesWithPluginTest is Test {
7375 kms.addKmsAggregatedMr (mrAggregated);
7476
7577 // Upgrade to new implementation using plugin
76- Upgrades.upgradeProxy (kmsProxy, "DstackKms .sol " , "" );
78+ Upgrades.upgradeProxy (kmsProxy, "DstackKmsV2 .sol " , "" );
7779
7880 // Verify state is preserved after upgrade
7981 assertEq (kms.owner (), owner);
@@ -102,7 +104,7 @@ contract UpgradesWithPluginTest is Test {
102104 app.setAllowAnyDevice (true );
103105
104106 // Upgrade to new implementation using plugin
105- Upgrades.upgradeProxy (appProxy, "DstackApp .sol " , "" );
107+ Upgrades.upgradeProxy (appProxy, "DstackAppV2 .sol " , "" );
106108
107109 // Verify state is preserved after upgrade
108110 assertEq (app.owner (), owner);
@@ -131,7 +133,7 @@ contract UpgradesWithPluginTest is Test {
131133 ("upgraded-gateway-id " )
132134 );
133135
134- Upgrades.upgradeProxy (kmsProxy, "DstackKms .sol " , initData);
136+ Upgrades.upgradeProxy (kmsProxy, "DstackKmsV2 .sol " , initData);
135137
136138 // Verify the initialization happened during upgrade
137139 assertEq (kms.gatewayAppId (), "upgraded-gateway-id " );
@@ -156,7 +158,7 @@ contract UpgradesWithPluginTest is Test {
156158 // - Proxy upgrade safety
157159
158160 // This should work fine since DstackKms is upgrade-safe
159- Upgrades.upgradeProxy (kmsProxy, "DstackKms .sol " , "" );
161+ Upgrades.upgradeProxy (kmsProxy, "DstackKmsV2 .sol " , "" );
160162
161163 vm.stopPrank ();
162164 }
@@ -177,7 +179,7 @@ contract UpgradesWithPluginTest is Test {
177179
178180 // Try to upgrade - should fail due to our custom _authorizeUpgrade logic
179181 vm.expectRevert ("Upgrades are permanently disabled " );
180- Upgrades.upgradeProxy (appProxy, "DstackApp .sol " , "" );
182+ Upgrades.upgradeProxy (appProxy, "DstackAppV2 .sol " , "" );
181183
182184 vm.stopPrank ();
183185 }
@@ -197,7 +199,7 @@ contract UpgradesWithPluginTest is Test {
197199 // Try to upgrade as non-owner
198200 vm.startPrank (user);
199201 vm.expectRevert ();
200- Upgrades.upgradeProxy (kmsProxy, "DstackKms .sol " , "" );
202+ Upgrades.upgradeProxy (kmsProxy, "DstackKmsV2 .sol " , "" );
201203 vm.stopPrank ();
202204 }
203205
@@ -235,8 +237,8 @@ contract UpgradesWithPluginTest is Test {
235237 kms.setGatewayAppId ("complex-test-gateway " );
236238
237239 // Upgrade both contracts
238- Upgrades.upgradeProxy (kmsProxy, "DstackKms .sol " , "" );
239- Upgrades.upgradeProxy (appId, "DstackApp .sol " , "" );
240+ Upgrades.upgradeProxy (kmsProxy, "DstackKmsV2 .sol " , "" );
241+ Upgrades.upgradeProxy (appId, "DstackAppV2 .sol " , "" );
240242
241243 // Verify everything still works after upgrades
242244 assertTrue (kms.allowedOsImages (osImageHash));
0 commit comments