Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove null checks for errors because errors with no content are not … #156

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion utils/nftport/checkTxns.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 2 additions & 5 deletions utils/nftport/mint.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}`,
Expand Down Expand Up @@ -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}`,
Expand Down
2 changes: 1 addition & 1 deletion utils/nftport/revealNFTs.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.`);
Expand Down