Skip to content

Commit

Permalink
be explicit about which address fetch failed.
Browse files Browse the repository at this point in the history
  • Loading branch information
ankur2136 committed Jun 25, 2024
1 parent 6ea0e71 commit 445e18d
Showing 1 changed file with 20 additions and 5 deletions.
25 changes: 20 additions & 5 deletions packages/cli/src/CliUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,27 @@ export const checkMintedStatus = async (
new PublicKey(releaseAddr),
]);

const rentAccounts = results.filter(
(item) => !(item == undefined) && item?.lamports > 0
);
if (rentAccounts?.length != 3) {
const isPublisherMinted = results[0] != undefined && results[0]?.lamports > 0
const isAppMinted = results[1] != undefined && results[1]?.lamports > 0
const isReleaseMinted = results[2] != undefined && results[2]?.lamports > 0

let errorMessage = ``

if (!isPublisherMinted) {
errorMessage = errorMessage + `Publisher NFT fetch at address ${pubAddr} failed\n`
}
if (!isAppMinted) {
errorMessage = errorMessage + `App NFT fetch at address ${appAddr} failed\n`
}
if (!isReleaseMinted) {
errorMessage = errorMessage + `Release NFT fetch at address ${releaseAddr} failed\n`
}

if (!isPublisherMinted || !isAppMinted || !isReleaseMinted) {
throw new Error(
"Please ensure you have minted all of your NFTs before submitting to the Solana Mobile dApp publisher portal."
`Expected Publisher :: ${pubAddr}, App :: ${appAddr} and Release :: ${releaseAddr} to be minted before submission.\n
but ${errorMessage}\n
Please ensure you have minted all of your NFTs before submitting to the Solana Mobile dApp publisher portal.`
);
}
};
Expand Down

0 comments on commit 445e18d

Please sign in to comment.