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

IBC rate limit query #4246

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

IBC rate limit query #4246

wants to merge 5 commits into from

Conversation

grarco
Copy link
Collaborator

@grarco grarco commented Jan 17, 2025

Describe your changes

Adds a query to retrieve the ibc rate limit for a specific token.

Checklist before merging

  • If this PR has some consensus breaking changes, I added the corresponding breaking:: labels
    • This will require 2 reviewers to approve the changes
  • If this PR requires changes to the docs or specs, a corresponding PR is opened in the namada-docs repo
    • Relevant PR if applies:
  • If this PR affects services such as namada-indexer or namada-masp-indexer, a corresponding PR is opened in that repo
    • Relevant PR if applies:

@grarco grarco force-pushed the grarco/query-ibc-rate-limits branch from 0464530 to 8a4ba07 Compare January 17, 2025 19:13
@grarco grarco marked this pull request as ready for review January 17, 2025 19:13
@@ -1518,3 +1519,25 @@ pub async fn query_ibc_denom<N: Namada>(

token.as_ref().to_string()
}

/// Query the IBC rate limit for the provided token
pub async fn query_ibc_rate_limit<C: Client + Sync>(
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

An alternative to this function could be to add another path to the TOKEN

@grarco grarco requested review from yito88 and brentstone January 17, 2025 19:18
@grarco
Copy link
Collaborator Author

grarco commented Jan 17, 2025

@brentstone I've also added a cli command for the query. Let me know if we only need the sdk function so that I can revert that change

Copy link

codecov bot commented Jan 17, 2025

Codecov Report

Attention: Patch coverage is 0% with 14 lines in your changes missing coverage. Please review.

Project coverage is 74.58%. Comparing base (9eb747c) to head (96d7c5a).

Files with missing lines Patch % Lines
crates/sdk/src/rpc.rs 0.00% 14 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4246      +/-   ##
==========================================
- Coverage   74.59%   74.58%   -0.02%     
==========================================
  Files         342      342              
  Lines      108771   108785      +14     
==========================================
- Hits        81135    81134       -1     
- Misses      27636    27651      +15     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

pub async fn query_ibc_rate_limit<C: Client + Sync>(
client: &C,
token: &Address,
) -> Result<Amount, error::Error> {
Copy link
Member

Choose a reason for hiding this comment

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

Do we need the token's mint limit too? like

pub fn get_limits<S: StorageRead>(
storage: &S,
token: &Address,
) -> Result<(Amount, Amount)> {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants