MCPcopy Create free account
hub / github.com/Dstack-TEE/dstack / deployOldApp

Function deployOldApp

kms/auth-eth/test/DstackApp.upgrade.test.ts:20–36  ·  view source on GitHub ↗
(
    allowAnyDevice: boolean,
    initialDeviceId: string,
    initialComposeHash: string
  )

Source from the content-addressed store, hash-verified

18
19 // Deploy a proxy using the old 5-param initialize to simulate a pre-upgrade deployment.
20 async function deployOldApp(
21 allowAnyDevice: boolean,
22 initialDeviceId: string,
23 initialComposeHash: string
24 ): Promise<DstackApp> {
25 const factory = await ethers.getContractFactory("DstackApp");
26 const proxy = await hre.upgrades.deployProxy(
27 factory,
28 [owner.address, false, allowAnyDevice, initialDeviceId, initialComposeHash],
29 {
30 kind: "uups",
31 initializer: "initialize(address,bool,bool,bytes32,bytes32)",
32 }
33 ) as DstackApp;
34 await proxy.waitForDeployment();
35 return proxy;
36 }
37
38 // Upgrade an existing proxy to the (same, current) DstackApp implementation.
39 // In a real scenario the new bytecode would differ; hardhat-upgrades still validates

Callers 1

Calls 2

getContractFactoryMethod · 0.80
waitForDeploymentMethod · 0.65

Tested by

no test coverage detected