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

refactor(core,stf,x)!: remove InvokeTyped from router #21224

Merged
merged 16 commits into from
Aug 23, 2024

Conversation

julienrbrt
Copy link
Member

@julienrbrt julienrbrt commented Aug 8, 2024

Description

Ref: #21176


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...

  • included the correct type prefix in the PR title, you can find examples of the prefixes below:
  • confirmed ! in the type prefix if API or client breaking change
  • targeted the correct branch (see PR Targeting)
  • provided a link to the relevant issue or specification
  • reviewed "Files changed" and left comments if necessary
  • included the necessary unit and integration tests
  • added a changelog entry to CHANGELOG.md
  • updated the relevant documentation or specification, including comments for documenting Go code
  • confirmed all CI checks have passed

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.

Please see Pull Request Reviewer section in the contributing guide for more information on how to review a pull request.

I have...

  • confirmed the correct type prefix in the PR title
  • confirmed all author checklist items have been addressed
  • reviewed state machine logic, API design and naming, documentation is accurate, tests and test coverage

Summary by CodeRabbit

  • New Features

    • Improved dependency management, enhancing the reliability and performance of the application.
    • Added new required dependencies to support advanced features and optimize provided functionalities.
    • Simplified message invocation methods, promoting a more straightforward approach to message handling.
    • Enhanced error handling and response validation for improved robustness in message processing.
  • Bug Fixes

    • Adjusted dependency configurations to resolve compatibility issues and improve overall stability.
  • Chores

    • Reorganized dependencies to streamline project structure and ensure the use of up-to-date libraries.

Copy link
Contributor

coderabbitai bot commented Aug 8, 2024

Caution

Review failed

The pull request is closed.

Walkthrough

Walkthrough

The recent changes involve a reorganization of dependencies across various modules through updates to go.mod files, including additions and removals of indirect dependencies. Significant modifications have been made to message invocation methods, consolidating them into a unified function that enhances type safety. Additionally, function signatures have been updated to align with a new transaction message structure, improving consistency and clarity across the codebase.

Changes

Files Change Summary
x/accounts/defaults/lockup/go.mod, x/accounts/go.mod Updated dependencies by adding and removing several indirect dependencies for clarity and management.
server/v2/stf/core_router_service.go, server/v2/stf/stf.go, server/v2/stf/stf_router.go, server/v2/stf/stf_router_test.go Consolidated message invocation methods into a single Invoke function for enhanced type safety.
x/accounts/account_test.go, x/accounts/defaults/base/utils_test.go, x/accounts/defaults/multisig/utils_test.go, x/accounts/internal/implementation/encoding.go, x/accounts/internal/implementation/protoaccount.go, x/auth/types/expected_keepers.go Simplified function signatures to utilize transaction.Msg instead of ProtoMsg, promoting stronger type checks and clarity.
x/accounts/internal/implementation/api_builder.go, x/accounts/internal/implementation/context.go, x/accounts/internal/implementation/implementation.go, x/accounts/keeper.go Updated handler functions and method signatures to operate using transaction.Msg, enhancing consistency and type safety across the implementation.
x/auth/keeper/msg_server_test.go, x/authz/client/cli/tx.go Minor updates in test method calls and command formatting for consistency.

Sequence Diagram(s)

sequenceDiagram
    participant MsgRouterService
    participant Keeper
    participant Msg

    Keeper->>MsgRouterService: Invoke(ctx, msg)
    MsgRouterService-->>Keeper: Return execution result
Loading

Possibly related issues


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.

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.

@julienrbrt julienrbrt marked this pull request as ready for review August 8, 2024 20:40
@julienrbrt julienrbrt requested a review from a team as a code owner August 8, 2024 20:40
@julienrbrt
Copy link
Member Author

Looks like I messed up something in x/accounts. I can check that on monday (want to focus on other things tomorrow)

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: 1

Outside diff range, codebase verification and nitpick comments (10)
simapp/mint_fn.go (4)

33-40: Improve error handling for unexpected response types.

The error handling for unexpected response types is clear and provides useful feedback. However, consider logging the error for better traceability in production environments.

-  return fmt.Errorf("unexpected response type: %T", resp)
+  k.Logger.Error(fmt.Sprintf("unexpected response type: %T", resp))
+  return fmt.Errorf("unexpected response type: %T", resp)

42-49: Ensure consistent error handling across service invocations.

The error handling pattern is consistent across different service invocations, which is good for maintainability. However, consider logging errors for better traceability.

-  return fmt.Errorf("unexpected response type: %T", resp)
+  k.Logger.Error(fmt.Sprintf("unexpected response type: %T", resp))
+  return fmt.Errorf("unexpected response type: %T", resp)

53-60: Maintain consistency in error handling for type assertions.

The error handling for type assertions is consistent with previous segments. Ensure that this pattern is followed throughout the codebase for uniformity.

-  return fmt.Errorf("unexpected response type: %T", resp)
+  k.Logger.Error(fmt.Sprintf("unexpected response type: %T", resp))
+  return fmt.Errorf("unexpected response type: %T", resp)

62-70: Enhance error logging for unexpected response types.

For better debugging and traceability, consider logging the error message when the response type is unexpected.

-  return fmt.Errorf("unexpected response type: %T", resp)
+  k.Logger.Error(fmt.Sprintf("unexpected response type: %T", resp))
+  return fmt.Errorf("unexpected response type: %T", resp)
x/evidence/keeper/infraction.go (1)

76-83: Enhance error handling for unexpected response types.

The error handling for unexpected response types is clear and provides useful feedback. Consider logging the error for better traceability in production environments.

-  return fmt.Errorf("unexpected response type: %T", resp)
+  k.Logger.Error(fmt.Sprintf("unexpected response type: %T", resp))
+  return fmt.Errorf("unexpected response type: %T", resp)
x/group/go.mod (1)

193-193: Local path in replace directive does not exist

The local path specified in the replace directive for cosmossdk.io/x/accounts/defaults/lockup does not exist. Please verify if this path is correct and intended for development or testing purposes. Adjust the path or create the necessary directory if required.

  • Line 193 in x/group/go.mod: cosmossdk.io/x/accounts/defaults/lockup => ../accounts/defaults/lockup
Analysis chain

Verify the local path for the replace directive.

The replace directive for cosmossdk.io/x/accounts/defaults/lockup points to a local path. Ensure that this path is correct and intended for development or testing purposes.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the existence and correct usage of the local path in replace directive.

# Test: Check if the local path exists. Expect: Path should exist.
test -d ../accounts/defaults/lockup && echo "Path exists" || echo "Path does not exist"

Length of output: 86

x/accounts/defaults/lockup/lockup.go (2)

Inconsistent usage of accountstd.ExecModule found.

The function accountstd.ExecModule is used in lockup.go, while accountstd.ExecModuleAnys is used in multisig/account.go. This suggests an inconsistency that may need further investigation to ensure the correct function is used in each context.

  • x/accounts/defaults/lockup/lockup.go: Uses accountstd.ExecModule.
  • x/accounts/defaults/multisig/account.go: Uses accountstd.ExecModuleAnys.

Please verify whether the usage of different functions is intentional or if it requires alignment.

Analysis chain

Line range hint 390-395: LGTM! Verify consistent usage of accountstd.ExecModule.

The change to use accountstd.ExecModule improves type safety. Ensure consistent usage across the codebase.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify consistent usage of `accountstd.ExecModule`.

# Test: Search for `accountstd.ExecModule` usage. Expect: Consistent usage across the codebase.
rg --type go 'accountstd.ExecModule'

Length of output: 286


540-550: Ensure Consistent Use of Type Assertions in Functions Using QueryModule.

While the type assertion in the reviewed function improves error handling, other functions using QueryModule lack similar assertions. Consistency in applying this pattern will enhance robustness across the codebase.

  • Review functions using QueryModule to ensure they include appropriate type assertions.
Analysis chain

LGTM! Verify type assertion for similar functions.

The type assertion ensures the response is of the expected type, improving error handling.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify type assertion for similar functions.

# Test: Search for functions using `QueryModule` and check for type assertions. Expect: Proper type assertions.
rg --type go 'QueryModule' -A 5

Length of output: 207205

