From dc5ac3f2e1cce80ed1e4a84e6a0bfbd9955d8dae Mon Sep 17 00:00:00 2001 From: kristjanpeterson Date: Thu, 28 Apr 2022 14:50:31 +0300 Subject: [PATCH] Remove null checks for errors because errors with no content are not returned anymore, checking for "NOK" responses is sufficient --- utils/nftport/checkTxns.js | 2 +- utils/nftport/mint.js | 7 ++----- utils/nftport/revealNFTs.js | 2 +- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/utils/nftport/checkTxns.js b/utils/nftport/checkTxns.js index 308d4eb6..b1213585 100644 --- a/utils/nftport/checkTxns.js +++ b/utils/nftport/checkTxns.js @@ -37,7 +37,7 @@ async function main() { ? txnData.mintData.response : txnData.updateData.response; const err = - dir === "minted" ? txnData.mintData.error : txnData.updateData.error; + (dir === "minted" ? txnData.mintData.error : txnData.updateData.error) || null; const verified = dir === "minted" ? txnData.mintData.transaction_verified diff --git a/utils/nftport/mint.js b/utils/nftport/mint.js index af2fe287..5cbd0550 100644 --- a/utils/nftport/mint.js +++ b/utils/nftport/mint.js @@ -61,10 +61,7 @@ async function main() { const mintedFile = fs.readFileSync(mintFile); if (mintedFile.length > 0) { const mintedMeta = JSON.parse(mintedFile); - if ( - mintedMeta.mintData.response !== "OK" || - mintedMeta.mintData.error !== null - ) { + if (mintedMeta.mintData.response !== "OK") { console.log( `Response: ${mintedMeta.mintData.response}`, `Error: ${mintedMeta.mintData.error}`, @@ -128,7 +125,7 @@ async function main() { JSON.stringify(combinedData, null, 2) ); - if (mintData.response !== "OK" || mintData.error !== null) { + if (mintData.response !== "OK") { console.log( `Minting ${meta.name} failed :(`, `Response: ${mintData.response}`, diff --git a/utils/nftport/revealNFTs.js b/utils/nftport/revealNFTs.js index 769c4383..76bc8685 100644 --- a/utils/nftport/revealNFTs.js +++ b/utils/nftport/revealNFTs.js @@ -84,7 +84,7 @@ async function reveal() { const revealedFile = fs.readFileSync(revealedFilePath); if (revealedFile.length > 0) { const revealedFileJson = JSON.parse(revealedFile); - if (revealedFileJson.updateData.response !== "OK" || revealedFileJson.updateData.error !== null) { + if (revealedFileJson.updateData.response !== "OK") { throw "not revealed"; } else if(revealedFileJson.updateData.transaction_verified === true) { console.log(`${meta.name} already revealed.`);