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

impl rate limit for xtokens #854

Merged
merged 19 commits into from
Mar 5, 2024
Merged

impl rate limit for xtokens #854

merged 19 commits into from
Mar 5, 2024

Conversation

wangjj9219
Copy link
Contributor

No description provided.

@codecov-commenter
Copy link

codecov-commenter commented Nov 27, 2022

Codecov Report

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

Project coverage is 85.78%. Comparing base (d26b0b1) to head (c551458).

Files Patch % Lines
rate-limit/src/lib.rs 81.75% 25 Missing ⚠️
rate-limit/src/weights.rs 0.00% 15 Missing ⚠️
traits/src/rate_limit.rs 66.66% 4 Missing ⚠️
rate-limit/src/mock.rs 87.50% 1 Missing ⚠️
xtokens/src/lib.rs 83.33% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #854      +/-   ##
==========================================
+ Coverage   85.25%   85.78%   +0.52%     
==========================================
  Files          87       92       +5     
  Lines       10350    11055     +705     
==========================================
+ Hits         8824     9483     +659     
- Misses       1526     1572      +46     

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

@wangjj9219 wangjj9219 requested a review from xlc November 27, 2022 12:42
rate-limit/src/lib.rs Outdated Show resolved Hide resolved
rate-limit/src/lib.rs Outdated Show resolved Hide resolved
rate-limit/src/lib.rs Outdated Show resolved Hide resolved
rate-limit/src/lib.rs Outdated Show resolved Hide resolved
rate-limit/src/lib.rs Outdated Show resolved Hide resolved
rate-limit/src/lib.rs Outdated Show resolved Hide resolved
rate-limit/src/lib.rs Outdated Show resolved Hide resolved
xtokens/src/lib.rs Outdated Show resolved Hide resolved
rate-limit/src/lib.rs Outdated Show resolved Hide resolved
rate-limit/src/lib.rs Show resolved Hide resolved
rate-limit/src/lib.rs Show resolved Hide resolved
rate-limit/src/lib.rs Show resolved Hide resolved
rate-limit/Cargo.toml Outdated Show resolved Hide resolved
rate-limit/src/lib.rs Show resolved Hide resolved
rate-limit/src/lib.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@zjb0807 zjb0807 left a comment

Choose a reason for hiding this comment

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

LGTM

@zjb0807 zjb0807 requested a review from xlc December 13, 2023 02:22
Copy link
Member

@xlc xlc left a comment

Choose a reason for hiding this comment

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

there are some missing coverages reported by code coverage, but 100% sure if the report is correct but need to double check it

/// If the encoded key starts with the vec, the key is in whitelist.
StartsWith(BoundedVec<u8, ConstU32<MAX_FILTER_KEY_LENGTH>>),
/// If the encoded key ends with the vec, the key is in whitelist.
EndsWith(BoundedVec<u8, ConstU32<MAX_FILTER_KEY_LENGTH>>),
Copy link
Member

Choose a reason for hiding this comment

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

I don't think we need this

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If the key is AccountId, Match pattern may usually be used, but StartWith pattern can still be used to match all the pallet accounts. Can consider retaining it, and should use StartWith and EndWith with caution in actual configuration.

xtokens/src/lib.rs Outdated Show resolved Hide resolved
@wangjj9219 wangjj9219 merged commit 7e05827 into master Mar 5, 2024
5 checks passed
@wangjj9219 wangjj9219 deleted the rate-limit branch March 5, 2024 08:48
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.

5 participants