confirmation check added

This commit is contained in:
Shriya Tyagi 2022-06-09 15:14:04 +05:30
parent 4d9ab4a4cd
commit 681605b710

View File

@ -179,18 +179,8 @@ describe("Socket Connector", function () {
const tx = await dsaWallet0.connect(wallet0).cast(...encodeSpells(spells), wallet0.address);
let receipt = await tx.wait();
const txHash = receipt.transactionHash;
console.log("Receipt confimation: ", await receipt.confirmations);
console.log('Bridging Transaction : ', receipt.transactionHash);
const txStatus = setInterval(async () => {
const status = await getBridgeStatus(txHash, fromChainId, toChainId);
console.log(`SOURCE TX : ${status.result.sourceTxStatus}\nDEST TX : ${status.result.destinationTxStatus}`)
if (status.result.destinationTxStatus == "COMPLETED") {
console.log('DEST TX HASH :', status.result.destinationTransactionHash);
clearInterval(txStatus);
}
}, 80000);
});
it("should migrate ETH from Eth to Polygon", async function () {
@ -229,18 +219,8 @@ describe("Socket Connector", function () {
const tx = await dsaWallet0.connect(wallet0).cast(...encodeSpells(spells), wallet0.address);
let receipt = await tx.wait();
const txHash = receipt.transactionHash;
console.log("Receipt confimation: ", await receipt.confirmations);
console.log('Bridging Transaction : ', receipt.transactionHash);
const txStatus = setInterval(async () => {
const status = await getBridgeStatus(txHash, fromChainId, toChainId);
console.log(`SOURCE TX : ${status.result.sourceTxStatus}\nDEST TX : ${status.result.destinationTxStatus}`)
if (status.result.destinationTxStatus == "COMPLETED") {
console.log('DEST TX HASH :', status.result.destinationTransactionHash);
clearInterval(txStatus);
}
}, 80000);
});
});
});