Skip to content

Commit aa71315

Browse files
authored
Merge pull request #156 from kristjanpeterson1/error-response-checking
Remove null checks for errors because errors with no content are not …
2 parents e57d27d + dc5ac3f commit aa71315

File tree

3 files changed

+4
-7
lines changed

3 files changed

+4
-7
lines changed

utils/nftport/checkTxns.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ async function main() {
3737
? txnData.mintData.response
3838
: txnData.updateData.response;
3939
const err =
40-
dir === "minted" ? txnData.mintData.error : txnData.updateData.error;
40+
(dir === "minted" ? txnData.mintData.error : txnData.updateData.error) || null;
4141
const verified =
4242
dir === "minted"
4343
? txnData.mintData.transaction_verified

utils/nftport/mint.js

+2-5
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,7 @@ async function main() {
6161
const mintedFile = fs.readFileSync(mintFile);
6262
if (mintedFile.length > 0) {
6363
const mintedMeta = JSON.parse(mintedFile);
64-
if (
65-
mintedMeta.mintData.response !== "OK" ||
66-
mintedMeta.mintData.error !== null
67-
) {
64+
if (mintedMeta.mintData.response !== "OK") {
6865
console.log(
6966
`Response: ${mintedMeta.mintData.response}`,
7067
`Error: ${mintedMeta.mintData.error}`,
@@ -128,7 +125,7 @@ async function main() {
128125
JSON.stringify(combinedData, null, 2)
129126
);
130127

131-
if (mintData.response !== "OK" || mintData.error !== null) {
128+
if (mintData.response !== "OK") {
132129
console.log(
133130
`Minting ${meta.name} failed :(`,
134131
`Response: ${mintData.response}`,

utils/nftport/revealNFTs.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ async function reveal() {
8484
const revealedFile = fs.readFileSync(revealedFilePath);
8585
if (revealedFile.length > 0) {
8686
const revealedFileJson = JSON.parse(revealedFile);
87-
if (revealedFileJson.updateData.response !== "OK" || revealedFileJson.updateData.error !== null) {
87+
if (revealedFileJson.updateData.response !== "OK") {
8888
throw "not revealed";
8989
} else if(revealedFileJson.updateData.transaction_verified === true) {
9090
console.log(`${meta.name} already revealed.`);

0 commit comments

Comments
 (0)