x/staking/keeper/msg_server.go (2)

72-80: Inconsistent Response Type Handling Across Methods

The type assertion for response handling, as seen in the reviewed snippet, is not consistently applied across similar methods using the Invoke function. This may lead to unexpected behavior if the response type is not as expected.

  • Consider reviewing and updating similar methods to include type assertions for enhanced robustness.
Analysis chain

LGTM! Verify response type handling in similar methods.

The type assertion ensures the response is of the expected type, enhancing robustness.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify response type handling in similar methods.

# Test: Search for methods using `Invoke` and check for type assertions. Expect: Proper type assertions.
rg --type go 'Invoke' -A 5

Length of output: 216056


660-668: Inconsistent Use of Type Assertions After Invoke Calls

The review of Invoke method usage across the codebase reveals that type assertions are not consistently applied. This can lead to runtime errors if the response type is unexpected. It is recommended to review and apply type assertions where necessary to ensure robust error handling.

  • Files to Review:
    • x/authz/tx.pb.go
    • x/upgrade/types/tx.pb.go
    • x/upgrade/types/query.pb.go
    • x/staking/keeper/msg_server.go

Please ensure that type assertions are used consistently after Invoke calls to handle potential type mismatches.

Analysis chain

LGTM! Verify type assertion for similar methods.

The type assertion ensures the response is of the expected type, improving error handling.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify type assertion for similar methods.

# Test: Search for methods using `Invoke` and check for type assertions. Expect: Proper type assertions.
rg --type go 'Invoke' -A 5

Length of output: 216056

Review details

Configuration used: .coderabbit.yml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 849bccc and 17de27b.

Files ignored due to path filters (2)
  • x/accounts/go.sum is excluded by !**/*.sum
  • x/group/go.sum is excluded by !**/*.sum
Files selected for processing (39)
  • core/router/service.go (1 hunks)
  • runtime/router.go (4 hunks)
  • runtime/router_test.go (2 hunks)
  • server/v2/stf/core_router_service.go (2 hunks)
  • server/v2/stf/stf.go (3 hunks)
  • server/v2/stf/stf_router.go (2 hunks)
  • server/v2/stf/stf_router_test.go (2 hunks)
  • simapp/mint_fn.go (2 hunks)
  • testutil/mock/types_module_module.go (2 hunks)
  • types/module/module.go (1 hunks)
  • x/accounts/account_test.go (3 hunks)
  • x/accounts/accountstd/exports.go (2 hunks)
  • x/accounts/accountstd/test_util.go (2 hunks)
  • x/accounts/coin_transfer.go (3 hunks)
  • x/accounts/defaults/base/account.go (1 hunks)
  • x/accounts/defaults/base/utils_test.go (1 hunks)
  • x/accounts/defaults/lockup/go.mod (6 hunks)
  • x/accounts/defaults/lockup/lockup.go (4 hunks)
  • x/accounts/defaults/lockup/utils_test.go (2 hunks)
  • x/accounts/defaults/multisig/account_test.go (4 hunks)
  • x/accounts/defaults/multisig/utils_test.go (1 hunks)
  • x/accounts/go.mod (4 hunks)
  • x/accounts/internal/implementation/context.go (4 hunks)
  • x/accounts/internal/implementation/context_test.go (3 hunks)
  • x/accounts/keeper.go (7 hunks)
  • x/auth/ante/setup.go (1 hunks)
  • x/auth/keeper/keeper.go (1 hunks)
  • x/auth/testutil/expected_keepers_mocks.go (1 hunks)
  • x/auth/types/expected_keepers.go (1 hunks)
  • x/auth/vesting/testutil/expected_keepers_mocks.go (1 hunks)
  • x/authz/keeper/keeper.go (1 hunks)
  • x/evidence/keeper/infraction.go (1 hunks)
  • x/gov/keeper/abci.go (1 hunks)
  • x/gov/keeper/abci_internal_test.go (1 hunks)
  • x/gov/keeper/msg_server.go (1 hunks)
  • x/group/go.mod (2 hunks)
  • x/group/keeper/proposal_executor.go (1 hunks)
  • x/staking/keeper/msg_server.go (2 hunks)
  • x/upgrade/keeper/abci.go (1 hunks)
Files skipped from review due to trivial changes (3)
  • x/auth/testutil/expected_keepers_mocks.go
  • x/auth/types/expected_keepers.go
  • x/auth/vesting/testutil/expected_keepers_mocks.go
Additional context used
Path-based instructions (33)
core/router/service.go (1)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

x/gov/keeper/abci_internal_test.go (2)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.


Pattern **/*_test.go: "Assess the unit test code assessing sufficient code coverage for the changes associated in the pull request"

x/accounts/accountstd/test_util.go (1)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

server/v2/stf/stf_router_test.go (2)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.


Pattern **/*_test.go: "Assess the unit test code assessing sufficient code coverage for the changes associated in the pull request"

server/v2/stf/core_router_service.go (1)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

x/accounts/coin_transfer.go (1)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

runtime/router_test.go (2)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.


Pattern **/*_test.go: "Assess the unit test code assessing sufficient code coverage for the changes associated in the pull request"

x/accounts/internal/implementation/context_test.go (2)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.


Pattern **/*_test.go: "Assess the unit test code assessing sufficient code coverage for the changes associated in the pull request"

x/group/keeper/proposal_executor.go (1)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

x/accounts/defaults/base/utils_test.go (2)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.


Pattern **/*_test.go: "Assess the unit test code assessing sufficient code coverage for the changes associated in the pull request"

x/auth/ante/setup.go (1)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

x/accounts/defaults/lockup/utils_test.go (2)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.


Pattern **/*_test.go: "Assess the unit test code assessing sufficient code coverage for the changes associated in the pull request"

x/accounts/account_test.go (2)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.


Pattern **/*_test.go: "Assess the unit test code assessing sufficient code coverage for the changes associated in the pull request"

runtime/router.go (1)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

x/accounts/internal/implementation/context.go (1)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

x/upgrade/keeper/abci.go (1)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

server/v2/stf/stf_router.go (1)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

x/accounts/accountstd/exports.go (1)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

simapp/mint_fn.go (1)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

x/evidence/keeper/infraction.go (1)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

x/accounts/defaults/multisig/utils_test.go (2)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.


Pattern **/*_test.go: "Assess the unit test code assessing sufficient code coverage for the changes associated in the pull request"

x/accounts/defaults/base/account.go (1)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

x/gov/keeper/abci.go (1)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

x/auth/keeper/keeper.go (1)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

x/accounts/defaults/multisig/account_test.go (2)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.


Pattern **/*_test.go: "Assess the unit test code assessing sufficient code coverage for the changes associated in the pull request"

testutil/mock/types_module_module.go (1)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

x/authz/keeper/keeper.go (1)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

x/accounts/keeper.go (1)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

x/gov/keeper/msg_server.go (1)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

server/v2/stf/stf.go (1)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

x/accounts/defaults/lockup/lockup.go (1)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

x/staking/keeper/msg_server.go (1)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

types/module/module.go (1)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

Additional comments not posted (57)
core/router/service.go (1)

14-15: Consolidation of Invoke methods is effective.

The consolidation of InvokeTyped and InvokeUntyped into a single Invoke method simplifies the interface and aligns with the goal of reducing redundancy. The updated method signature is clear and follows the Uber Golang style guide.

Ensure that all implementations of the Service interface correctly handle the new Invoke method signature.

x/gov/keeper/abci_internal_test.go (1)

19-19: Method renaming aligns with interface changes.

Renaming InvokeUntyped to Invoke in mockRouterService aligns with the updated Service interface. The internal logic remains unchanged, ensuring compatibility with existing tests.

x/accounts/accountstd/test_util.go (1)

7-7: Simplification and aliasing improve clarity.

The removal of the moduleExecUntyped parameter from NewMockContext simplifies the function signature. Aliasing the testing package as coretesting enhances clarity and readability.

server/v2/stf/stf_router_test.go (1)

42-43: LGTM! But verify the impact of removing TestMerge.

The update to test the Invoke method is approved.

However, ensure that the removal of TestMerge does not negatively affect test coverage for merge-related functionality.

Verification successful

Test coverage for merge functionality remains sufficient.

The removal of TestMerge in stf_router_test.go does not negatively affect the overall test coverage, as there are multiple other tests covering merge functionality in different parts of the codebase.

  • store/types/store_test.go: TestTraceContext_Merge
  • store/cachekv/store_test.go: Several tests related to merge iterators
  • simapp/app_test.go: TestMergedRegistry
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the impact of removing `TestMerge` on test coverage.

# Test: Search for other tests covering merge functionality. Expect: Other tests should cover merge functionality.
rg --type go 'func Test.*Merge'

Length of output: 647

server/v2/stf/core_router_service.go (2)

31-33: Unified Invoke method simplifies invocation process.

The consolidation of InvokeTyped and InvokeUntyped into a single Invoke method enhances maintainability and reduces complexity.


50-55: Unified Invoke method enhances query invocation.

The changes align with the consolidation strategy, improving clarity and reducing complexity.

x/accounts/coin_transfer.go (1)

Line range hint 40-60:
Simplified coinsTransferMsgFunc improves clarity.

The reduction to a single message return type streamlines the function's interface, enhancing usability.

runtime/router_test.go (4)

40-42: Ensure error messages are clear and informative.

The error message in the test case for an invalid message is clear and specifies the issue with finding the response type. This is good practice for debugging.


56-57: Ensure consistency in error handling for queries.

The test case for an invalid query uses the Invoke method and checks for a specific error message. This maintains consistency in error handling across message and query tests.


Line range hint 60-67:
Check the coverage of the valid query test.

The test case for a valid query uses the Invoke method and verifies the response. Ensure that this test covers all necessary scenarios for valid queries.


44-49: Verify the correctness of the valid message test.

The test case for a valid message correctly uses the Invoke method and checks for a non-nil response. Ensure that this test covers all necessary scenarios for valid messages.

x/accounts/internal/implementation/context_test.go (3)

22-22: Simplify parameter handling in MakeAccountContext.

The removal of unnecessary nil parameters simplifies the function call, making the code cleaner and easier to read.


58-65: Clarify the return type in QueryModule.

The change to explicitly return a ProtoMsg enhances clarity regarding the expected output. This is a good practice for improving type safety and understanding.


47-52: Verify the unification of ExecModule functionality.

The change to use ExecModule instead of ExecModuleUntyped suggests a unification of functionality. Ensure that this change does not introduce any unintended behavior differences.

Verification successful

Unification of ExecModule functionality verified successfully.

The unification of ExecModule functionality appears consistent across the codebase. The test case in context_test.go specifically verifies its behavior, ensuring no unintended differences were introduced.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify that the unification of `ExecModule` functionality does not introduce unintended behavior.

# Test: Search for all occurrences of `ExecModule` to ensure consistent behavior.
rg --type go "ExecModule" -A 5

Length of output: 5162

x/group/keeper/proposal_executor.go (1)

48-48: Enhance type safety with Invoke.

The change to use Invoke instead of InvokeUntyped likely enhances type safety in message processing. Ensure that this change does not affect the functionality of message execution.

x/accounts/defaults/base/utils_test.go (2)

61-64: Enhance test utility by returning a response message.

The change to return a ProtoMsg alongside an error in the anonymous function enhances the test utility by allowing more realistic message processing scenarios.


64-73: Ensure correct response type in test scenarios.

The addition of response type handling and merging ensures the response is correctly constructed. This change improves the clarity and functionality of the test setup.

x/auth/ante/setup.go (2)

49-50: Improve error handling by validating response type.

The change to type-assert the response and handle unexpected types improves the robustness of the function by catching errors early.


54-57: Add error handling for unexpected response types.

By adding error handling for unexpected response types, this change enhances the function's robustness and prevents potential runtime errors.

x/accounts/defaults/lockup/utils_test.go (2)

Line range hint 76-91: Simplify callback signatures for clarity.

The simplification of the callback signatures by removing unused parameters improves the clarity of the function.


91-113: Enhance response handling in test scenarios.

The changes to return a ProtoMsg and handle response merging improve the clarity and functionality of the test setup, allowing for more realistic scenarios.

x/accounts/account_test.go (3)

31-31: Ensure correct response handling in RegisterInitHandler.

The removal of type parameters from QueryModule simplifies the call. Ensure that the response is handled correctly and matches expected types.

Verification successful

No response handling needed for QueryModule in RegisterInitHandler.

In the test file account_test.go, the QueryModule call within RegisterInitHandler is used for validation purposes, and its response is not processed further. Ensure this pattern is consistent across other usages if applicable. No issues found with the current implementation.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify that the response handling in `RegisterInitHandler` matches expected types.

# Test: Search for `RegisterInitHandler` usage and verify response handling.
rg --type go -A 5 'RegisterInitHandler'

Length of output: 10032


55-55: Ensure correct response handling in RegisterExecuteHandlers.

The removal of type parameters from ExecModule simplifies the call. Ensure that the response is handled correctly and matches expected types.

Verification successful

Response handling in RegisterExecuteHandlers is correct.

The response handling in the RegisterExecuteHandlers function matches the expected types and is consistent across different implementations. The removal of type parameters from ExecModule does not affect this correctness.

  • Files and lines where RegisterExecuteHandlers is implemented:
    • x/accounts/account_test.go
    • x/accounts/internal/implementation/account_test.go
    • x/accounts/testing/counter/counter.go
    • x/accounts/testing/account_abstraction/minimal.go
    • x/accounts/defaults/lockup/delayed_locking_account.go
    • x/accounts/defaults/lockup/lockup.go
    • x/accounts/defaults/lockup/permanent_locking_account.go
    • x/accounts/defaults/multisig/account.go
    • x/accounts/defaults/lockup/periodic_locking_account.go
    • x/accounts/defaults/lockup/continuous_locking_account.go
    • x/accounts/defaults/base/account.go
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify that the response handling in `RegisterExecuteHandlers` matches expected types.

# Test: Search for `RegisterExecuteHandlers` usage and verify response handling.
rg --type go -A 5 'RegisterExecuteHandlers'

Length of output: 9119


93-104: Verify type assertion and response handling in RegisterQueryHandlers.

The addition of a type assertion for the response enhances error handling. Ensure that the response type is as expected to avoid unnecessary panics.

Verification successful

Type assertion in RegisterQueryHandlers is valid and necessary.

The type assertion for QueryBalanceResponse ensures that the response from QueryModule is correctly handled, preventing unexpected types from causing issues. This is a valid enhancement to error handling.

  • The QueryModule function returns a generic ProtoMsg, making the type assertion necessary.
  • The QueryBalanceResponse struct is a standard type used across different modules.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify that the response type in `RegisterQueryHandlers` is as expected.

# Test: Search for `RegisterQueryHandlers` usage and verify response type handling.
rg --type go -A 5 'RegisterQueryHandlers'

Length of output: 5574


Script:

#!/bin/bash
# Description: Locate the implementation of the `QueryModule` function and verify response handling.

# Search for the `QueryModule` function definition to understand its return type.
ast-grep --lang go --pattern 'func QueryModule($_, $_) $_ { $$$ }'

# Search for the `QueryBalanceResponse` struct to verify its definition and usage.
rg --type go 'type QueryBalanceResponse struct'

Length of output: 1463

runtime/router.go (2)

Line range hint 109-138:
Confirm error handling in queryRouterService.Invoke.

The consolidation of query handling into a single Invoke function simplifies the interface. Ensure that error handling is robust, particularly in the creation and management of response objects.

Verification successful

Error handling in queryRouterService.Invoke is adequately verified.

The test cases in runtime/router_test.go confirm that error handling is robust. They check for specific error messages when the response type is not found and ensure correct behavior for valid requests. No further action is needed.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify error handling in `queryRouterService.Invoke`.

# Test: Search for `queryRouterService.Invoke` usage and verify error handling.
rg --type go -A 5 'queryRouterService.Invoke'

Length of output: 922


Line range hint 48-75:
Confirm error handling in msgRouterService.Invoke.

The consolidation of message handling into a single Invoke function simplifies the interface. Ensure that error handling is robust, particularly in the creation and management of response objects.

x/accounts/internal/implementation/context.go (2)

84-92: Verify response handling in ExecModule.

The simplification of the ExecModule function reduces complexity. Ensure that response handling is correct and aligns with the expected module execution outcomes.

Verification successful

Response handling in ExecModule is adequately verified.

The ExecModule function is tested in multiple contexts, ensuring that it handles responses correctly. These tests confirm that the function executes as expected and returns the correct responses, aligning with the intended functionality. No further action is needed.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify response handling in `ExecModule`.

# Test: Search for `ExecModule` usage and verify response handling.
rg --type go -A 5 'ExecModule'

Length of output: 5162


98-104: Verify response handling in QueryModule.

The simplification of the QueryModule function reduces complexity. Ensure that response handling is correct and aligns with the expected module query outcomes.

Verification successful

Response handling in QueryModule is adequately verified.

The existing tests in the codebase ensure that QueryModule handles responses correctly, including error handling and expected outcomes. These tests confirm that the function's behavior aligns with expected module query results.

  • Tests in x/accounts/internal/implementation/context_test.go and other related files validate response handling.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify response handling in `QueryModule`.

# Test: Search for `QueryModule` usage and verify response handling.
rg --type go -A 5 'QueryModule'

Length of output: 207205

x/upgrade/keeper/abci.go (1)

48-56: LGTM! Verify the usage of Invoke.

The changes improve error handling and type safety by using a type assertion after invoking the Invoke method. Ensure that all usages of Invoke in the codebase handle responses correctly.

server/v2/stf/stf_router.go (1)

161-168: LGTM! Verify the removal of InvokeTyped.

The refactoring simplifies the message invocation logic by consolidating it into a single Invoke method. Ensure that all references to InvokeTyped have been removed from the codebase.

Verification successful

Verification Successful: InvokeTyped has been removed from the codebase.

The search for any occurrences of InvokeTyped returned no results, confirming its complete removal.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the removal of the `InvokeTyped` method from the codebase.

# Test: Search for any remaining references to `InvokeTyped`. Expect: No occurrences.
rg --type go $'InvokeTyped'

Length of output: 26


Script:

#!/bin/bash
# Description: Verify the removal of the `InvokeTyped` method definition from the codebase.

# Test: Search for the definition of `InvokeTyped`. Expect: No occurrences.
ast-grep --lang go --pattern 'func InvokeTyped($$$) { $$$ }'

Length of output: 62


Script:

#!/bin/bash
# Description: Verify the complete removal of `InvokeTyped` from the codebase.

# Test: Search for any occurrences of `InvokeTyped` in all files. Expect: No occurrences.
rg 'InvokeTyped'

Length of output: 16

x/accounts/accountstd/exports.go (1)

93-99: LGTM! Verify the removal of ExecModuleUntyped.

The simplification of ExecModule and QueryModule functions enhances clarity and maintainability. Ensure that all references to ExecModuleUntyped have been removed from the codebase.

Verification successful

Removal of ExecModuleUntyped Verified

The reference to ExecModuleUntyped found in x/accounts/internal/implementation/context_test.go is within a comment and not in active code. This confirms that ExecModuleUntyped has been removed from the codebase. The comment does not affect the functionality.

  • x/accounts/internal/implementation/context_test.go: Reference found in a comment.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the removal of the `ExecModuleUntyped` function from the codebase.

# Test: Search for any remaining references to `ExecModuleUntyped`. Expect: No occurrences.
rg --type go $'ExecModuleUntyped'

Length of output: 126


Script:

#!/bin/bash
# Check the context around the reference to `ExecModuleUntyped` in the test file
rg --type go -A 5 -B 5 'ExecModuleUntyped' x/accounts/internal/implementation/context_test.go

Length of output: 800

x/accounts/defaults/multisig/utils_test.go (1)

166-178: Ensure sufficient test coverage for new return types.

The change to return ProtoMsg alongside error enhances flexibility. Ensure that tests cover scenarios where the returned message is used, and validate the correctness of the returned message.

x/accounts/defaults/lockup/go.mod (3)

20-21: Verify the necessity of added dependencies.

Ensure that the newly added dependencies cosmossdk.io/core/testing and cosmossdk.io/depinject are required for the module's functionality and do not introduce unnecessary bloat.

Verification successful

Dependencies are necessary and widely used.

The dependencies cosmossdk.io/core/testing and cosmossdk.io/depinject are extensively used across the codebase, particularly in test files and some non-test files, confirming their necessity for the module's functionality.

  • cosmossdk.io/core/testing is used in numerous test files, indicating its role in testing.
  • cosmossdk.io/depinject is used in both test and non-test files, suggesting its importance for dependency injection.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the usage of newly added dependencies in the codebase.

# Test: Search for usage of `cosmossdk.io/core/testing`. Expect: At least one usage.
rg --type go 'cosmossdk.io/core/testing'

# Test: Search for usage of `cosmossdk.io/depinject`. Expect: At least one usage.
rg --type go 'cosmossdk.io/depinject'

Length of output: 13586


44-44: Check for potential conflicts with github.com/cometbft/cometbft/api.

The version v1.0.0-rc.1 might be a release candidate. Ensure compatibility and stability within the project.


48-48: Ensure compatibility with github.com/cosmos/crypto.

Verify that the new dependency github.com/cosmos/crypto v0.1.2 does not conflict with existing cryptographic operations.

x/accounts/go.mod (5)

83-83: Confirm the reintroduction of github.com/golang/mock.

Ensure that github.com/golang/mock v1.6.0 is necessary for testing purposes and does not introduce redundant dependencies.

Verification successful

Reintroduction of github.com/golang/mock is necessary and justified.

The github.com/golang/mock package is used extensively across various test files in the codebase, indicating its necessity for testing purposes. There is no evidence of redundant dependencies introduced by this package.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the usage of `github.com/golang/mock` in the codebase.

# Test: Search for usage of `github.com/golang/mock`. Expect: At least one usage.
rg --type go 'github.com/golang/mock'

Length of output: 6894


29-29: Verify the necessity of cosmossdk.io/schema.

Ensure that the dependency cosmossdk.io/schema v0.1.1 is required for the module's functionality and does not introduce unnecessary bloat.

Verification successful

cosmossdk.io/schema is a necessary dependency.

The cosmossdk.io/schema package is used extensively across multiple files in the codebase, indicating its importance for the module's functionality. Removing it could disrupt the module's operations.

  • Usage found in various directories such as schema/testing, schema/decoding, schema/indexer, indexer/postgres, and baseapp.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the usage of `cosmossdk.io/schema` in the codebase.

# Test: Search for usage of `cosmossdk.io/schema`. Expect: At least one usage.
rg --type go 'cosmossdk.io/schema'

Length of output: 3134


34-34: Check for potential impact of cosmossdk.io/x/distribution.

The addition of cosmossdk.io/x/distribution could impact module interactions. Verify its necessity and ensure it aligns with the module's objectives.

Verification successful

cosmossdk.io/x/distribution is integral to the module's functionality.

The cosmossdk.io/x/distribution module is extensively used across various components, including tests, simulations, and core functionalities. Its presence is necessary for the module's operations and aligns with the module's objectives. Therefore, its inclusion is justified and should be retained.

  • Files with usage:
    • x/distribution/keeper/keeper.go
    • x/distribution/module.go
    • simapp/app.go
    • Various test and simulation files
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the usage and necessity of `cosmossdk.io/x/distribution`.

# Test: Search for usage of `cosmossdk.io/x/distribution`. Expect: At least one usage.
rg --type go 'cosmossdk.io/x/distribution'

Length of output: 8886


184-184: Update the replace directive for cosmossdk.io/x/accounts/defaults/lockup.

The change in the path for the replace directive could impact local module resolution. Ensure that this change is intentional and aligns with the project's structure.

Verification successful

Replace directive for cosmossdk.io/x/accounts/defaults/lockup is correctly updated.

The replace directive pointing to ./defaults/lockup aligns with the project's structure and ensures local module resolution. There are no indications of issues from the search results.

  • The directive ensures that the local version of the module is used across the project.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the impact of the replace directive change for `cosmossdk.io/x/accounts/defaults/lockup`.

# Test: Check for any issues related to module resolution.
go mod tidy && go mod verify

Length of output: 83


Script:

#!/bin/bash
# Search for references to `cosmossdk.io/x/accounts/defaults/lockup` in the codebase.
rg 'cosmossdk\.io/x/accounts/defaults/lockup' -A 5

Length of output: 15276


122-122: Assess the impact of github.com/munnerz/goautoneg.

The addition of github.com/munnerz/goautoneg should be evaluated for its necessity and potential impact on the module.

Verification successful

github.com/munnerz/goautoneg is an indirect dependency

The package github.com/munnerz/goautoneg is listed as an indirect dependency in go.mod, indicating it is required by another dependency in the project. Its presence in go.sum with checksums confirms its role in the dependency tree. No direct usage was found in the codebase, so its inclusion seems necessary for the proper functioning of other dependencies.

  • File: x/accounts/go.mod
  • File: x/accounts/go.sum
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the usage and necessity of `github.com/munnerz/goautoneg`.

# Test: Search for usage of `github.com/munnerz/goautoneg`. Expect: At least one usage.
rg --type go 'github.com/munnerz/goautoneg'

Length of output: 43


Script:

#!/bin/bash
# Check for comments or notes in go.mod related to `github.com/munnerz/goautoneg`
rg 'github.com/munnerz/goautoneg' x/accounts/go.mod -A 2

# Check if `github.com/munnerz/goautoneg` is listed in go.sum as an indirect dependency
rg 'github.com/munnerz/goautoneg' x/accounts/go.sum

Length of output: 545

x/group/go.mod (1)

49-49: Ensure the necessity of the new indirect dependency.

The addition of cosmossdk.io/x/distribution as an indirect dependency should be verified for necessity. Ensure it is required for the build or tests.

Verification successful

The indirect dependency cosmossdk.io/x/distribution is necessary.

The package cosmossdk.io/x/distribution is used extensively across various files in the codebase, indicating its importance for both functionality and testing. Therefore, its inclusion as an indirect dependency is justified.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check if `cosmossdk.io/x/distribution` is used in the codebase.

# Test: Search for the usage of the package. Expect: At least one occurrence.
rg --type go 'cosmossdk.io/x/distribution'

Length of output: 8886

x/gov/keeper/abci.go (1)

291-291: Confirm the correctness of the method change to Invoke.

The change from InvokeUntyped to Invoke suggests a shift towards stronger typing. Verify that the Invoke method is correctly implemented and compatible with the expected behavior.

x/auth/keeper/keeper.go (1)

318-318: Verify the method change to SendModuleMessage.

The change from SendModuleMessageUntyped to SendModuleMessage indicates a refinement in the method's interface. Ensure that the new method is correctly implemented and maintains the intended functionality.

x/accounts/defaults/multisig/account_test.go (3)

18-18: Parameter renaming improves clarity.

Renaming the parameter to _ indicates that it is intentionally unused, which enhances code readability.


445-451: Simplified mock context creation.

The changes streamline the mock context setup, focusing on the necessary parameters for the test.

Ensure that the test logic aligns with the new context setup.

Verification successful

Test logic aligns with the simplified mock context setup.

The TestProposal_NotPassing function appropriately uses the simplified mock context setup, ensuring the test logic remains consistent and focused on necessary parameters.

  • The mock context creation and its usage in the test are aligned with the intended simplification.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify that the test logic in `TestProposal_NotPassing` aligns with the new mock context setup.

# Test: Search for `TestProposal_NotPassing` to review its logic. Expect: Consistency with the new mock context setup.
rg --type go -A 5 'func TestProposal_NotPassing'

Length of output: 512


Script:

#!/bin/bash
# Description: Capture more lines of the `TestProposal_NotPassing` function to ensure complete logic is reviewed.

# Test: Retrieve additional lines of the `TestProposal_NotPassing` function.
rg --type go -A 50 'func TestProposal_NotPassing'

Length of output: 3433


Line range hint 566-579: Consistent mock context setup.

The changes ensure consistency in the mock context setup across tests.

Verify that the test logic aligns with the new context setup.

Verification successful

Test logic aligns with the new mock context setup.

The TestProposalPassing function correctly uses the updated NewMockContext setup and maintains consistency throughout its logic. The setup, execution, and assertions are aligned with the intended test behavior.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify that the test logic in `TestProposalPassing` aligns with the new mock context setup.

# Test: Search for `TestProposalPassing` to review its logic. Expect: Consistency with the new mock context setup.
rg --type go -A 5 'func TestProposalPassing'

Length of output: 504


Script:

#!/bin/bash
# Retrieve the complete implementation of `TestProposalPassing` to verify its logic.
ast-grep --lang go --pattern 'func TestProposalPassing($_) { $$$ }'

Length of output: 10539

testutil/mock/types_module_module.go (1)

268-328: New mock struct and methods added for testing.

The MockhasServicesV1 struct and its methods provide necessary functionality to mock the hasServicesV1 interface, enhancing testing capabilities.

x/authz/keeper/keeper.go (1)

148-148: Refactored to use Invoke for message dispatching.

The change from InvokeUntyped to Invoke aligns with the refactoring objectives to simplify message invocation.

Ensure that the Invoke method is correctly implemented and used across the codebase.

Verification successful

Refactored Invoke usage is consistent across the codebase

The Invoke method is widely used across various modules and appears to be implemented consistently with the expected behavior. The change from InvokeUntyped to Invoke in the authz/keeper/keeper.go file aligns with the overall usage pattern observed in the codebase.

  • The Invoke method is implemented in core/router/service.go, which confirms its presence and expected functionality.
  • Multiple instances of Invoke usage across different files indicate its integration into the system.

This refactoring aligns with the intended simplification of message invocation.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the usage of the `Invoke` method in the codebase.

# Test: Search for the `Invoke` method to review its implementation and usage. Expect: Correct implementation and usage.
rg --type go -A 5 'Invoke('

Length of output: 94


Script:

#!/bin/bash
# Description: Verify the usage of the `Invoke` method in the codebase.

# Test: Search for the `Invoke` method to review its implementation and usage. Expect: Correct implementation and usage.
rg --type go -A 5 'Invoke\('

Length of output: 206420

x/accounts/keeper.go (3)

387-400: Simplified function logic approved.

The removal of the msgResp parameter in sendModuleMessage simplifies the function and aligns with the refactoring goals.


406-407: Improved clarity in queryModule function.

The changes to queryModule enhance clarity by directly returning the response.


Line range hint 362-379:
LGTM! Verify the function usage in the codebase.

The changes to SendModuleMessage look good, but ensure all calls to this function are updated to match the new signature.

Verification successful

Function SendModuleMessage usage is consistent with the new signature.

The function SendModuleMessage has been updated to handle typed messages and returns a response of type implementation.ProtoMsg. The updated signature is correctly used across the codebase, including in the following files:

  • x/auth/keeper/keeper.go
  • x/accounts/keeper.go
  • Mocks in x/auth/vesting/testutil/expected_keepers_mocks.go and x/auth/testutil/expected_keepers_mocks.go
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `SendModuleMessage` match the new signature.

# Test: Search for the function usage. Expect: Only occurrences of the new signature.
rg --type go -A 5 $'SendModuleMessage'

Length of output: 5003

x/gov/keeper/msg_server.go (1)

389-389: Enhanced type safety in SudoExec.

The change from InvokeUntyped to Invoke in SudoExec improves type safety and aligns with the refactoring goals.

server/v2/stf/stf.go (3)

324-324: Improved type safety in runTxMsgs.

The change from InvokeUntyped to Invoke in runTxMsgs enhances type safety, aligning with refactoring objectives.


360-360: Type safety improvement in runConsensusMessages.

The change from InvokeUntyped to Invoke in runConsensusMessages enhances type safety, aligning with refactoring objectives.


473-473: Enhanced type safety in Query.

The change from InvokeUntyped to Invoke in Query improves type safety, aligning with refactoring objectives.

x/accounts/defaults/lockup/lockup.go (1)

405-414: LGTM! Verify response type handling in similar functions.

The type assertion ensures the response is of the expected type, enhancing robustness.

types/module/module.go (1)

99-100: LGTM! Verify usage of appmodulev2.AppModule.

The change to use appmodulev2.AppModule likely reflects an upgrade or refactor. Ensure consistent usage across the codebase.

Verification successful

Verification Successful: Consistent Usage of appmodulev2.AppModule Found

The usage of appmodulev2.AppModule is consistent across various parts of the codebase, including types/module/module.go, x/auth/module.go, and multiple files in the runtime/v2 directory. This suggests that the refactor or upgrade has been applied uniformly. No issues were found.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify usage of `appmodulev2.AppModule`.

# Test: Search for `appmodulev2.AppModule` usage. Expect: Consistent usage across the codebase.
rg --type go 'appmodulev2.AppModule'

Length of output: 903

Comment on lines 166 to 174
accNum, err := accountstd.QueryModule(ctx, &accountsv1.AccountNumberRequest{Address: addrStr})
if err != nil {
return 0, err
}

return accNum.Number, nil
resp, ok := accNum.(*accountsv1.AccountNumberResponse)
if !ok {
return 0, errors.New("unexpected response type")
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Improve error handling for type assertion.

The type assertion for accNum should use the comma-ok idiom to handle unexpected types gracefully. Consider providing more context in the error message.

resp, ok := accNum.(*accountsv1.AccountNumberResponse)
if !ok {
	return 0, fmt.Errorf("unexpected response type: %T", accNum)
}

@julienrbrt julienrbrt mentioned this pull request Aug 12, 2024
15 tasks
@@ -46,11 +46,16 @@ func (sud SetUpContextDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, _ bool,
newCtx = SetGasMeter(ctx, gasTx.GetGas())

// TODO: possibly cache the result of this query for other antehandlers to use
Copy link
Member

Choose a reason for hiding this comment

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

we should create an issue for this todo. i have a few ideas how we can do this

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.yml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between f227001 and 9e17ab6.

Files ignored due to path filters (2)
  • x/accounts/go.sum is excluded by !**/*.sum
  • x/group/go.sum is excluded by !**/*.sum
Files selected for processing (3)
  • x/accounts/defaults/lockup/go.mod (6 hunks)
  • x/accounts/go.mod (4 hunks)
  • x/group/go.mod (2 hunks)
Files skipped from review as they are similar to previous changes (3)
  • x/accounts/defaults/lockup/go.mod
  • x/accounts/go.mod
  • x/group/go.mod

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.yml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 9e17ab6 and e7ebe8e.

Files ignored due to path filters (2)
  • x/accounts/go.sum is excluded by !**/*.sum
  • x/group/go.sum is excluded by !**/*.sum
Files selected for processing (5)
  • x/accounts/defaults/lockup/go.mod (6 hunks)
  • x/accounts/go.mod (4 hunks)
  • x/authz/keeper/keeper.go (1 hunks)
  • x/gov/keeper/msg_server.go (1 hunks)
  • x/group/go.mod (2 hunks)
Files skipped from review as they are similar to previous changes (5)
  • x/accounts/defaults/lockup/go.mod
  • x/accounts/go.mod
  • x/authz/keeper/keeper.go
  • x/gov/keeper/msg_server.go
  • x/group/go.mod

@testinginprod testinginprod self-requested a review August 22, 2024 12:58
Copy link
Contributor

@testinginprod testinginprod left a comment

Choose a reason for hiding this comment

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

lgtm

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.yml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between e7ebe8e and 5c74310.

Files ignored due to path filters (2)
  • x/accounts/go.sum is excluded by !**/*.sum
  • x/group/go.sum is excluded by !**/*.sum
Files selected for processing (8)
  • server/v2/stf/core_router_service.go (3 hunks)
  • server/v2/stf/stf.go (2 hunks)
  • server/v2/stf/stf_router.go (2 hunks)
  • server/v2/stf/stf_router_test.go (2 hunks)
  • types/module/module.go (1 hunks)
  • x/accounts/defaults/lockup/go.mod (6 hunks)
  • x/accounts/go.mod (4 hunks)
  • x/group/go.mod (2 hunks)
Files skipped from review as they are similar to previous changes (5)
  • server/v2/stf/core_router_service.go
  • server/v2/stf/stf.go
  • types/module/module.go
  • x/accounts/go.mod
  • x/group/go.mod
Additional context used
Path-based instructions (2)
server/v2/stf/stf_router_test.go (2)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.


Pattern **/*_test.go: "Assess the unit test code assessing sufficient code coverage for the changes associated in the pull request"

