-
Notifications
You must be signed in to change notification settings - Fork 9
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: implement blocked channels #7
Conversation
Warning Review failedThe pull request is closed. WalkthroughThe updates to the Aura module introduce robust functionality for managing blocked IBC channels. New commands, message types, and state management functions allow blocking and unblocking channels, ensuring controlled transfers. Consistent command descriptions, comprehensive tests, and various related updates further stabilize and validate these changes. The enhancements ensure improved transfer restrictions and administrative control over IBC channels. Changes
Sequence Diagram(s)sequenceDiagram
participant User as User
participant CLI as CLI
participant MsgServer as MsgServer
participant Keeper as Keeper
participant Blockchain as Blockchain
User->>CLI: Execute "block channel" command
CLI->>MsgServer: Sends blocking request
MsgServer->>Keeper: Add channel to blocked list
Keeper->>Blockchain: Update state with blocked channel
Note right of Keeper: Emit BlockedChannelAdded event
User->>CLI: Execute "unblock channel" command
CLI->>MsgServer: Sends unblocking request
MsgServer->>Keeper: Remove channel from blocked list
Keeper->>Blockchain: Update state removing the blocked channel
Note right of Keeper: Emit BlockedChannelRemoved event
sequenceDiagram
participant User as User
participant CLI as CLI
participant MsgServer as MsgServer
participant Keeper as Keeper
participant Blockchain as Blockchain
User->>Blockchain: Initiate IBC Transfer
Blockchain->>Keeper: Check SendRestrictionFn
Keeper->>Keeper: Validate blocked channels
Keeper-->>Blockchain: Allow/Deny based on channel status
Blockchain-->>User: Transfer result
Poem
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? TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Additionally, you can add CodeRabbit Configration File (
|
830fcb9
to
3184616
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅ 📢 Thoughts on this report? Let us know! |
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.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files ignored due to path filters (9)
e2e/go.sum
is excluded by!**/*.sum
go.sum
is excluded by!**/*.sum
go.work.sum
is excluded by!**/*.sum
simapp/go.sum
is excluded by!**/*.sum
x/aura/types/events.pb.go
is excluded by!**/*.pb.go
x/aura/types/genesis.pb.go
is excluded by!**/*.pb.go
x/aura/types/query.pb.go
is excluded by!**/*.pb.go
x/aura/types/query.pb.gw.go
is excluded by!**/*.pb.gw.go
x/aura/types/tx.pb.go
is excluded by!**/*.pb.go
Files selected for processing (26)
- e2e/go.mod (2 hunks)
- e2e/main_test.go (5 hunks)
- e2e/utils.go (5 hunks)
- go.mod (1 hunks)
- proto/aura/v1/events.proto (1 hunks)
- proto/aura/v1/genesis.proto (1 hunks)
- proto/aura/v1/query.proto (2 hunks)
- proto/aura/v1/tx.proto (2 hunks)
- simapp/app.go (9 hunks)
- simapp/go.mod (2 hunks)
- x/aura/client/cli/query.go (2 hunks)
- x/aura/client/cli/tx.go (7 hunks)
- x/aura/keeper/keeper.go (2 hunks)
- x/aura/keeper/keeper_test.go (2 hunks)
- x/aura/keeper/msg_server.go (1 hunks)
- x/aura/keeper/msg_server_test.go (1 hunks)
- x/aura/keeper/query_server.go (1 hunks)
- x/aura/keeper/query_server_test.go (1 hunks)
- x/aura/keeper/state.go (1 hunks)
- x/aura/spec/01_state.md (1 hunks)
- x/aura/spec/02_messages.md (1 hunks)
- x/aura/spec/03_events.md (1 hunks)
- x/aura/types/codec.go (2 hunks)
- x/aura/types/genesis.go (2 hunks)
- x/aura/types/keys.go (2 hunks)
- x/aura/types/msgs.go (2 hunks)
Files skipped from review due to trivial changes (1)
- x/aura/spec/01_state.md
Files skipped from review as they are similar to previous changes (24)
- e2e/go.mod
- e2e/main_test.go
- e2e/utils.go
- go.mod
- proto/aura/v1/events.proto
- proto/aura/v1/genesis.proto
- proto/aura/v1/query.proto
- proto/aura/v1/tx.proto
- simapp/app.go
- simapp/go.mod
- x/aura/client/cli/query.go
- x/aura/client/cli/tx.go
- x/aura/keeper/keeper.go
- x/aura/keeper/keeper_test.go
- x/aura/keeper/msg_server.go
- x/aura/keeper/msg_server_test.go
- x/aura/keeper/query_server.go
- x/aura/keeper/query_server_test.go
- x/aura/keeper/state.go
- x/aura/spec/02_messages.md
- x/aura/types/codec.go
- x/aura/types/genesis.go
- x/aura/types/keys.go
- x/aura/types/msgs.go
Additional context used
LanguageTool
x/aura/spec/03_events.md
[style] ~46-~46: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym. (ENGLISH_WORD_REPEAT_BEGINNING_RULE)
Context: ...0000000000000000ausdy" } ] } ``` This event is emitted by the following trans...
Additional comments not posted (2)
x/aura/spec/03_events.md (2)
323-341
: Well-documented new event for adding a blocked channel.The documentation clearly specifies the event structure and links to the associated message. This maintains consistency with the existing documentation style and provides all necessary details for understanding the event context.
343-361
: Well-documented new event for removing a blocked channel.Like the addition event, this removal event is well-documented, maintaining a consistent format and providing clear linkage to the associated transaction message.
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.
Very clean. Nice job!
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.
lgtm!
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.
Looks great, 1 small suggestion for an incorrect code comment. ty for making an e2e test!
Co-authored-by: Kian <[email protected]>
This PR implements a blocklist approach to IBC transfers.
A new E2E test has been added to demonstrate this feature:
Summary by CodeRabbit
New Features
TxAddBlockedChannel()
andTxRemoveBlockedChannel()
.Bug Fixes
Tests
Documentation