-
Notifications
You must be signed in to change notification settings - Fork 108
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: add queries for tss funds migrator info #2372
Conversation
Important Review skippedReview was skipped due to path filters Files ignored due to path filters (1)
You can disable this status message by setting the WalkthroughThis update introduces new functionality that enables querying TSS (Threshold Signature Scheme) fund migration information in the ZetaChain network. Specifically, new commands and API endpoints are added to retrieve details and lists of TSS funds migrators, enhancing the observability and management of fund migrations. Additionally, various CLI, proto definitions, and TypeScript declarations have been updated to support these features without altering any existing public entity declarations. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant CLI
participant API
participant Keeper
User->>CLI: Execute list-tss-funds-migrator command
CLI->>API: Send request to list TSS funds migrators
API->>Keeper: Query all TSS funds migrator info
Keeper-->>API: Return all TSS funds migrator info
API-->>CLI: Send response with list of TSS funds migrator info
CLI-->>User: Display list of TSS funds migrator info
User->>CLI: Execute show-tss-funds-migrator command with chain ID
CLI->>API: Send request to show TSS funds migrator for the given chain ID
API->>Keeper: Query TSS funds migrator info for specific chain
Keeper-->>API: Return TSS funds migrator info for the given chain ID
API-->>CLI: Send response with TSS funds migrator info
CLI-->>User: Display TSS funds migrator info
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 (
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #2372 +/- ##
===========================================
+ Coverage 69.42% 69.45% +0.02%
===========================================
Files 306 307 +1
Lines 19047 19065 +18
===========================================
+ Hits 13224 13242 +18
Misses 5167 5167
Partials 656 656
|
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: 5
Outside diff range and nitpick comments (10)
docs/cli/zetacored/zetacored_query_observer_list-tss-funds-migrator.md (3)
5-5
: Specify language for fenced code blocksTo improve the readability and formatting in Markdown viewers and editors, specify the language for each fenced code block.
- ``` + ```bashApply this change to all instances where the fenced code block language is missing.
Also applies to: 11-11, 28-28
Tools
Markdownlint
5-5: null (MD040, fenced-code-language)
Fenced code blocks should have a language specified
39-39
: Remove hard tabs from the Markdown fileUsing spaces instead of tabs will ensure consistent formatting across different editors and platforms.
- * [zetacored query observer](zetacored_query_observer.md) - Querying commands for the observer module + * [zetacored query observer](zetacored_query_observer.md) - Querying commands for the observer moduleTools
Markdownlint
39-39: Column: 58 (MD010, no-hard-tabs)
Hard tabs
Line range hint
41-41
: Avoid multiple consecutive blank linesReducing multiple blank lines to a single blank line helps in maintaining a clean and professional appearance of the document.
- - +Tools
Markdownlint
9-9: Expected: h2; Actual: h3 (MD001, heading-increment)
Heading levels should only increment by one level at a time
39-39: Column: 58 (MD010, no-hard-tabs)
Hard tabs
5-5: null (MD040, fenced-code-language)
Fenced code blocks should have a language specified
11-11: null (MD040, fenced-code-language)
Fenced code blocks should have a language specified
28-28: null (MD040, fenced-code-language)
Fenced code blocks should have a language specifieddocs/cli/zetacored/zetacored_query_observer_show-tss-funds-migrator.md (3)
5-5
: Specify language for fenced code blocksTo improve the readability and formatting in Markdown viewers and editors, specify the language for each fenced code block.
- ``` + ```bashApply this change to all instances where the fenced code block language is missing.
Also applies to: 11-11, 28-28
Tools
Markdownlint
5-5: null (MD040, fenced-code-language)
Fenced code blocks should have a language specified
39-39
: Remove hard tabs from the Markdown fileUsing spaces instead of tabs will ensure consistent formatting across different editors and platforms.
- * [zetacored query observer](zetacored_query_observer.md) - Querying commands for the observer module + * [zetacored query observer](zetacored_query_observer.md) - Querying commands for the observer moduleTools
Markdownlint
39-39: Column: 58 (MD010, no-hard-tabs)
Hard tabs
Line range hint
41-41
: Avoid multiple consecutive blank linesReducing multiple blank lines to a single blank line helps in maintaining a clean and professional appearance of the document.
- - +Tools
Markdownlint
9-9: Expected: h2; Actual: h3 (MD001, heading-increment)
Heading levels should only increment by one level at a time
39-39: Column: 58 (MD010, no-hard-tabs)
Hard tabs
5-5: null (MD040, fenced-code-language)
Fenced code blocks should have a language specified
11-11: null (MD040, fenced-code-language)
Fenced code blocks should have a language specified
28-28: null (MD040, fenced-code-language)
Fenced code blocks should have a language specifieddocs/cli/zetacored/zetacored_query_observer.md (4)
Line range hint
9-9
: Correct the heading level for consistencyThe heading level here should increment by one level at a time. Consider changing from h3 to h2 for better document structure and readability.
- ### Options + ## OptionsTools
Markdownlint
36-36: Column: 94 (MD010, no-hard-tabs)
Hard tabs
37-37: Column: 94 (MD010, no-hard-tabs)
Hard tabs
38-38: Column: 98 (MD010, no-hard-tabs)
Hard tabs
39-39: Column: 106 (MD010, no-hard-tabs)
Hard tabs
40-40: Column: 92 (MD010, no-hard-tabs)
Hard tabs
41-41: Column: 82 (MD010, no-hard-tabs)
Hard tabs
42-42: Column: 80 (MD010, no-hard-tabs)
Hard tabs
Line range hint
5-5
: Specify language for fenced code blocksTo improve the readability and formatting in Markdown viewers and editors, specify the language for each fenced code block.
- ``` + ```bashApply this change to all instances where the fenced code block language is missing.
Also applies to: 11-11, 17-17
Tools
Markdownlint
36-36: Column: 94 (MD010, no-hard-tabs)
Hard tabs
37-37: Column: 94 (MD010, no-hard-tabs)
Hard tabs
38-38: Column: 98 (MD010, no-hard-tabs)
Hard tabs
39-39: Column: 106 (MD010, no-hard-tabs)
Hard tabs
40-40: Column: 92 (MD010, no-hard-tabs)
Hard tabs
41-41: Column: 82 (MD010, no-hard-tabs)
Hard tabs
42-42: Column: 80 (MD010, no-hard-tabs)
Hard tabs
Line range hint
28-50
: Remove hard tabs from the Markdown fileUsing spaces instead of tabs will ensure consistent formatting across different editors and platforms.
- * [zetacored query observer list-tss-funds-migrator](zetacored_query_observer_list-tss-funds-migrator.md) - list all tss funds migrators + * [zetacored query observer list-tss-funds-migrator](zetacored_query_observer_list-tss-funds-migrator.md) - list all tss funds migratorsApply this change to all instances where hard tabs are used.
Tools
Markdownlint
36-36: Column: 94 (MD010, no-hard-tabs)
Hard tabs
37-37: Column: 94 (MD010, no-hard-tabs)
Hard tabs
38-38: Column: 98 (MD010, no-hard-tabs)
Hard tabs
39-39: Column: 106 (MD010, no-hard-tabs)
Hard tabs
40-40: Column: 92 (MD010, no-hard-tabs)
Hard tabs
41-41: Column: 82 (MD010, no-hard-tabs)
Hard tabs
42-42: Column: 80 (MD010, no-hard-tabs)
Hard tabs
Line range hint
52-52
: Avoid multiple consecutive blank linesReducing multiple blank lines to a single blank line helps in maintaining a clean and professional appearance of the document.
- - +Tools
Markdownlint
36-36: Column: 94 (MD010, no-hard-tabs)
Hard tabs
37-37: Column: 94 (MD010, no-hard-tabs)
Hard tabs
38-38: Column: 98 (MD010, no-hard-tabs)
Hard tabs
39-39: Column: 106 (MD010, no-hard-tabs)
Hard tabs
40-40: Column: 92 (MD010, no-hard-tabs)
Hard tabs
41-41: Column: 82 (MD010, no-hard-tabs)
Hard tabs
42-42: Column: 80 (MD010, no-hard-tabs)
Hard tabs
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files ignored due to path filters (2)
x/observer/types/query.pb.go
is excluded by!**/*.pb.go
x/observer/types/query.pb.gw.go
is excluded by!**/*.pb.gw.go
Files selected for processing (11)
- changelog.md (1 hunks)
- docs/cli/zetacored/zetacored_query_observer.md (2 hunks)
- docs/cli/zetacored/zetacored_query_observer_list-tss-funds-migrator.md (1 hunks)
- docs/cli/zetacored/zetacored_query_observer_show-tss-funds-migrator.md (1 hunks)
- docs/openapi/openapi.swagger.yaml (4 hunks)
- proto/zetachain/zetacore/observer/query.proto (2 hunks)
- typescript/zetachain/zetacore/observer/query_pb.d.ts (2 hunks)
- x/observer/client/cli/query.go (1 hunks)
- x/observer/client/cli/query_tss_fund_migrator.go (1 hunks)
- x/observer/keeper/grpc_query_tss_funds_migrator_info.go (1 hunks)
- x/observer/keeper/grpc_query_tss_funds_migrator_test.go (1 hunks)
Additional context used
GitHub Check: lint
x/observer/client/cli/query_tss_fund_migrator.go
[warning] 23-23:
var-naming: var chainId should be chainID (revive)
Markdownlint
docs/cli/zetacored/zetacored_query_observer_list-tss-funds-migrator.md
9-9: Expected: h2; Actual: h3 (MD001, heading-increment)
Heading levels should only increment by one level at a time
39-39: Column: 58 (MD010, no-hard-tabs)
Hard tabs
41-41: Expected: 1; Actual: 2 (MD012, no-multiple-blanks)
Multiple consecutive blank lines
5-5: null (MD040, fenced-code-language)
Fenced code blocks should have a language specified
11-11: null (MD040, fenced-code-language)
Fenced code blocks should have a language specified
28-28: null (MD040, fenced-code-language)
Fenced code blocks should have a language specifieddocs/cli/zetacored/zetacored_query_observer_show-tss-funds-migrator.md
9-9: Expected: h2; Actual: h3 (MD001, heading-increment)
Heading levels should only increment by one level at a time
39-39: Column: 58 (MD010, no-hard-tabs)
Hard tabs
41-41: Expected: 1; Actual: 2 (MD012, no-multiple-blanks)
Multiple consecutive blank lines
5-5: null (MD040, fenced-code-language)
Fenced code blocks should have a language specified
11-11: null (MD040, fenced-code-language)
Fenced code blocks should have a language specified
28-28: null (MD040, fenced-code-language)
Fenced code blocks should have a language specifieddocs/cli/zetacored/zetacored_query_observer.md
9-9: Expected: h2; Actual: h3 (MD001, heading-increment)
Heading levels should only increment by one level at a time
28-28: Column: 40 (MD010, no-hard-tabs)
Hard tabs
29-29: Column: 112 (MD010, no-hard-tabs)
Hard tabs
30-30: Column: 90 (MD010, no-hard-tabs)
Hard tabs
31-31: Column: 80 (MD010, no-hard-tabs)
Hard tabs
32-32: Column: 94 (MD010, no-hard-tabs)
Hard tabs
33-33: Column: 94 (MD010, no-hard-tabs)
Hard tabs
34-34: Column: 94 (MD010, no-hard-tabs)
Hard tabs
35-35: Column: 82 (MD010, no-hard-tabs)
Hard tabs
36-36: Column: 94 (MD010, no-hard-tabs)
Hard tabs
37-37: Column: 94 (MD010, no-hard-tabs)
Hard tabs
38-38: Column: 98 (MD010, no-hard-tabs)
Hard tabs
39-39: Column: 106 (MD010, no-hard-tabs)
Hard tabs
40-40: Column: 92 (MD010, no-hard-tabs)
Hard tabs
41-41: Column: 82 (MD010, no-hard-tabs)
Hard tabs
42-42: Column: 80 (MD010, no-hard-tabs)
Hard tabs
43-43: Column: 94 (MD010, no-hard-tabs)
Hard tabs
44-44: Column: 94 (MD010, no-hard-tabs)
Hard tabs
45-45: Column: 102 (MD010, no-hard-tabs)
Hard tabs
46-46: Column: 82 (MD010, no-hard-tabs)
Hard tabs
47-47: Column: 94 (MD010, no-hard-tabs)
Hard tabs
48-48: Column: 98 (MD010, no-hard-tabs)
Hard tabs
49-49: Column: 76 (MD010, no-hard-tabs)
Hard tabs
50-50: Column: 106 (MD010, no-hard-tabs)
Hard tabs
52-52: Expected: 1; Actual: 2 (MD012, no-multiple-blanks)
Multiple consecutive blank lines
5-5: null (MD040, fenced-code-language)
Fenced code blocks should have a language specified
11-11: null (MD040, fenced-code-language)
Fenced code blocks should have a language specified
17-17: null (MD040, fenced-code-language)
Fenced code blocks should have a language specifiedchangelog.md
223-223: Expected: asterisk; Actual: dash (MD004, ul-style)
Unordered list style
474-474: Expected: 0 or 2; Actual: 1 (MD009, no-trailing-spaces)
Trailing spaces
514-514: Expected: 0 or 2; Actual: 1 (MD009, no-trailing-spaces)
Trailing spaces
218-218: Expected: 1; Actual: 0; Below (MD022, blanks-around-headings)
Headings should be surrounded by blank lines
240-240: null (MD024, no-duplicate-heading)
Multiple headings with the same content
287-287: null (MD024, no-duplicate-heading)
Multiple headings with the same content
343-343: null (MD024, no-duplicate-heading)
Multiple headings with the same content
219-219: null (MD032, blanks-around-lists)
Lists should be surrounded by blank lines
359-359: null (MD032, blanks-around-lists)
Lists should be surrounded by blank lines
364-364: null (MD032, blanks-around-lists)
Lists should be surrounded by blank lines
368-368: null (MD032, blanks-around-lists)
Lists should be surrounded by blank lines
373-373: null (MD032, blanks-around-lists)
Lists should be surrounded by blank lines
242-242: null (MD034, no-bare-urls)
Bare URL used
532-532: null (MD047, single-trailing-newline)
Files should end with a single newline character
LanguageTool
changelog.md
[grammar] ~65-~65: It appears that a hyphen is missing in the plural noun “to-dos”? (TO_DO_HYPHEN)
Context: ...ub.com//pull/2329) - fix TODOs in rpc unit tests * [2342](https://gith...
[misspelling] ~80-~80: This word is normally spelled with a hyphen. (EN_COMPOUNDS_CHERRY_PICKED)
Context: ...//pull/2327) - partially cherry picked the fix to Bitcoin outbound dust amount...
[uncategorized] ~89-~89: When ‘mac-specific’ is used as a modifier, it is usually spelled with a hyphen. (SPECIFIC_HYPHEN)
Context: ...me which should be the version. Removed mac specific build as the arm build should handle th...
[style] ~90-~90: Consider changing the order of words to improve your wording. (TO_NOT_VB)
Context: ...ocker build step for non release builds to not overwrite the github tag * [2192](https...
[grammar] ~106-~106: Did you mean “sending”? Or maybe you should add a pronoun? In active voice, ‘require’ + ‘to’ takes an object, usually a pronoun. (ALLOW_TO)
Context: ... * Updating admin policies now requires to send a governance proposal executing the `Up...
[uncategorized] ~178-~178: Use a comma before ‘so’ if it connects two independent clauses (unless they are closely connected and short). (COMMA_COMPOUND_SENTENCE_2)
Context: ...n/node/pull/1899) - add empty test files so packages are included in coverage * [19...
[uncategorized] ~229-~229: Loose punctuation mark. (UNLIKELY_OPENING_PUNCTUATION)
Context: ... Breaking Changes *zetaclientd start
: now requires 2 inputs from stdin: hotke...
[grammar] ~266-~266: Did you mean “running”? Or maybe you should add a pronoun? In active voice, ‘allow’ + ‘to’ takes an object, usually a pronoun. (ALLOW_TO)
Context: ....com//pull/1584) - allow to run E2E tests on any networks * [1746](http...
[grammar] ~275-~275: The operating system from Apple is written “macOS”. (MAC_OS)
Context: ...nto dockerhub on release for ubuntu and macos * Adjusted the pipeline for building an...
[grammar] ~276-~276: The operating system from Apple is written “macOS”. (MAC_OS)
Context: ... building and pushing docker images for MacOS to install and run docker * Added docke...
[uncategorized] ~282-~282: When ‘start-up’ is used as a noun or modifier, it needs to be hyphenated. (VERB_NOUN_CONFUSION)
Context: ...he new docker image that facilitate the start up automation * Adjusted the docker pipeli...
[grammar] ~303-~303: Before the countable noun ‘to’ an article or a possessive pronoun is necessary. (IN_NN_CC_VBG)
Context: ...ssues/1610) - add pending outtx hash to tracker after monitoring for 10 minutes * [1656...
[uncategorized] ~369-~369: Loose punctuation mark. (UNLIKELY_OPENING_PUNCTUATION)
Context: ...arams described below. *GetCoreParams
: Renamed intoGetChainParams
. `/zeta-c...
[uncategorized] ~453-~453: Possible wrong verb form detected. Did you mean “been” or “being”? (BE_WITH_WRONG_VERB_FORM)
Context: ... update an observer, this can be either be run a tombstoned observer/validator or ...
[grammar] ~493-~493: Did you mean “testing”? Or maybe you should add a pronoun? In active voice, ‘allow’ + ‘to’ takes an object, usually a pronoun. (ALLOW_TO)
Context: ...pgrade name, and allow download. allows to test release * [1153](https://github.com/zet...
[misspelling] ~501-~501: This word is normally spelled with a hyphen. (EN_COMPOUNDS_CHERRY_PICK)
Context: ...github.com//pull/1235) - cherry pick all hotfix from v10.0.x (zero-amount, p...
Additional comments not posted (16)
x/observer/client/cli/query.go (1)
44-45
: Ensure correct integration of new CLI commands.The addition of
CmdGetAllTssFundsMigrator()
andCmdGetTssFundsMigrator()
to the list of commands is correctly implemented. Ensure these functions are properly defined and handle their respective functionalities as expected.x/observer/keeper/grpc_query_tss_funds_migrator_info.go (2)
14-36
: Review ofTssFundsMigratorInfo
function.This function is well-implemented with proper checks for null requests and invalid chain IDs. The error messages are clear and should help in debugging. Ensure that the function
GetFundMigrator
is robust and handles edge cases effectively.
38-51
: Review ofTssFundsMigratorInfoAll
function.The function handles the request appropriately, checking for null requests and retrieving all TSS funds migrators correctly. The implementation is straightforward and follows best practices for error handling and data retrieval.
x/observer/client/cli/query_tss_fund_migrator.go (1)
46-70
: Review ofCmdGetAllTssFundsMigrator
function.This function is correctly implemented for listing all TSS funds migrators. It uses pagination flags and query flags appropriately, ensuring a flexible and user-friendly command.
x/observer/keeper/grpc_query_tss_funds_migrator_test.go (2)
15-64
: Comprehensive test coverage for TSS funds migratorThe tests are well-structured and provide comprehensive coverage for various scenarios including error cases and successful data retrieval. This is crucial for ensuring the robustness of the TSS funds migrator functionality.
66-104
: Comprehensive test coverage for TSS funds migrator (all)The tests for querying all TSS funds migrators are thorough and cover scenarios from error handling to successful data retrieval, ensuring the functionality works as expected across different conditions.
proto/zetachain/zetacore/observer/query.proto (7)
19-19
: Import statement is correctly added.The import of
tss_funds_migrator.proto
is necessary for the new RPC methods and message types related to TSS funds migrators.
154-158
: New RPC methodTssFundsMigratorInfo
is well-defined.The method is correctly set up with an appropriate HTTP GET path and is designed to return specific TSS funds migrator information based on the chain ID provided in the request.
160-165
: New RPC methodTssFundsMigratorInfoAll
is correctly implemented.This method provides a way to retrieve information about all TSS funds migrators, correctly using a RESTful GET path and returning the expected list of migrators.
168-168
: Message definition forQueryTssFundsMigratorInfoAllRequest
is appropriate.This message serves as a request type for querying all TSS funds migrators, correctly designed as an empty message for methods that do not require specific input parameters.
170-173
: Message definition forQueryTssFundsMigratorInfoAllResponse
is well-structured.This response message is designed to handle multiple TSS funds migrators, using a repeated field with a non-nullable constraint to ensure data integrity.
175-175
: Message definition forQueryTssFundsMigratorInfoRequest
is correctly designed.This request message is appropriately structured with a
chain_id
field, necessary for querying specific TSS funds migrator information.
176-177
: Message definition forQueryTssFundsMigratorInfoResponse
ensures data integrity.This response message is well-designed, incorporating a non-nullable
TssFundMigratorInfo
field to guarantee that the response always contains valid migrator information.changelog.md (1)
31-31
: Change log entry for PR 2372 is correct and well-documented.The entry accurately reflects the addition of new queries for TSS fund migration information as described in the PR. Good job on maintaining the consistency and clarity in the changelog.
typescript/zetachain/zetacore/observer/query_pb.d.ts (2)
25-39
: New class for querying all TSS funds migrator info.The
QueryTssFundsMigratorInfoAllRequest
class is correctly defined according to the protobuf specification. It includes methods for serialization and comparison, which are standard for data transfer objects in TypeScript.
92-110
: Ensure correct handling of optional fields in response.The
QueryTssFundsMigratorInfoResponse
class includes an optionaltssFundsMigrator
field. It's important to confirm that all calling code correctly handles cases where this field might be null or undefined.
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 selected for processing (2)
- cmd/zetaclientd/gen_pre_params.go (1 hunks)
- x/observer/client/cli/query_tss_fund_migrator.go (1 hunks)
Files skipped from review due to trivial changes (1)
- cmd/zetaclientd/gen_pre_params.go
Files skipped from review as they are similar to previous changes (1)
- x/observer/client/cli/query_tss_fund_migrator.go
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.
just one small comment
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.
@kingpinXD ready for rereview? I may see #2372 (comment) is not fixed
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 (2)
x/observer/types/query.pb.go
is excluded by!**/*.pb.go
x/observer/types/query.pb.gw.go
is excluded by!**/*.pb.gw.go
Files selected for processing (2)
- docs/openapi/openapi.swagger.yaml (3 hunks)
- proto/zetachain/zetacore/observer/query.proto (2 hunks)
Files skipped from review as they are similar to previous changes (2)
- docs/openapi/openapi.swagger.yaml
- proto/zetachain/zetacore/observer/query.proto
Description
Closes #2371
Type of change
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Include instructions and any relevant details so others can reproduce.
Checklist:
Summary by CodeRabbit
New Features
list-tss-funds-migrator
andshow-tss-funds-migrator
for querying TSS funds migrator information.Documentation
list-tss-funds-migrator
andshow-tss-funds-migrator
.Tests
Chores