Skip to content

Commit 60219be

Browse files
committed
fix(run.ts): commit transaction not included
Fix the issue where the transaction was successfully committed and a transaction hash was obtained, but the transaction was never included in a block. Add a wait mechanism to ensure the transaction is mined or log the error reason if it fails.
1 parent 979e11f commit 60219be

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/run.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -614,6 +614,14 @@ async function main() {
614614
console.log(`Commit Tx: ${commitResult.hash}`);
615615
console.log(`Commit Explorer: ${blockchain.explorerBaseUrl}/${commitResult.hash}`);
616616

617+
try {
618+
// Wait for the transaction to be mined
619+
const transactionReceipt = await commitResult.wait();
620+
console.log(`Block Number: ${transactionReceipt.blockNumber}`);
621+
} catch (error) {
622+
console.error(`Transaction error: ${error}`);
623+
}
624+
617625
// Reset stage
618626
await setWorkingAssetCid("");
619627

0 commit comments

Comments
 (0)