Skip to content

Commit a3add4f

Browse files
authored
Merge pull request #147 from Dstack-TEE/error-on-wrong-contract
kms script: Throw error if app auth not found
2 parents 8d120e1 + 5f0418a commit a3add4f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

kms/auth-eth/hardhat.config.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,9 @@ async function getKmsAuth(ethers: any) {
7878
async function getAppAuth(ethers: any, appId: string) {
7979
const kmsAuth = await getKmsAuth(ethers);
8080
const controller = (await kmsAuth.apps(appId)).controller;
81+
if (controller === ethers.ZeroAddress) {
82+
throw new Error("AppAuth contract not found");
83+
}
8184
console.log("AppAuth address:", controller);
8285
return await ethers.getContractAt("AppAuth", controller);
8386
}

0 commit comments

Comments
 (0)