Skip to content

Commit 3292356

Browse files
schmirezdac
authored andcommitted
Specify index to use in change-keyper-set via KEYPER_SET_INDEX
1 parent d8dd8d8 commit 3292356

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

contracts/scripts/change-keypers.js

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,24 @@ async function main() {
2020
console.error("please set DEPLOY_CONF environment variable");
2121
return;
2222
}
23+
24+
if (process.env.KEYPER_SET_INDEX === undefined) {
25+
console.error("please set KEYPER_SET_INDEX environment variable");
26+
return;
27+
}
28+
29+
const keyperSetIndex = parseInt(process.env.KEYPER_SET_INDEX);
30+
2331
// TODO can we get access to the hre in a script like this?
2432
// TODO use a different json file to determine the keyper changes
2533
const deployConf = JSON.parse(fs.readFileSync(process.env.DEPLOY_CONF));
2634

27-
const newKeyperSet = deployConf.keypers?.at(1);
35+
const newKeyperSet = deployConf.keypers?.at(keyperSetIndex);
2836
if (newKeyperSet === undefined) {
29-
console.error("no updated keyper set defined in DEPLOY_CONF");
37+
console.error(
38+
"no updated keyper set defined in DEPLOY_CONF at index %s",
39+
keyperSetIndex
40+
);
3041
return;
3142
}
3243

0 commit comments

Comments
 (0)