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

feat(devx): Add filter flag to Iota CLI #2574

Merged
merged 19 commits into from
Nov 8, 2024

Conversation

salaheldinsoliman
Copy link
Contributor

@salaheldinsoliman salaheldinsoliman commented Sep 16, 2024

Description of change

This PR adds an emit flag to iota client call, whose functionality is to filter the outputs of the command.
The flag takes "effects" | "input" | "events" | "object_changes" | "balance_changes" as possible args.

This addresses the issue that call command result is often too long.

Note: the PR only addresses call. If the approach is agreed upon, it can be extended to ptb as well

Links to any relevant issues

fixes #2015

Type of change

Choose a type of change, and delete any options that are not relevant.

  • Enhancement (a non-breaking change which adds functionality)

How the change has been tested

  • Added tests in iota/tests/cli_tests

Change checklist

Tick the boxes that are relevant to your changes, and delete any items that are not.

  • I have followed the contribution guidelines for this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • I have checked that new and existing unit tests pass locally with my changes

@salaheldinsoliman salaheldinsoliman self-assigned this Sep 23, 2024
Copy link
Contributor

@kodemartin kodemartin left a comment

Choose a reason for hiding this comment

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

Hey @salaheldinsoliman!

I strongly believe that the functionality you want to expose should be handled exclusively on the client. I made several suggestion that essentially imply that all changes to dependencies (iota-indexer, iota-json-rpc, iota-json-rpc-types) should be reverted.

If you think that you need more options for the queries you are performing to expose this functionality, please create issues with the respective feature request so as to discuss them and plan them accordingly.

crates/iota-indexer/src/models/transactions.rs Outdated Show resolved Hide resolved
crates/iota-indexer/src/types.rs Outdated Show resolved Hide resolved
crates/iota-json-rpc-types/src/iota_transaction.rs Outdated Show resolved Hide resolved
crates/iota-json-rpc-types/src/iota_transaction.rs Outdated Show resolved Hide resolved
crates/iota-json-rpc-types/src/iota_transaction.rs Outdated Show resolved Hide resolved
Signed-off-by: salaheldinsoliman <[email protected]>
Signed-off-by: salaheldinsoliman <[email protected]>
Signed-off-by: salaheldinsoliman <[email protected]>
Signed-off-by: salaheldinsoliman <[email protected]>
@Thoralf-M
Copy link
Member

cargo +nightly fmt

@salaheldinsoliman
Copy link
Contributor Author

@Thoralf-M @DaughterOfMars Would it make sense to merge this at this stage (before the release)?

@DaughterOfMars
Copy link
Contributor

@Thoralf-M @DaughterOfMars Would it make sense to merge this at this stage (before the release)?

Not with failing tests, I would say

@Thoralf-M
Copy link
Member

The failing tests don't seem to be related to this PR, I don't see a reason not to merge it before the release

@DaughterOfMars
Copy link
Contributor

The failing tests don't seem to be related to this PR, I don't see a reason not to merge it before the release

Still a lot of comments I would prefer to be resolved first, but I'm not going to fight too hard

@Thoralf-M
Copy link
Member

Still a lot of comments I would prefer to be resolved first, but I'm not going to fight too hard

Nothing against that, but to me it looks like all of them are outdated (one from you #2574 (comment)) the others from @kodemartin

Only this tiny suggestion is still open, but also not important #2574 (comment)

@salaheldinsoliman salaheldinsoliman merged commit c445090 into develop Nov 8, 2024
36 of 40 checks passed
@salaheldinsoliman salaheldinsoliman deleted the devx/cli-output-filter branch November 8, 2024 13:00
@lzpap lzpap mentioned this pull request Nov 8, 2024
salaheldinsoliman added a commit that referenced this pull request Nov 8, 2024
Signed-off-by: salaheldinsoliman <[email protected]>
lzpap pushed a commit that referenced this pull request Nov 9, 2024
* fix(cli): fix cli_tests made by #2574

Signed-off-by: salaheldinsoliman <[email protected]>

* fix(cli): use default_value

Signed-off-by: salaheldinsoliman <[email protected]>

* fix(cli): run cargo fmt

Signed-off-by: salaheldinsoliman <[email protected]>

* fix(cli): properly parse EmitOptions

Signed-off-by: salaheldinsoliman <[email protected]>

* fix(cli): fix prerender_clever_errors

Signed-off-by: salaheldinsoliman <[email protected]>

---------

Signed-off-by: salaheldinsoliman <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
devx Issues related to the DevX team
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[Task(dev-tools/cli)] - Add filtering option to 'iota client call'
4 participants