Skip to content

Commit

Permalink
chore: positioning end of the script inside the interval
Browse files Browse the repository at this point in the history
  • Loading branch information
wainola committed Nov 8, 2023
1 parent 5e153b2 commit d1b39a6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
14 changes: 7 additions & 7 deletions examples/evm-to-evm-fungible-transfer/src/transfer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,20 +72,20 @@ export async function erc20Transfer(): Promise<void> {
.then((data) => {
if (data) {
dataResponse = data;
console.log(data);
console.log("Status of the transfer", data.status);
}
})
.catch((e) => {
console.log(e);
console.log("Transfer still not indexed, retrying...");
});
}, 5000);

if (dataResponse && dataResponse.status === "executed") {
console.log("Transfer executed successfully");
clearInterval(id);
process.exit(0);
}
if (dataResponse && dataResponse.status === "executed") {
console.log("Transfer executed successfully");
clearInterval(id);
process.exit(0);
}
}, 5000);
}

erc20Transfer().finally(() => {});
12 changes: 6 additions & 6 deletions examples/evm-to-substrate-fungible-transfer/src/transfer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,13 @@ export async function erc20Transfer(): Promise<void> {
.catch(() => {
console.log("Transfer still not indexed, retrying...");
});
}, 5000);

if (dataResponse && dataResponse.status === "executed") {
console.log("Transfer executed successfully");
clearInterval(id);
process.exit(0);
}
if (dataResponse && dataResponse.status === "executed") {
console.log("Transfer executed successfully");
clearInterval(id);
process.exit(0);
}
}, 5000);
}

erc20Transfer().finally(() => {});

0 comments on commit d1b39a6

Please sign in to comment.