Skip to content

[clijs] add receipt command#855

Merged
Gezort merged 1 commit intomainfrom
clijs-receipt
Apr 28, 2025
Merged

[clijs] add receipt command#855
Gezort merged 1 commit intomainfrom
clijs-receipt

Conversation

@Gezort
Copy link
Copy Markdown
Collaborator

@Gezort Gezort commented Apr 24, 2025

add receipt command to clijs. also during this I noticed that the CLI hangs for ~5-10 seconds after finishing the command logic
main reason seems to be in many promises hanging inside the node event loop. those are created during package imports or some open-rpc connections and closed only by timeout. so this PR also adds logic to exit from the process on success

@Gezort Gezort marked this pull request as ready for review April 24, 2025 13:56
@Gezort Gezort requested review from KlonD90 and ukorvl as code owners April 24, 2025 13:56
@Gezort Gezort enabled auto-merge April 24, 2025 13:56
expect(txHash).toBeTruthy();

const r = (await runCommand(["receipt", txHash])).result as ProcessedReceipt;
expect(r.success).toBeTruthy();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's also check that output contains the string Receipt data:.
By the way, I guess in the case of --quiet we only need to print the json itself.

Copy link
Copy Markdown
Collaborator Author

@Gezort Gezort Apr 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed. also fixed for the block command

regarding output: I haven't found an easy way to get it. inb4: r.stdout / r.stderr is empty

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't this approach work?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did some research, and found out that without disableConsoleIntercept in vitest, intercepting the output in runCommand doesn't work. They are in conflict. We need to figure out how to make them work together correctly.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm. The documentation for oclif/test explicitly says to use disableConsoleIntercept for vitest.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Gezort Gezort added this pull request to the merge queue Apr 28, 2025
Merged via the queue into main with commit 687aebe Apr 28, 2025
16 checks passed
@Gezort Gezort deleted the clijs-receipt branch April 28, 2025 09:53
@Gezort Gezort mentioned this pull request Apr 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants