Skip to content

Commit

Permalink
fix: show pending tx status (#7887)
Browse files Browse the repository at this point in the history
Small QoL improvement running the cli
  • Loading branch information
alexghr authored Aug 9, 2024
1 parent 43fff40 commit 088aae5
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions yarn-project/cli/src/inspect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,23 +44,22 @@ export async function inspectTx(
pxe.getTxEffect(txHash),
pxe.getIncomingNotes({ txHash, status: NoteStatus.ACTIVE_OR_NULLIFIED }),
]);
// Base tx data
log(`Tx ${txHash.toString()}`);
log(` Status: ${receipt.status} ${effects ? `(${effects.revertCode.getDescription()}})` : ''})`);
if (receipt.error) {
log(` Error: ${receipt.error}`);
}

if (!receipt || !effects) {
log(`No receipt or effects found for transaction hash ${txHash.toString()}`);
if (!effects) {
return;
}

const artifactMap = opts?.artifactMap ?? (await getKnownArtifacts(pxe));

// Base tx data
log(`Tx ${txHash.toString()}`);
if (opts.includeBlockInfo) {
log(` Block: ${receipt.blockNumber} (${receipt.blockHash?.toString('hex')})`);
}
log(` Status: ${receipt.status} (${effects.revertCode.getDescription()})`);
if (receipt.error) {
log(` Error: ${receipt.error}`);
}
if (receipt.transactionFee) {
log(` Fee: ${receipt.transactionFee.toString()}`);
}
Expand Down

0 comments on commit 088aae5

Please sign in to comment.