server/v2/stf/stf_router.go (1)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

Additional comments not posted (3)
server/v2/stf/stf_router_test.go (1)

43-47: LGTM! The test updates align with the refactoring.

The changes to use router.Invoke instead of router.InvokeUntyped are appropriate given the refactoring. The test case name update is consistent with the new method name.

server/v2/stf/stf_router.go (1)

162-169: LGTM! The Invoke method refactoring enhances clarity.

The consolidation of invocation methods into Invoke simplifies the interface and improves clarity. The error handling for unknown message types is appropriate.

x/accounts/defaults/lockup/go.mod (1)

Line range hint 16-130: Verify the impact of dependency changes.

The addition and removal of dependencies suggest a reorganization of the module's reliance on certain libraries. Ensure that these changes do not negatively impact the module's functionality or compatibility.

Run the following script to verify the impact of dependency changes:

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.yml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between e7ebe8e and 5c74310.

Files ignored due to path filters (2)
  • x/accounts/go.sum is excluded by !**/*.sum
  • x/group/go.sum is excluded by !**/*.sum
Files selected for processing (8)
  • server/v2/stf/core_router_service.go (3 hunks)
  • server/v2/stf/stf.go (2 hunks)
  • server/v2/stf/stf_router.go (2 hunks)
  • server/v2/stf/stf_router_test.go (2 hunks)
  • types/module/module.go (1 hunks)
  • x/accounts/defaults/lockup/go.mod (6 hunks)
  • x/accounts/go.mod (4 hunks)
  • x/group/go.mod (2 hunks)
Files skipped from review as they are similar to previous changes (6)
  • server/v2/stf/core_router_service.go
  • server/v2/stf/stf.go
  • types/module/module.go
  • x/accounts/defaults/lockup/go.mod
  • x/accounts/go.mod
  • x/group/go.mod
Additional context used
Path-based instructions (2)
server/v2/stf/stf_router_test.go (2)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.


Pattern **/*_test.go: "Assess the unit test code assessing sufficient code coverage for the changes associated in the pull request"

server/v2/stf/stf_router.go (1)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

Additional comments not posted (2)
server/v2/stf/stf_router_test.go (1)

43-47: LGTM! The test case updates are consistent with the refactoring.

The renaming of the test case and the use of router.Invoke align with the changes to streamline invocation methods.

server/v2/stf/stf_router.go (1)

162-169: LGTM! The Invoke method refactoring simplifies the invocation process.

The method now directly uses the handler associated with the message type, aligning with the refactoring goals.

@github-actions github-actions bot added C:CLI C:Cosmovisor Issues and PR related to Cosmovisor C:schema labels Aug 23, 2024
@julienrbrt
Copy link
Member Author

As x/accounts was already depending on the bank module and the SDK, I reverted the proto v2 wrapper hack that we were doing.
Especially because we decided our current direction with proto v2 support.
Additionally, using InvokeUntyped with it was not working, so I had to (see previous CI runs)

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, codebase verification and nitpick comments (5)
x/accounts/coin_transfer.go (2)

5-6: Ensure imports are necessary and organized.

The import of banktypes is used in the function, but ensure all imports are necessary and organized according to the Uber Golang style guide.


14-14: Update the function signature comment.

The comment above the coinsTransferMsgFunc type definition should be updated to reflect the new function signature that returns a single transaction.Msg and an error.

 // coinsTransferMsgFunc defines a function that creates a message to send coins from one
-// address to the other, and also a message that parses such  response.
+// address to the other.
x/accounts/internal/implementation/encoding.go (2)

8-8: Ensure imports are necessary and organized.

The import of transaction is used throughout the file, but ensure all imports are necessary and organized according to the Uber Golang style guide.


17-17: Clarify the ProtoMsgG interface comment.

The comment for the ProtoMsgG interface should be updated to reflect the change to transaction.Msg.

 // ProtoMsgG is a generic interface for protobuf messages.
+// It now uses transaction.Msg for message handling.
x/accounts/internal/implementation/protoaccount.go (1)

7-7: Ensure imports are necessary and organized.

The import of transaction is used throughout the file, but ensure all imports are necessary and organized according to the Uber Golang style guide.

Review details

Configuration used: .coderabbit.yml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 5c74310 and df98b05.

Files selected for processing (22)
  • schema/appdata/batch_test.go (1 hunks)
  • schema/diff/diff_test.go (1 hunks)
  • tools/cosmovisor/cmd/cosmovisor/version_test.go (1 hunks)
  • x/accounts/account_test.go (4 hunks)
  • x/accounts/accountstd/exports.go (4 hunks)
  • x/accounts/coin_transfer.go (1 hunks)
  • x/accounts/defaults/base/account.go (1 hunks)
  • x/accounts/defaults/base/utils_test.go (3 hunks)
  • x/accounts/defaults/lockup/go.mod (6 hunks)
  • x/accounts/defaults/lockup/lockup.go (4 hunks)
  • x/accounts/defaults/lockup/utils_test.go (5 hunks)
  • x/accounts/defaults/multisig/account_test.go (4 hunks)
  • x/accounts/defaults/multisig/utils_test.go (2 hunks)
  • x/accounts/internal/implementation/api_builder.go (7 hunks)
  • x/accounts/internal/implementation/context.go (5 hunks)
  • x/accounts/internal/implementation/context_test.go (3 hunks)
  • x/accounts/internal/implementation/encoding.go (3 hunks)
  • x/accounts/internal/implementation/implementation.go (4 hunks)
  • x/accounts/internal/implementation/protoaccount.go (4 hunks)
  • x/accounts/keeper.go (14 hunks)
  • x/auth/keeper/msg_server_test.go (1 hunks)
  • x/authz/client/cli/tx.go (1 hunks)
Files skipped from review due to trivial changes (4)
  • schema/appdata/batch_test.go
  • schema/diff/diff_test.go
  • tools/cosmovisor/cmd/cosmovisor/version_test.go
  • x/authz/client/cli/tx.go
Files skipped from review as they are similar to previous changes (7)
  • x/accounts/account_test.go
  • x/accounts/defaults/base/account.go
  • x/accounts/defaults/base/utils_test.go
  • x/accounts/defaults/lockup/lockup.go
  • x/accounts/defaults/lockup/utils_test.go
  • x/accounts/defaults/multisig/account_test.go
  • x/accounts/internal/implementation/context_test.go
Additional context used
Path-based instructions (10)
x/accounts/coin_transfer.go (1)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

x/accounts/internal/implementation/encoding.go (1)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

x/accounts/internal/implementation/protoaccount.go (1)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

x/accounts/internal/implementation/api_builder.go (1)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

x/accounts/internal/implementation/context.go (1)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

x/auth/keeper/msg_server_test.go (2)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.


Pattern **/*_test.go: "Assess the unit test code assessing sufficient code coverage for the changes associated in the pull request"

x/accounts/accountstd/exports.go (1)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

x/accounts/internal/implementation/implementation.go (1)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

x/accounts/defaults/multisig/utils_test.go (2)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.


Pattern **/*_test.go: "Assess the unit test code assessing sufficient code coverage for the changes associated in the pull request"

x/accounts/keeper.go (1)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

Additional comments not posted (50)
x/accounts/coin_transfer.go (1)

17-30: LGTM! Verify the function usage in the codebase.

The changes to the defaultCoinsTransferMsgFunc function are approved. Ensure that all usages of this function are updated to handle the new return type.

Run the following script to verify the function usage:

Verification successful

Function Usage Verified

The usage of defaultCoinsTransferMsgFunc in the codebase has been verified, and it correctly handles the new return type. No further updates are necessary.

  • x/accounts/keeper.go: The function is used in a context that aligns with the new signature.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `defaultCoinsTransferMsgFunc` match the new signature.

# Test: Search for the function usage. Expect: Only occurrences of the new signature.
rg --type go -A 5 $'defaultCoinsTransferMsgFunc'

Length of output: 1229


Script:

#!/bin/bash
# Search for the definition and usage of the `makeSendCoinsMsg` function to verify how it handles the return value of `defaultCoinsTransferMsgFunc`.
rg --type go -A 10 'makeSendCoinsMsg'

Length of output: 2096

x/accounts/internal/implementation/encoding.go (6)

60-60: LGTM! Verify the function usage in the codebase.

The changes to the Merge function are approved. Ensure that all usages of this function are updated to handle the new parameter type.

Run the following script to verify the function usage:


64-64: LGTM! Verify the function usage in the codebase.

The changes to the Equal function are approved. Ensure that all usages of this function are updated to handle the new parameter type.

Run the following script to verify the function usage:


45-45: LGTM! Verify the function usage in the codebase.

The changes to the UnpackAnyTo function are approved. Ensure that all usages of this function are updated to handle the new parameter type.

Run the following script to verify the function usage:

Verification successful

Function Usage Verified: All usages of the UnpackAnyTo function match the new signature in the codebase. No further updates are needed.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `UnpackAnyTo` match the new signature.

# Test: Search for the function usage. Expect: Only occurrences of the new signature.
rg --type go -A 5 $'UnpackAnyTo'

Length of output: 1075


30-30: LGTM! Verify the function usage in the codebase.

The changes to the MessageName function are approved. Ensure that all usages of this function are updated to handle the new parameter type.

Run the following script to verify the function usage:

Verification successful

Verification Successful: Function Usage Updated

The MessageName function with the new parameter type transaction.Msg is correctly used in the codebase. The relevant usages are consistent with the updated function signature.

  • Relevant Usages:
    • x/accounts/internal/implementation/protoaccount.go
    • x/accounts/internal/implementation/implementation.go
    • x/accounts/internal/implementation/api_builder.go
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `MessageName` match the new signature.

# Test: Search for the function usage. Expect: Only occurrences of the new signature.
rg --type go -A 5 $'MessageName'

Length of output: 46589


35-35: LGTM! Verify the function usage in the codebase.

The changes to the PackAny function are approved. Ensure that all usages of this function are updated to handle the new parameter type.

Run the following script to verify the function usage:


22-27: LGTM! Verify the function usage in the codebase.

The changes to the FindMessageByName function are approved. Ensure that all usages of this function are updated to handle the new return type.

Run the following script to verify the function usage:

Verification successful

No usage of FindMessageByName found in the codebase.

The function FindMessageByName from x/accounts/internal/implementation/encoding.go is not directly called anywhere in the codebase. There are no concerns about updating its usage to handle the new return type.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `FindMessageByName` match the new signature.

# Test: Search for the function usage. Expect: Only occurrences of the new signature.
rg --type go -A 5 $'FindMessageByName'

Length of output: 3902


Script:

#!/bin/bash
# Search for calls to the specific `FindMessageByName` function from `encoding.go` to verify usage.
ast-grep --lang go --pattern 'FindMessageByName($_)' --json

Length of output: 64

x/accounts/internal/implementation/protoaccount.go (3)

18-18: LGTM! Verify the function usage in the codebase.

The changes to the RegisterInitHandler function are approved. Ensure that all usages of this function are updated to handle the new parameter types.

Run the following script to verify the function usage:

Verification successful

Function usage verified successfully.

All occurrences of the RegisterInitHandler function in the codebase match the new signature with two parameters. No further updates are needed.

  • Verified in files such as account_test.go, minimal.go, counter.go, and others.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `RegisterInitHandler` match the new signature.

# Test: Search for the function usage. Expect: Only occurrences of the new signature.
rg --type go -A 5 $'RegisterInitHandler'

Length of output: 10030


44-44: LGTM! Verify the function usage in the codebase.

The changes to the RegisterExecuteHandler function are approved. Ensure that all usages of this function are updated to handle the new parameter types.

Run the following script to verify the function usage:

Verification successful

Function Usage Verified Successfully

All instances of the RegisterExecuteHandler function have been updated to match the new signature with the parameter types involving generic types. The verification is complete, and no further action is required.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `RegisterExecuteHandler` match the new signature.

# Test: Search for the function usage. Expect: Only occurrences of the new signature.
rg --type go -A 5 $'RegisterExecuteHandler'

Length of output: 15273


73-73: LGTM! Verify the function usage in the codebase.

The changes to the New function in MessageSchema are approved. Ensure that all usages of this function are updated to handle the new return type.

Run the following script to verify the function usage:

Verification successful

No direct usage of MessageSchema.New found in the codebase.

The New function in MessageSchema is defined but not directly invoked elsewhere in the codebase, as per the search results. This suggests that no updates are necessary for its usage. If the function is intended to be used, please ensure it is integrated correctly where needed.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `New` in `MessageSchema` match the new signature.

# Test: Search for the function usage. Expect: Only occurrences of the new signature.
rg --type go -A 5 $'NewProtoMessageSchema'

Length of output: 1778


Script:

#!/bin/bash
# Description: Verify all function calls to `New` in `MessageSchema` to ensure they match the new signature.

# Search for the `New` function within `MessageSchema`.
ast-grep --lang go --pattern $'type MessageSchema struct {
  $$$
  New func() $_
  $$$
}'

# Search for all usages of `MessageSchema.New` in the codebase.
rg --type go 'MessageSchema.New'

Length of output: 692

x/accounts/internal/implementation/api_builder.go (5)

27-27: LGTM! Enhanced type specificity.

The change to use transaction.Msg improves type safety and clarity.


Line range hint 35-39: LGTM! Consistent handler signature update.

The makeHandler function now returns a handler using transaction.Msg, aligning with the updated handler function signature.


Line range hint 45-54: LGTM! Consistent map signature update.

The handlers map now uses transaction.Msg, ensuring consistency across the codebase.


Line range hint 64-79: LGTM! Consistent handler signature update.

The makeHandler function now returns a handler using transaction.Msg, aligning with the updated handlers map.


101-103: LGTM! Consistent handler signature update.

The makeHandler function now returns a handler using transaction.Msg, ensuring consistency with the ExecuteBuilder.

x/accounts/internal/implementation/context.go (5)

18-19: LGTM! Enhanced type specificity.

The change to use transaction.Msg in ModuleExecFunc and ModuleQueryFunc improves type safety and clarity.


25-31: LGTM! Simplified context value structure.

The removal of moduleExecUntyped and the focus on transaction.Msg simplifies the struct and aligns with the refactoring goals.


60-66: LGTM! Consistent context creation.

The MakeAccountContext function now uses ModuleExecFunc and ModuleQueryFunc with transaction.Msg, ensuring consistency with the updated context value structure.


85-92: LGTM! Simplified execution logic.

The ExecModule function now uses transaction.Msg, simplifying the execution logic and aligning with the refactoring goals.


99-105: LGTM! Simplified query logic.

The QueryModule function now uses transaction.Msg, simplifying the query logic and aligning with the refactoring goals.

x/auth/keeper/msg_server_test.go (1)

188-189: LGTM! Aligned with updated interface.

The method call update to SendModuleMessage aligns with the updated interface definitions and enhances type safety.

x/accounts/accountstd/exports.go (3)

94-95: Simplified function signature enhances readability.

The removal of generic type parameters in ExecModule simplifies the function signature, making it more readable and maintainable.


99-100: Consistent simplification of function signature.

The QueryModule function benefits from the same simplification as ExecModule, improving consistency and readability.


109-110: Enhanced type safety with transaction.Msg.

The use of transaction.Msg in PackAny aligns with the refactoring strategy, enhancing type safety.

x/accounts/internal/implementation/implementation.go (7)

111-112: Improved type safety in Init function.

The Init function now uses transaction.Msg, aligning with the refactoring strategy and enhancing type safety.


113-114: Consistent use of transaction.Msg in Execute function.

The Execute function now uses transaction.Msg, enhancing type safety and consistency with the refactoring strategy.


115-116: Enhanced type safety in Query function.

The Query function now uses transaction.Msg, aligning with the refactoring strategy and enhancing type safety.


127-129: Improved type safety in HasExec method.

The HasExec method now uses transaction.Msg, aligning with the refactoring strategy and enhancing type safety.


133-135: Consistent use of transaction.Msg in HasQuery method.

The HasQuery method now uses transaction.Msg, enhancing type safety and consistency with the refactoring strategy.


139-140: Improved type safety in HasInit method.

The HasInit method now uses transaction.Msg, aligning with the refactoring strategy and enhancing type safety.


149-150: Consistent use of transaction.Msg in New function.

The New function now returns transaction.Msg, enhancing type safety and consistency with the refactoring strategy.

x/accounts/defaults/multisig/utils_test.go (1)

167-179: Enhanced flexibility in newMockContext function.

The updated callback signatures in newMockContext enhance flexibility by returning a transaction.Msg alongside any potential error, aligning with the new pattern.

x/accounts/defaults/lockup/go.mod (11)

16-16: Verify the necessity of github.com/golang/groupcache.

Ensure that this dependency is required and does not introduce any unwanted side effects or conflicts.


22-22: Addition of cosmossdk.io/core/testing is appropriate.

This dependency supports enhanced testing capabilities.


23-23: Addition of cosmossdk.io/depinject is beneficial.

This dependency supports improved modularity and testability through dependency injection.


29-29: Verify the impact of removing cosmossdk.io/x/consensus.

Ensure that this removal does not affect any critical functionality or introduce breaking changes.


46-46: Verify the necessity and compatibility of github.com/cometbft/cometbft/api.

Ensure that this dependency is required and compatible with the existing codebase.


50-50: Addition of github.com/cosmos/crypto is appropriate.

This dependency supports enhanced cryptographic functionalities.


58-58: Verify the necessity and compatibility of github.com/dgraph-io/badger/v4.

Ensure that this dependency is required and compatible with the existing codebase.


74-74: Addition of github.com/google/flatbuffers is beneficial.

This dependency supports efficient serialization.


97-97: Verify the necessity and compatibility of github.com/munnerz/goautoneg.

Ensure that this dependency is required and compatible with the existing codebase.


121-121: Addition of github.com/supranational/blst is appropriate.

This dependency supports enhanced cryptographic functionalities, specifically BLS signatures.


130-130: Addition of go.opencensus.io is beneficial.

This dependency supports improved observability and metrics.

x/accounts/keeper.go (7)

141-143: Function Init updated to use transaction.Msg.

The changes align with the new transaction message structure.


162-162: Function initFromMsg updated to use transaction.Msg.

The changes align with the new transaction message structure.


186-188: Function init updated to use transaction.Msg.

The changes align with the new transaction message structure.


227-228: Function MigrateLegacyAccount updated to use transaction.Msg.

The changes align with the new transaction message structure.


237-239: Function Execute updated to use transaction.Msg.

The changes align with the new transaction message structure.


269-270: Function Query updated to use transaction.Msg.

The changes align with the new transaction message structure.


363-365: Function SendModuleMessage refactored to use transaction.Msg.

The changes align with the refactoring goals and maintain functionality.

@julienrbrt julienrbrt added the backport/v0.52.x PR scheduled for inclusion in the v0.52's next stable release label Aug 23, 2024
@julienrbrt julienrbrt added this pull request to the merge queue Aug 23, 2024
Merged via the queue into main with commit a554a21 Aug 23, 2024
83 of 85 checks passed
@julienrbrt julienrbrt deleted the julien/router-invoke branch August 23, 2024 21:42
mergify bot pushed a commit that referenced this pull request Aug 23, 2024
(cherry picked from commit a554a21)

# Conflicts:
#	core/router/service.go
#	schema/appdata/batch_test.go
#	schema/diff/diff_test.go
#	server/v2/stf/core_router_service.go
#	server/v2/stf/stf.go
#	server/v2/stf/stf_router.go
#	server/v2/stf/stf_router_test.go
#	tools/cosmovisor/cmd/cosmovisor/version_test.go
#	x/accounts/defaults/lockup/go.mod
#	x/accounts/go.mod
#	x/accounts/go.sum
#	x/group/go.sum
julienrbrt added a commit that referenced this pull request Aug 23, 2024
… (#21392)

Co-authored-by: Julien Robert <julien@rbrt.fr>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants