Skip to content

Commit

Permalink
feat: add check for config
Browse files Browse the repository at this point in the history
  • Loading branch information
stepanLav committed Nov 6, 2024
1 parent 02eb323 commit 5557af1
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions scripts/checkChainsConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,18 @@ function checkSpecNames(chainsJSON) {
return errors;
}

function checkMultisigProxyConfig(chainsJSON) {
const errors = [];
chainsJSON.forEach(chain => {
if (chain.options && chain.options.includes('multisig')) {
if (!chain.externalApi || !chain.externalApi.proxy) {
errors.push(`Chain "${chain.name}" has multisig enabled but missing externalApi.proxy configuration`);
}
}
});
return errors;
}

let hasError = false;

function checkChainsFile(filePath) {
Expand All @@ -55,6 +67,14 @@ function checkChainsFile(filePath) {

// check that new explorers were not added
checkBlockExplorers(chainsJSON)

const multisigProxyErrors = checkMultisigProxyConfig(chainsJSON);
if (multisigProxyErrors.length > 0) {
console.error(`Errors in file ${filePath}:`);
multisigProxyErrors.forEach(error => console.error(error));
hasError = true;
}

const specNameErrors = checkSpecNames(chainsJSON);
if (specNameErrors.length > 0) {
console.error(`Errors in file ${filePath}:`);
Expand Down

0 comments on commit 5557af1

Please sign in to comment.