Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(IFL-2545): adds default limit for table output to 50 #5611

Merged
merged 1 commit into from
Nov 1, 2024

Conversation

jowparks
Copy link
Contributor

@jowparks jowparks commented Nov 1, 2024

Summary

  • adds default limit for table output to 50
  • prints message at end of table if limit is reached
  • updates commands to handle limit
  • Intentionally excluded table command updates for: multisig, genesis, and combine notes
  • Did not update print to occur on csv/json

Testing Plan

Tested all updated commands with --limit 1

     Timestamp                  Status       Type     Hash                                                             Expiration Submitted Sequence Fee Paid ($IRON) Asset                     Amount          
 ─── ────────────────────────── ──────────── ──────── ──────────────────────────────────────────────────────────────── ────────── ────────────────── ──────────────── ───────────────────────── ────────────────
     10/28/2024 2:45:48 PM PDT  confirmed    send     dc6116865d0e4e92df1e75c94afd951d6d2ca40eddd71b0900bcd270fa149bce 738792     738778             0.00000010       NORI              (f3b28) -1              
...
[see more rows by using --limit flag]

Documentation

Does this change require any updates to the Iron Fish Docs (ex. the RPC API
Reference
)? If yes, link a
related documentation pull request for the website.

[ ] Yes

Breaking Change

Is this a breaking change? If yes, add notes below on why this is breaking and label it with breaking-change-rpc or breaking-change-sdk.

[ ] Yes

for await (const note of response.contentStream()) {
if (notes.length >= flags.limit) {
break
}
if (!assetLookup.has(note.assetId)) {
assetLookup.set(
note.assetId,
(await client.wallet.getAsset({ id: note.assetId, account })).content,
)
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

These were rendering entire tables as individual rows. I updated to collect from the stream, not sure if this is desirable as at very large number of rows could cause memory issue (also output will not stream), but seemed like a reasonable tradeoff.

@jowparks jowparks marked this pull request as ready for review November 1, 2024 18:34
@jowparks jowparks requested a review from a team as a code owner November 1, 2024 18:34
@jowparks jowparks changed the title - adds default limit for table output to 50 chore(IFL-2545): adds default limit for table output to 50 Nov 1, 2024
ironfish-cli/src/ui/table.ts Outdated Show resolved Hide resolved
- prints message at end of table if limit is reached
- updates commands to handle limit
@jowparks jowparks merged commit 4596b89 into staging Nov 1, 2024
12 checks passed
@jowparks jowparks deleted the table-limit-output branch November 1, 2024 21:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants