Skip to content

Commit

Permalink
chore(sui): improve error message for deployment (#387)
Browse files Browse the repository at this point in the history
Co-authored-by: Milap Sheth <[email protected]>
  • Loading branch information
npty and milapsheth authored Sep 30, 2024
1 parent ace4b81 commit 74452c5
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions sui/deploy-contract.js
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,15 @@ async function deploy(keypair, client, supportedContract, config, chain, options
// Print warning if version mismatch from defined version in version.json
checkSuiVersionMatch();

// Check if dependencies are deployed
const dependencies = getLocalDependencies(packageDir, `${__dirname}/../node_modules/@axelar-network/axelar-cgp-sui/move`);

for (const { name } of dependencies) {
if (!chain.contracts[name]) {
throw new Error(`Contract ${name} needed to be deployed before deploying ${packageName}`);
}
}

// Deploy package
const published = await deployPackage(packageDir, client, keypair, options);

Expand Down

0 comments on commit 74452c5

Please sign in to comment.