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: added denom-owners grpc_web api and cli query #2508

Merged
merged 10 commits into from
Apr 29, 2024

Conversation

gsk967
Copy link
Collaborator

@gsk967 gsk967 commented Apr 24, 2024

Description

$ umeed q uibc denom-owners uumee  --height 1
denom_owners:
- address: umee1y6xz2ggfc0pcsmyjlekh0j9pxh6hk87ymc9due
  balance:
    amount: "999000000000"
    denom: uumee
- address: umee1fl48vsnmsdzcv85q5d2q4z5ajdha8yu38d5sa9
  balance:
    amount: "1000000000"
    denom: uumee
- address: umee1usr9g5a4s2qrwl63sdjtrs2qd4a7huh6cuuhrc
  balance:
    amount: "1000000000000"
    denom: uumee
- address: umee17xpfvakm2amg962yls6f84z3kell8c5lz07l00
  balance:
    amount: "41194"
    denom: uumee
pagination:
  next_key: null
  total: "0"

Summary by CodeRabbit

  • New Features
    • Introduced a new feature to query account addresses owning a specific token denomination.
  • Enhancements
    • Enhanced the system's ability to handle queries for token ownership across different modules.
  • Bug Fixes
    • Adjusted initialization parameters for system components to ensure consistent behavior in token ownership queries.

@gsk967 gsk967 requested a review from a team as a code owner April 24, 2024 13:17
@gsk967 gsk967 added the skip-e2e-test Skip the e2e tests label Apr 24, 2024
Copy link
Contributor

coderabbitai bot commented Apr 24, 2024

Walkthrough

The updates involve integrating a new DenomOwners RPC method across various components to query account addresses owning specific token denominations. This includes changes to query protocols, CLI commands, keeper structures, and test suites. The integration ensures that the system can efficiently manage and query token ownership, enhancing the functionality with respect to token denomination management.

Changes

Files Change Summary
proto/umee/ugov/v1/query.proto, proto/umee/uibc/v1/query.proto Added imports for related proto files and introduced DenomOwners RPC method for querying token denomination owners.
x/ugov/client/cli/query.go, x/uibc/client/cli/query.go Added functions to handle querying for account addresses owning specific token denominations via CLI commands.
x/ugov/keeper/intest/keeper.go, x/ugov/keeper/keeper.go Updated keeper initialization to include BankKeeper configurations for enhanced functionality.
x/ugov/keeper/query_server.go, x/uibc/quota/grpc_query.go Implemented new functions to support DenomOwners queries in the query servers.
app/app.go, x/uibc/expected_keepers.go Adjusted initialization and interfaces to accommodate changes in keeper structures.
x/uibc/quota/intest/suite_test.go, x/uibc/quota/keeper.go Modified test suite initialization and keeper configurations to align with the updated system logic.

🐇✨
In the realm of code, where logic is king,
A rabbit hopped in, making systems sing.
With a twitch of its nose, and a flick of its tail,
New queries afoot, in the blockchain trail.
Cheers to the coders, with minds so bright,
Lighting up networks, byte by byte! 🌟🐰


Recent Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between b77c2bd and 13f0d9e.
Files ignored due to path filters (1)
  • x/uibc/query.pb.go is excluded by !**/*.pb.go, !**/*.pb.go
Files selected for processing (1)
  • proto/umee/uibc/v1/query.proto (2 hunks)
Files skipped from review as they are similar to previous changes (1)
  • proto/umee/uibc/v1/query.proto

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Out of diff range and nitpick comments (2)
x/ugov/keeper/keeper.go (2)

15-17: Ensure that the BankKeeper field is properly documented.

Adding a comment explaining the purpose of the BankKeeper field in the Builder struct would improve code readability and maintainability.


45-47: Ensure that the BankKeeper field is properly documented.

Adding a comment explaining the purpose of the BankKeeper field in the Keeper struct would improve code readability and maintainability.

Copy link

codecov bot commented Apr 24, 2024

Codecov Report

Attention: Patch coverage is 6.89655% with 27 lines in your changes are missing coverage. Please review.

Project coverage is 62.99%. Comparing base (7f05ad4) to head (13f0d9e).
Report is 455 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##             main    #2508       +/-   ##
===========================================
- Coverage   75.38%   62.99%   -12.40%     
===========================================
  Files         100      271      +171     
  Lines        8025    15701     +7676     
===========================================
+ Hits         6050     9891     +3841     
- Misses       1589     5054     +3465     
- Partials      386      756      +370     
Files Coverage Δ
app/app.go 92.82% <100.00%> (ø)
x/ugov/keeper/keeper.go 80.00% <ø> (ø)
x/ugov/keeper/query_server.go 0.00% <ø> (ø)
x/uibc/quota/keeper.go 100.00% <100.00%> (ø)
x/uibc/quota/grpc_query.go 0.00% <0.00%> (ø)
x/uibc/client/cli/query.go 27.55% <0.00%> (ø)

... and 231 files with indirect coverage changes

x/ugov/keeper/query_server.go Outdated Show resolved Hide resolved
proto/umee/ugov/v1/query.proto Outdated Show resolved Hide resolved
x/ugov/client/cli/query.go Outdated Show resolved Hide resolved
proto/umee/ugov/v1/query.proto Outdated Show resolved Hide resolved
@gsk967 gsk967 enabled auto-merge April 24, 2024 16:39
@gsk967 gsk967 requested a review from robert-zaremba April 24, 2024 16:39
@gsk967 gsk967 changed the title feat: added token-balances grpc_web api and cli query feat: added denom-owners grpc_web api and cli query Apr 24, 2024
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Out of diff range and nitpick comments (1)
proto/umee/ugov/v1/query.proto (1)

40-44: The new RPC method DenomOwners is a valuable addition for querying token ownership by denomination. Ensure that the implementation is optimized for performance and scalability.

proto/umee/ugov/v1/query.proto Outdated Show resolved Hide resolved
proto/umee/ugov/v1/query.proto Outdated Show resolved Hide resolved
proto/umee/ugov/v1/query.proto Outdated Show resolved Hide resolved
x/ugov/keeper/keeper.go Outdated Show resolved Hide resolved
@gsk967 gsk967 added skip-e2e-test Skip the e2e tests and removed skip-e2e-test Skip the e2e tests labels Apr 29, 2024
@robert-zaremba robert-zaremba disabled auto-merge April 29, 2024 09:17
@robert-zaremba robert-zaremba merged commit 0e74c15 into main Apr 29, 2024
36 of 41 checks passed
@robert-zaremba robert-zaremba deleted the sai/token-balances branch April 29, 2024 09:17
robert-zaremba added a commit that referenced this pull request Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip-e2e-test Skip the e2e tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants