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

Add stargate queries for quarantine and sanction module. #2016

Merged
merged 3 commits into from
Jun 3, 2024

Conversation

Taztingo
Copy link
Contributor

@Taztingo Taztingo commented May 30, 2024

Description

Adds stargate queries for quarantine and sanction module.

Related to: #1760


Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.

  • Targeted PR against correct branch (see CONTRIBUTING.md)
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Wrote unit and integration tests
  • Updated relevant documentation (docs/) or specification (x/<module>/spec/)
  • Added relevant godoc comments.
  • Added a relevant changelog entry to the Unreleased section in CHANGELOG.md
  • Re-reviewed Files changed in the Github PR explorer
  • Review Codecov Report in the comment section below once CI passes

Summary by CodeRabbit

  • New Features
    • Added support for querying quarantine and sanction statuses, including details on quarantined funds and sanctioned addresses.

@Taztingo Taztingo requested a review from a team as a code owner May 30, 2024 15:21
@Taztingo Taztingo self-assigned this May 30, 2024
Copy link
Contributor

coderabbitai bot commented May 30, 2024

Walkthrough

The recent updates to the Provenance project include adding new stargate queries for the Quarantine and Sanction modules. These changes enhance the querying capabilities by allowing users to check quarantine statuses, view quarantined funds, retrieve auto-responses, and access sanction information, including sanctioned addresses and temporary entries.

Changes

File Path Change Summary
internal/provwasm/stargate_whitelist.go Added imports for quarantine and sanction packages. Added whitelisted queries for both modules.
CHANGELOG.md Documented the updates related to the new stargate queries for the Quarantine and Sanction modules.

Sequence Diagram(s) (Beta)

sequenceDiagram
    participant User
    participant Provenance
    participant QuarantineModule
    participant SanctionModule

    User->>Provenance: Query IsQuarantined
    Provenance->>QuarantineModule: Forward Query
    QuarantineModule-->>Provenance: Response
    Provenance-->>User: Response

    User->>Provenance: Query QuarantinedFunds
    Provenance->>QuarantineModule: Forward Query
    QuarantineModule-->>Provenance: Response
    Provenance-->>User: Response

    User->>Provenance: Query IsSanctioned
    Provenance->>SanctionModule: Forward Query
    SanctionModule-->>Provenance: Response
    Provenance-->>User: Response

    User->>Provenance: Query SanctionedAddresses
    Provenance->>SanctionModule: Forward Query
    SanctionModule-->>Provenance: Response
    Provenance-->>User: Response
Loading

Poem

In Provenance's code, new queries arise,
Quarantine and Sanction, a pleasant surprise.
Funds and sanctions, all in our sight,
With stargate's power, the future is bright.
Queries whitelisted, the path now clear,
For devs and users, there's nothing to fear.
🌟✨


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.
    • @coderabbitai help me debug CodeRabbit configuration file.

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 an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @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.

@Taztingo Taztingo enabled auto-merge (squash) May 30, 2024 15:21
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

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 5d3ed55 and b234c4a.

Files selected for processing (1)
  • internal/provwasm/stargate_whitelist.go (2 hunks)
Additional comments not posted (3)
internal/provwasm/stargate_whitelist.go (3)

27-28: New imports for quarantine and sanction modules added.

These imports are necessary for the new queries being whitelisted and are correctly placed in the import block.


71-73: Whitelisted queries added for the quarantine module.

The queries /cosmos.quarantine.v1beta1.Query/IsQuarantined, /cosmos.quarantine.v1beta1.Query/QuarantinedFunds, and /cosmos.quarantine.v1beta1.Query/AutoResponses are correctly defined with appropriate response types.


76-79: Whitelisted queries added for the sanction module.

The queries /cosmos.sanction.v1beta1.Query/IsSanctioned, /cosmos.sanction.v1beta1.Query/SanctionedAddresses, /cosmos.sanction.v1beta1.Query/TemporaryEntries, and /cosmos.sanction.v1beta1.Query/Params are correctly defined with appropriate response types.

Copy link
Contributor

@nullpointer0x00 nullpointer0x00 left a comment

Choose a reason for hiding this comment

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

Does this need a change log entry?

@Taztingo Taztingo requested a review from nullpointer0x00 May 30, 2024 15:38
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

Outside diff range and nitpick comments (1)
CHANGELOG.md (1)

Line range hint 25-27: Optimize the modulo operation.

-  while x >= y:
-    x -= y
-  return x
+  return x % y
Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between b234c4a and be92171.

Files selected for processing (1)
  • CHANGELOG.md (1 hunks)
Additional context used
Markdownlint
CHANGELOG.md

121-121: Expected: asterisk; Actual: dash
Unordered list style


122-122: Expected: asterisk; Actual: dash
Unordered list style


123-123: Expected: asterisk; Actual: dash
Unordered list style


124-124: Expected: asterisk; Actual: dash
Unordered list style


125-125: Expected: asterisk; Actual: dash
Unordered list style


126-126: Expected: asterisk; Actual: dash
Unordered list style


127-127: Expected: asterisk; Actual: dash
Unordered list style


128-128: Expected: asterisk; Actual: dash
Unordered list style


129-129: Expected: asterisk; Actual: dash
Unordered list style


130-130: Expected: asterisk; Actual: dash
Unordered list style


131-131: Expected: asterisk; Actual: dash
Unordered list style


132-132: Expected: asterisk; Actual: dash
Unordered list style


133-133: Expected: asterisk; Actual: dash
Unordered list style


134-134: Expected: asterisk; Actual: dash
Unordered list style


135-135: Expected: asterisk; Actual: dash
Unordered list style


136-136: Expected: asterisk; Actual: dash
Unordered list style


137-137: Expected: asterisk; Actual: dash
Unordered list style


138-138: Expected: asterisk; Actual: dash
Unordered list style


208-208: Expected: asterisk; Actual: dash
Unordered list style


209-209: Expected: asterisk; Actual: dash
Unordered list style


210-210: Expected: asterisk; Actual: dash
Unordered list style


211-211: Expected: asterisk; Actual: dash
Unordered list style


212-212: Expected: asterisk; Actual: dash
Unordered list style


213-213: Expected: asterisk; Actual: dash
Unordered list style


214-214: Expected: asterisk; Actual: dash
Unordered list style


215-215: Expected: asterisk; Actual: dash
Unordered list style


216-216: Expected: asterisk; Actual: dash
Unordered list style


217-217: Expected: asterisk; Actual: dash
Unordered list style


218-218: Expected: asterisk; Actual: dash
Unordered list style


219-219: Expected: asterisk; Actual: dash
Unordered list style


220-220: Expected: asterisk; Actual: dash
Unordered list style


221-221: Expected: asterisk; Actual: dash
Unordered list style


222-222: Expected: asterisk; Actual: dash
Unordered list style


223-223: Expected: asterisk; Actual: dash
Unordered list style


224-224: Expected: asterisk; Actual: dash
Unordered list style


225-225: Expected: asterisk; Actual: dash
Unordered list style


226-226: Expected: asterisk; Actual: dash
Unordered list style


227-227: Expected: asterisk; Actual: dash
Unordered list style


228-228: Expected: asterisk; Actual: dash
Unordered list style


229-229: Expected: asterisk; Actual: dash
Unordered list style


230-230: Expected: asterisk; Actual: dash
Unordered list style


231-231: Expected: asterisk; Actual: dash
Unordered list style


232-232: Expected: asterisk; Actual: dash
Unordered list style


233-233: Expected: asterisk; Actual: dash
Unordered list style


234-234: Expected: asterisk; Actual: dash
Unordered list style


235-235: Expected: asterisk; Actual: dash
Unordered list style


236-236: Expected: asterisk; Actual: dash
Unordered list style


237-237: Expected: asterisk; Actual: dash
Unordered list style


238-238: Expected: asterisk; Actual: dash
Unordered list style


239-239: Expected: asterisk; Actual: dash
Unordered list style


268-268: Expected: asterisk; Actual: dash
Unordered list style


269-269: Expected: asterisk; Actual: dash
Unordered list style


270-270: Expected: asterisk; Actual: dash
Unordered list style


347-347: Expected: asterisk; Actual: dash
Unordered list style


348-348: Expected: asterisk; Actual: dash
Unordered list style


349-349: Expected: asterisk; Actual: dash
Unordered list style


350-350: Expected: asterisk; Actual: dash
Unordered list style


351-351: Expected: asterisk; Actual: dash
Unordered list style


352-352: Expected: asterisk; Actual: dash
Unordered list style


353-353: Expected: asterisk; Actual: dash
Unordered list style


354-354: Expected: asterisk; Actual: dash
Unordered list style


355-355: Expected: asterisk; Actual: dash
Unordered list style


356-356: Expected: asterisk; Actual: dash
Unordered list style


357-357: Expected: asterisk; Actual: dash
Unordered list style


358-358: Expected: asterisk; Actual: dash
Unordered list style


359-359: Expected: asterisk; Actual: dash
Unordered list style


360-360: Expected: asterisk; Actual: dash
Unordered list style


361-361: Expected: asterisk; Actual: dash
Unordered list style


362-362: Expected: asterisk; Actual: dash
Unordered list style


363-363: Expected: asterisk; Actual: dash
Unordered list style


364-364: Expected: asterisk; Actual: dash
Unordered list style


365-365: Expected: asterisk; Actual: dash
Unordered list style


366-366: Expected: asterisk; Actual: dash
Unordered list style


367-367: Expected: asterisk; Actual: dash
Unordered list style


368-368: Expected: asterisk; Actual: dash
Unordered list style


369-369: Expected: asterisk; Actual: dash
Unordered list style


725-725: Expected: asterisk; Actual: dash
Unordered list style


733-733: Expected: asterisk; Actual: dash
Unordered list style


778-778: Expected: asterisk; Actual: dash
Unordered list style


786-786: Expected: asterisk; Actual: dash
Unordered list style


832-832: Expected: 1; Actual: 2
Multiple consecutive blank lines


1233-1233: Expected: 1; Actual: 2
Multiple consecutive blank lines


1250-1250: Expected: 1; Actual: 2
Multiple consecutive blank lines


1302-1302: Expected: 1; Actual: 2
Multiple consecutive blank lines


1406-1406: Expected: 1; Actual: 2
Multiple consecutive blank lines


243-243: null
Bare URL used


274-274: null
Bare URL used


373-373: null
Bare URL used


423-423: null
Bare URL used


435-435: null
Bare URL used


451-451: null
Bare URL used


522-522: null
Bare URL used


533-533: null
Bare URL used


541-541: null
Bare URL used


577-577: null
Bare URL used


602-602: null
Bare URL used


614-614: null
Bare URL used


660-660: null
Bare URL used


661-661: null
Bare URL used


662-662: null
Bare URL used


663-663: null
Bare URL used


664-664: null
Bare URL used


711-711: null
Bare URL used


752-752: null
Bare URL used


805-805: null
Bare URL used


918-918: null
Bare URL used


960-960: null
Spaces inside emphasis markers


960-960: null
Spaces inside emphasis markers


356-356: null
Spaces inside code span elements

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

Outside diff range and nitpick comments (4)
CHANGELOG.md (4)

Line range hint 122-240: Consider using a consistent list marker style in Markdown.

The Markdown list items in the changelog are inconsistently marked with dashes instead of asterisks. For consistency, consider using asterisks (*) for all list items. This change will not affect the rendered output but will improve the consistency of the raw Markdown file.

Also applies to: 348-365


Line range hint 244-244: Consider using Markdown links instead of bare URLs.

It's a good practice to use Markdown link syntax to make URLs clickable and more readable in the document. For example, change https://github.com/provenance-io/provenance/issues/123 to [Issue #123](https://github.com/provenance-io/provenance/issues/123).

Also applies to: 275-275, 374-374, 424-424, 436-436, 452-452, 523-523, 534-534, 542-542, 578-578, 603-603, 615-615, 661-661, 662-662, 663-663, 664-664, 665-665, 712-712, 753-753, 806-806, 919-919


Line range hint 961-961: Avoid spaces inside emphasis markers in Markdown.

There are spaces inside the emphasis markers which can lead to unintended rendering of the text. It's recommended to remove any leading or trailing spaces inside the emphasis markers to ensure the text is emphasized correctly.


Line range hint 357-357: Avoid spaces inside code span elements in Markdown.

Spaces inside code span elements can lead to incorrect rendering or interpretation of the code. It's recommended to remove any unnecessary spaces within code spans to ensure clarity and correctness.

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between be92171 and 68daaef.

Files selected for processing (1)
  • CHANGELOG.md (1 hunks)
Additional context used
Markdownlint
CHANGELOG.md

122-122: Expected: asterisk; Actual: dash
Unordered list style


123-123: Expected: asterisk; Actual: dash
Unordered list style


124-124: Expected: asterisk; Actual: dash
Unordered list style


125-125: Expected: asterisk; Actual: dash
Unordered list style


126-126: Expected: asterisk; Actual: dash
Unordered list style


127-127: Expected: asterisk; Actual: dash
Unordered list style


128-128: Expected: asterisk; Actual: dash
Unordered list style


129-129: Expected: asterisk; Actual: dash
Unordered list style


130-130: Expected: asterisk; Actual: dash
Unordered list style


131-131: Expected: asterisk; Actual: dash
Unordered list style


132-132: Expected: asterisk; Actual: dash
Unordered list style


133-133: Expected: asterisk; Actual: dash
Unordered list style


134-134: Expected: asterisk; Actual: dash
Unordered list style


135-135: Expected: asterisk; Actual: dash
Unordered list style


136-136: Expected: asterisk; Actual: dash
Unordered list style


137-137: Expected: asterisk; Actual: dash
Unordered list style


138-138: Expected: asterisk; Actual: dash
Unordered list style


139-139: Expected: asterisk; Actual: dash
Unordered list style


209-209: Expected: asterisk; Actual: dash
Unordered list style


210-210: Expected: asterisk; Actual: dash
Unordered list style


211-211: Expected: asterisk; Actual: dash
Unordered list style


212-212: Expected: asterisk; Actual: dash
Unordered list style


213-213: Expected: asterisk; Actual: dash
Unordered list style


214-214: Expected: asterisk; Actual: dash
Unordered list style


215-215: Expected: asterisk; Actual: dash
Unordered list style


216-216: Expected: asterisk; Actual: dash
Unordered list style


217-217: Expected: asterisk; Actual: dash
Unordered list style


218-218: Expected: asterisk; Actual: dash
Unordered list style


219-219: Expected: asterisk; Actual: dash
Unordered list style


220-220: Expected: asterisk; Actual: dash
Unordered list style


221-221: Expected: asterisk; Actual: dash
Unordered list style


222-222: Expected: asterisk; Actual: dash
Unordered list style


223-223: Expected: asterisk; Actual: dash
Unordered list style


224-224: Expected: asterisk; Actual: dash
Unordered list style


225-225: Expected: asterisk; Actual: dash
Unordered list style


226-226: Expected: asterisk; Actual: dash
Unordered list style


227-227: Expected: asterisk; Actual: dash
Unordered list style


228-228: Expected: asterisk; Actual: dash
Unordered list style


229-229: Expected: asterisk; Actual: dash
Unordered list style


230-230: Expected: asterisk; Actual: dash
Unordered list style


231-231: Expected: asterisk; Actual: dash
Unordered list style


232-232: Expected: asterisk; Actual: dash
Unordered list style


233-233: Expected: asterisk; Actual: dash
Unordered list style


234-234: Expected: asterisk; Actual: dash
Unordered list style


235-235: Expected: asterisk; Actual: dash
Unordered list style


236-236: Expected: asterisk; Actual: dash
Unordered list style


237-237: Expected: asterisk; Actual: dash
Unordered list style


238-238: Expected: asterisk; Actual: dash
Unordered list style


239-239: Expected: asterisk; Actual: dash
Unordered list style


240-240: Expected: asterisk; Actual: dash
Unordered list style


269-269: Expected: asterisk; Actual: dash
Unordered list style


270-270: Expected: asterisk; Actual: dash
Unordered list style


271-271: Expected: asterisk; Actual: dash
Unordered list style


348-348: Expected: asterisk; Actual: dash
Unordered list style


349-349: Expected: asterisk; Actual: dash
Unordered list style


350-350: Expected: asterisk; Actual: dash
Unordered list style


351-351: Expected: asterisk; Actual: dash
Unordered list style


352-352: Expected: asterisk; Actual: dash
Unordered list style


353-353: Expected: asterisk; Actual: dash
Unordered list style


354-354: Expected: asterisk; Actual: dash
Unordered list style


355-355: Expected: asterisk; Actual: dash
Unordered list style


356-356: Expected: asterisk; Actual: dash
Unordered list style


357-357: Expected: asterisk; Actual: dash
Unordered list style


358-358: Expected: asterisk; Actual: dash
Unordered list style


359-359: Expected: asterisk; Actual: dash
Unordered list style


360-360: Expected: asterisk; Actual: dash
Unordered list style


361-361: Expected: asterisk; Actual: dash
Unordered list style


362-362: Expected: asterisk; Actual: dash
Unordered list style


363-363: Expected: asterisk; Actual: dash
Unordered list style


364-364: Expected: asterisk; Actual: dash
Unordered list style


365-365: Expected: asterisk; Actual: dash
Unordered list style


366-366: Expected: asterisk; Actual: dash
Unordered list style


367-367: Expected: asterisk; Actual: dash
Unordered list style


368-368: Expected: asterisk; Actual: dash
Unordered list style


369-369: Expected: asterisk; Actual: dash
Unordered list style


370-370: Expected: asterisk; Actual: dash
Unordered list style


726-726: Expected: asterisk; Actual: dash
Unordered list style


734-734: Expected: asterisk; Actual: dash
Unordered list style


779-779: Expected: asterisk; Actual: dash
Unordered list style


787-787: Expected: asterisk; Actual: dash
Unordered list style


833-833: Expected: 1; Actual: 2
Multiple consecutive blank lines


1234-1234: Expected: 1; Actual: 2
Multiple consecutive blank lines


1251-1251: Expected: 1; Actual: 2
Multiple consecutive blank lines


1303-1303: Expected: 1; Actual: 2
Multiple consecutive blank lines


1407-1407: Expected: 1; Actual: 2
Multiple consecutive blank lines


244-244: null
Bare URL used


275-275: null
Bare URL used


374-374: null
Bare URL used


424-424: null
Bare URL used


436-436: null
Bare URL used


452-452: null
Bare URL used


523-523: null
Bare URL used


534-534: null
Bare URL used


542-542: null
Bare URL used


578-578: null
Bare URL used


603-603: null
Bare URL used


615-615: null
Bare URL used


661-661: null
Bare URL used


662-662: null
Bare URL used


663-663: null
Bare URL used


664-664: null
Bare URL used


665-665: null
Bare URL used


712-712: null
Bare URL used


753-753: null
Bare URL used


806-806: null
Bare URL used


919-919: null
Bare URL used


961-961: null
Spaces inside emphasis markers


961-961: null
Spaces inside emphasis markers


357-357: null
Spaces inside code span elements

@Taztingo Taztingo merged commit 1fa1849 into main Jun 3, 2024
27 of 31 checks passed
@Taztingo Taztingo deleted the taztingo/add-additional-stargate-queries branch June 3, 2024 22:08
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.

3 participants