-
Notifications
You must be signed in to change notification settings - Fork 170
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!: ibc transfer quota #1568
Conversation
1. add cli queries for rate_limits and params 2. add updateProposal for rate_limits and ibcPause status
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's try to convert x/ibctransfer
into a true sdk module. Hence I propose the following structure (which also is inline with the most recent recommendations):
x/ibctransfer
- "root" ->
- generated types and codec will go here
- ibc_module.go -> ibc module can go there, eg `IBCModule`
- /module -> cosmos-sdk module
- /quota -> keeper for ibc limits and IBC middleware implementation (this doesn't implement anything related to gRPC service)
- /service -> sdk module keeper (it should import and encapsulate /quota) implementing gRPC service
- /client etc... - standard
- /ics20 -- move the existing ibctransfer/keeper package here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's keep generated types directly in x/ibctransfer
and the SDK module code in x/ibctransfer/module
as in the authz module.
Codecov Report
📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more @@ Coverage Diff @@
## main #1568 +/- ##
==========================================
- Coverage 57.50% 55.80% -1.71%
==========================================
Files 77 83 +6
Lines 8034 8322 +288
==========================================
+ Hits 4620 4644 +24
- Misses 3063 3327 +264
Partials 351 351
|
// reset quotas | ||
if quotaExpires == nil || quotaExpires.Before(ctx.BlockTime()) { | ||
if err := keeper.ResetQuota(ctx); err != nil { | ||
panic(err) |
Check warning
Code scanning / CodeQL
Panic in BeginBock or EndBlock consensus methods
|
||
// BeginBlock implements BeginBlock for the x/uibc module. | ||
func BeginBlock(ctx sdk.Context, keeper keeper.Keeper) { | ||
quotaExpires, err := keeper.GetExpire(ctx) |
Check warning
Code scanning / CodeQL
Panic in BeginBock or EndBlock consensus methods
func BeginBlock(ctx sdk.Context, keeper keeper.Keeper) { | ||
quotaExpires, err := keeper.GetExpire(ctx) | ||
if err != nil { | ||
panic(err) |
Check warning
Code scanning / CodeQL
Panic in BeginBock or EndBlock consensus methods
} | ||
|
||
// reset quotas | ||
if quotaExpires == nil || quotaExpires.Before(ctx.BlockTime()) { |
Check warning
Code scanning / CodeQL
Panic in BeginBock or EndBlock consensus methods
} | ||
|
||
// reset quotas | ||
if quotaExpires == nil || quotaExpires.Before(ctx.BlockTime()) { |
Check warning
Code scanning / CodeQL
Panic in BeginBock or EndBlock consensus methods
|
||
// reset quotas | ||
if quotaExpires == nil || quotaExpires.Before(ctx.BlockTime()) { | ||
if err := keeper.ResetQuota(ctx); err != nil { |
Check warning
Code scanning / CodeQL
Panic in BeginBock or EndBlock consensus methods
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pre-approving.
Description
closes: #
Author Checklist
All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.
I have...
!
to the type prefix if API or client breaking changeCHANGELOG.md
Reviewers Checklist
All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.
I have...