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

feat(x/group): Add env bundler to group module #19489

Merged
merged 6 commits into from
Feb 20, 2024
Merged

Conversation

likhita-809
Copy link
Contributor

@likhita-809 likhita-809 commented Feb 20, 2024

Description

ref: #19290

Migrate x/group module to use environment bundler


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

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
    • Introduced an EndBlocker function that updates proposal tallies and prunes expired proposals.
    • Enhanced functionality to access different application services via appmodule.Environment.
  • Refactor
    • Updated initialization of various components to use a new runtime.Environment.
    • Modified method parameters to use context.Context for consistency.
    • Adjusted access to KVStoreService through the new environment parameter.
  • Tests
    • Updated test cases for consistency and to accommodate new changes in the environment and method parameters.
  • Documentation
    • Updated CHANGELOG to reflect new functionalities and changes.

Copy link
Contributor

coderabbitai bot commented Feb 20, 2024

Walkthrough

Walkthrough

The overarching change integrates a new runtime.Environment structure across various components of the application, particularly within the x/group module. This update facilitates access to application services, including logging and key-value store services, directly through the Environment rather than previous, more fragmented methods. It also standardizes context usage across gRPC queries and message servers, improves the handling of proposals through an EndBlocker function, and streamlines keeper initialization and testing.

Changes

File(s) Summary
simapp/app.go Updated NewSimApp to initialize GroupKeeper with runtime.NewEnvironment.
x/group/CHANGELOG.md, x/group/keeper/genesis.go, x/group/keeper/genesis_test.go, x/group/keeper/grpc_query.go, x/group/keeper/grpc_query_test.go, x/group/keeper/invariants.go, x/group/keeper/keeper.go, x/group/keeper/keeper_test.go, x/group/keeper/migrations.go, x/group/keeper/msg_server.go, x/group/keeper/msg_server_test.go, x/group/keeper/tally.go, x/group/module/depinject.go Enhanced various components to utilize runtime.Environment for accessing application services and standardized context usage.
x/group/keeper/abci.go, x/group/module/module.go Introduced EndBlocker function for proposal updates and pruning, and directly called EndBlocker in AppModule.
x/group/keeper/abci_test.go Renamed package, improved consistency in tests, and utilized EndBlocker directly on groupKeeper.
x/group/keeper/proposal_executor.go Comment added regarding future use of context.Context and env bundler service.

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-tests for this file.
  • 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 tests 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 from git and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit tests.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

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 a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json

CodeRabbit Discord Community

Join our Discord Community to get help, request features, and share feedback.

@@ -451,7 +450,7 @@
return errorsmod.Wrap(err, "doTallyAndUpdate")
}

if err := k.proposalTable.Update(k.storeService.OpenKVStore(ctx), proposal.Id, &proposal); err != nil {
if err := k.proposalTable.Update(k.environment.KVStoreService.OpenKVStore(ctx), proposal.Id, &proposal); err != nil {

Check failure

Code scanning / gosec

Implicit memory aliasing in for loop.

Implicit memory aliasing in for loop.
@@ -349,7 +348,7 @@

//nolint:gosec // "implicit memory aliasing in the for loop (because of the pointer on &v)"
for _, v := range votes {
err = k.voteTable.Delete(k.storeService.OpenKVStore(ctx), &v)
err = k.voteTable.Delete(k.environment.KVStoreService.OpenKVStore(ctx), &v)

Check failure

Code scanning / gosec

Implicit memory aliasing in for loop.

Implicit memory aliasing in for loop.
@@ -308,7 +307,7 @@
if proposalInfo.Status == group.PROPOSAL_STATUS_SUBMITTED {
proposalInfo.Status = group.PROPOSAL_STATUS_ABORTED

if err := k.proposalTable.Update(k.storeService.OpenKVStore(ctx), proposalInfo.Id, &proposalInfo); err != nil {
if err := k.proposalTable.Update(k.environment.KVStoreService.OpenKVStore(ctx), proposalInfo.Id, &proposalInfo); err != nil {

Check failure

Code scanning / gosec

Implicit memory aliasing in for loop.

Implicit memory aliasing in for loop.
@likhita-809 likhita-809 marked this pull request as ready for review February 20, 2024 08:44
@likhita-809 likhita-809 requested a review from a team as a code owner February 20, 2024 08:44
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.

Review Status

Actionable comments generated: 2

Configuration used: .coderabbit.yml

Commits Files that changed from the base of the PR and between c058502 and d7a067d.
Files selected for processing (18)
  • simapp/app.go (1 hunks)
  • x/group/CHANGELOG.md (1 hunks)
  • x/group/keeper/abci.go (1 hunks)
  • x/group/keeper/abci_test.go (23 hunks)
  • x/group/keeper/genesis.go (2 hunks)
  • x/group/keeper/genesis_test.go (2 hunks)
  • x/group/keeper/grpc_query.go (14 hunks)
  • x/group/keeper/grpc_query_test.go (1 hunks)
  • x/group/keeper/invariants.go (1 hunks)
  • x/group/keeper/keeper.go (13 hunks)
  • x/group/keeper/keeper_test.go (9 hunks)
  • x/group/keeper/migrations.go (1 hunks)
  • x/group/keeper/msg_server.go (44 hunks)
  • x/group/keeper/msg_server_test.go (2 hunks)
  • x/group/keeper/proposal_executor.go (1 hunks)
  • x/group/keeper/tally.go (2 hunks)
  • x/group/module/depinject.go (3 hunks)
  • x/group/module/module.go (1 hunks)
Additional comments: 73
x/group/keeper/abci.go (1)
  • 7-15: The implementation of the EndBlocker function correctly integrates the new environment bundler setup and follows best practices for error handling and context usage. Good job on ensuring that the function is concise and maintainable.
x/group/keeper/migrations.go (1)
  • 23-23: The update to use m.keeper.environment.KVStoreService in the Migrate1to2 function aligns with the migration to an environment bundler, ensuring that the migration utilizes the new setup correctly.
x/group/CHANGELOG.md (1)
  • 35-35: The changelog entry is well-documented, clearly stating the new feature related to the integration of appmodule.Environment with the Keeper. It follows the established changelog format and principles.
x/group/module/depinject.go (1)
  • 32-32: The updates in depinject.go, specifically the replacement of StoreService with Environment in the ProvideModule function, correctly align with the migration to an environment bundler. This ensures proper interaction with external dependencies through the new setup.

Also applies to: 48-48

x/group/keeper/tally.go (1)
  • 16-16: The updates in the Tally function, specifically the replacement of sdk.Context with context.Context and the use of k.environment.KVStoreService for kvStore initialization, correctly reflect the migration to an environment bundler and the new context management approach.

Also applies to: 26-26

x/group/keeper/genesis.go (1)
  • 20-20: The updates in the InitGenesis and ExportGenesis functions to use k.environment.KVStoreService align with the migration to an environment bundler, ensuring that the genesis processes utilize the new setup correctly.

Also applies to: 55-55

x/group/keeper/proposal_executor.go (1)
  • 19-19: The addition of the comment regarding the future use of context.Context and env bundler service is clear and provides valuable insight into future development plans. It's a good practice to document such intentions for future reference.
x/group/keeper/invariants.go (1)
  • 29-29: The update in the GroupTotalWeightInvariant function to use keeper.environment.KVStoreService aligns with the migration to an environment bundler, ensuring that the invariant check utilizes the new setup correctly.
x/group/module/module.go (1)
  • 151-151: The simplification of the EndBlock method to directly call keeper.EndBlocker is a positive change, enhancing the clarity and maintainability of the code.
x/group/keeper/genesis_test.go (2)
  • 56-56: The introduction of the runtime.NewEnvironment call to create an env variable is aligned with the PR's objective to integrate the appmodule.Environment into the Keeper structure. This change enhances the module's interaction with different application services by providing streamlined access.
  • 77-77: The modification to include the env parameter in the keeper.NewKeeper function call is correctly implemented. This change is crucial for utilizing the new environment bundler, enabling more efficient access to application services within the x/group module.
x/group/keeper/grpc_query_test.go (1)
  • 72-74: The update to initialize the groupKeeper with a new runtime.Environment instance is correctly implemented and aligns with the PR's objective to enhance the module's architecture by integrating the appmodule.Environment. This change facilitates improved access to application services.
x/group/keeper/grpc_query.go (25)
  • 22-22: The change from sdk.Context to context.Context in the GroupInfo function aligns with the PR's objective to utilize the environment bundler. Ensure that all downstream calls within this function and related functions are compatible with context.Context.
  • 33-35: The getGroupInfo function correctly uses context.Context. It's important to verify that k.environment.KVStoreService.OpenKVStore(ctx) properly handles the standard Go context.Context and that any context cancellation or deadlines are respected.
  • 40-40: The GroupPolicyInfo function's switch to context.Context is consistent with the overall migration strategy. Similar to other functions, ensure compatibility and proper handling of the context throughout the call chain.
  • 55-57: In getGroupPolicyInfo, the use of context.Context and interaction with k.environment.KVStoreService.OpenKVStore(ctx) should be checked for correct context handling, especially regarding cancellation and deadlines.
  • 61-61: The GroupMembers function's adaptation to context.Context is part of the module's migration to use an environment bundler. Ensure that the context is correctly propagated through all underlying calls.
  • 81-82: For getGroupMembers, it's crucial to confirm that k.environment.KVStoreService.OpenKVStore(ctx) respects the context.Context passed, especially for long-running operations that might be subject to cancellation.
  • 86-86: The GroupsByAdmin function's update to use context.Context is in line with the migration goals. Ensure that all related operations properly handle the context, including any potential error handling or cancellation scenarios.
  • 109-110: In getGroupsByAdmin, verify that the context passed to k.environment.KVStoreService.OpenKVStore(ctx) is correctly utilized, particularly in terms of handling cancellations or timeouts.
  • 114-114: The GroupPoliciesByGroup function's switch to context.Context is consistent with the migration to an environment bundler. Ensure that the context is properly propagated and handled in all underlying calls.
  • 134-135: For getGroupPoliciesByGroup, it's important to ensure that k.environment.KVStoreService.OpenKVStore(ctx) correctly handles the context.Context, especially for operations that might be affected by context cancellation or deadlines.
  • 140-140: The GroupPoliciesByAdmin function's adaptation to context.Context aligns with the module's migration strategy. As with other functions, ensure that the context is correctly handled throughout the call chain.
  • 163-164: In getGroupPoliciesByAdmin, confirm that k.environment.KVStoreService.OpenKVStore(ctx) properly utilizes the context.Context, particularly in terms of respecting cancellations and deadlines.
  • 168-168: The Proposal function's update to use context.Context is part of the broader migration to an environment bundler. Ensure that all related operations and downstream calls correctly handle the context.
  • 179-179: The ProposalsByGroupPolicy function's switch to context.Context is consistent with the module's migration goals. Verify that the context is properly propagated and handled in all underlying operations.
  • 202-203: For getProposalsByGroupPolicy, it's crucial to ensure that k.environment.KVStoreService.OpenKVStore(ctx) respects the context.Context passed, especially for operations that might be subject to cancellation.
  • 207-209: The getProposal function correctly uses context.Context. Verify that k.environment.KVStoreService.OpenKVStore(ctx) properly handles the standard Go context.Context, including any context cancellation or deadlines.
  • 216-216: The VoteByProposalVoter function's adaptation to context.Context aligns with the module's migration strategy. Ensure that the context is correctly handled throughout the call chain, especially in error handling or cancellation scenarios.
  • 232-232: The VotesByProposal function's update to use context.Context is part of the broader migration to an environment bundler. Verify that all related operations and downstream calls correctly handle the context.
  • 252-252: The VotesByVoter function's switch to context.Context is consistent with the module's migration goals. Ensure that the context is properly propagated and handled in all underlying operations.
  • 275-275: The GroupsByMember function's adaptation to context.Context aligns with the module's migration strategy. As with other functions, ensure that the context is correctly handled throughout the call chain.
  • 312-314: In getVote, confirm that k.environment.KVStoreService.OpenKVStore(ctx) properly utilizes the context.Context, particularly in terms of respecting cancellations and deadlines.
  • 318-319: For getVotesByProposal, it's important to ensure that k.environment.KVStoreService.OpenKVStore(ctx) correctly handles the context.Context, especially for operations that might be affected by context cancellation or deadlines.
  • 323-324: In getVotesByVoter, verify that the context passed to k.environment.KVStoreService.OpenKVStore(ctx) is correctly utilized, particularly in terms of handling cancellations or timeouts.
  • 328-328: The TallyResult function's update to use context.Context is part of the broader migration to an environment bundler. Ensure that all related operations and downstream calls correctly handle the context, including any potential error handling or cancellation scenarios.
  • 356-356: The Groups function's switch to context.Context is consistent with the module's migration goals. Verify that the context is properly propagated and handled in all underlying operations, especially in terms of respecting cancellations and deadlines.
x/group/keeper/keeper_test.go (9)
  • 12-12: The addition of the "cosmossdk.io/core/appmodule" import is necessary for utilizing the appmodule.Environment type within the test suite. This change aligns with the PR's objective to integrate the environment bundler into the x/group module.
  • 49-49: Adding the environment field of type appmodule.Environment to the TestSuite struct is a crucial step in enabling the test suite to utilize the new environment bundler. This change is consistent with the PR's goal of enhancing the module's interaction with application services.
  • 61-62: Initializing the env variable with runtime.NewEnvironment(storeService, log.NewNopLogger()) and subsequently assigning it to s.environment is a correct implementation for setting up the environment bundler within the test suite. This setup is essential for the subsequent use of the environment in keeper and other module functions.
  • 83-83: The modification to the keeper.NewKeeper call to include the env parameter is in line with the changes made to the keeper's constructor to accept an appmodule.Environment parameter. This adjustment ensures that the keeper instance within the test suite is correctly initialized with the environment bundler.
  • 87-88: Assigning the initialized env to s.environment correctly stores the environment instance for use in subsequent tests. This assignment is necessary for tests that require access to the environment bundler.
  • 280-280: The modification to the EndBlocker call to include the spec.newCtx parameter is consistent with the updated function signature. However, it's important to note that the EndBlocker function does not require the environment parameter directly in its arguments. The context provided should already be enriched with necessary environmental data, ensuring that the function operates within the correct context.
  • 342-342: The modification to the PruneProposals call to include the s.environment parameter is necessary following the changes to the function signature. This ensures that the function has access to the environment bundler, allowing it to perform its operations with the correct context and access to application services.
  • 465-465: The call to TallyProposalsAtVPEnd with the ctx and s.environment parameters correctly reflects the updated function signature. This change is part of the broader effort to integrate the environment bundler into the module's operations, ensuring that the tallying process has access to the necessary application services.
  • 532-532: Similar to the previous comment, the call to TallyProposalsAtVPEnd in the context of testing group member leaving scenarios is correctly updated to include the environment parameter. This ensures that the function operates with the correct context and access to application services, even in more complex test scenarios.
x/group/keeper/abci_test.go (4)
  • 1-1: Renaming the package from module_test to keeper_test aligns with Go conventions for naming test packages. This change improves clarity by explicitly indicating that these tests are for the keeper package within the x/group module.
  • 166-166: The replacement of submitProposalAndVote with submitProposalAndVoteHelper across multiple test cases ensures consistency in how proposals are submitted and voted on within these tests. This change likely reflects an effort to standardize test utilities and improve the readability and maintainability of the test code.

Also applies to: 181-181, 196-196, 211-211, 225-225, 245-245, 257-257, 272-272, 288-288, 310-310

  • 336-336: Directly calling the EndBlocker function on s.groupKeeper in the test cases for proposal pruning and tallying, instead of through the module package, is a significant change. This approach is more direct and likely reflects the architectural changes introduced by the PR, where the x/group module's interaction with application services is streamlined through the appmodule.Environment. It's important to ensure that this direct invocation accurately simulates the conditions under which EndBlocker would be called in a live environment.

Also applies to: 539-539

  • 558-558: The introduction of submitProposalHelper and submitProposalAndVoteHelper functions at the end of the file is a good practice, as it abstracts the proposal submission and voting logic into reusable components. This not only DRYs up the test code but also makes it easier to understand and maintain. However, it's crucial to ensure that these helper functions accurately represent the proposal submission and voting process as it would occur in the actual application.

Also applies to: 576-576

simapp/app.go (1)
  • 368-368: The initialization of app.GroupKeeper has been updated to include a runtime.NewEnvironment call, passing logger as an argument. This change aligns with the PR's objective to integrate the appmodule.Environment into the Keeper structure for the x/group module, facilitating enhanced access to application services. The modification appears to be correctly implemented, adhering to the described objectives and best practices for maintainability and modularity.

However, it's important to ensure that all downstream usages of app.GroupKeeper and related components are updated to accommodate this change, especially if they rely on the previous initialization pattern. Additionally, thorough testing should be conducted to verify that the integration of the environment bundler does not introduce any unintended side effects or regressions in the module's functionality.

x/group/keeper/msg_server.go (22)
  • 29-29: The function CreateGroup now correctly uses context.Context as its context parameter, aligning with the migration to the new environment bundler. This change is consistent and correctly implemented.
  • 64-64: The use of k.environment.KVStoreService.OpenKVStore(ctx) to obtain the KV store is a significant change that aligns with the new environment bundler approach. This ensures that the Keeper can interact with the KV store in a context-aware manner, improving modularity and maintainability.
  • 71-71: The retrieval of the current block time using k.environment.HeaderService.GetHeaderInfo(ctx).Time is a good practice, ensuring that the timestamp used in CreateGroup and other operations is consistent and accurate.
  • 94-94: The use of k.environment.EventService.EventManager(ctx).Emit for emitting events is correctly implemented, leveraging the new environment bundler. This change enhances the modularity and flexibility of event management within the module.
  • 101-101: The migration of UpdateGroupMembers to use context.Context and the new environment bundler is correctly implemented. This change is consistent across the module and improves the maintainability and modularity of the code.
  • 114-114: The logic for updating group members, including handling member weight updates and deletions, is well-structured and maintains the integrity of group weights. The use of the new environment bundler for accessing the KV store and other services is correctly applied.
  • 192-192: The addition of the member's AddedAt timestamp using k.environment.HeaderService.GetHeaderInfo(ctx).Time during member creation is a good practice, ensuring consistency in the handling of timestamps across the module.
  • 221-221: The UpdateGroupAdmin function's migration to use context.Context and the new environment bundler is correctly implemented, aligning with the module's overall migration strategy. This enhances the maintainability and modularity of the code.
  • 253-253: The changes in UpdateGroupMetadata to use context.Context and leverage the new environment bundler are correctly implemented. This consistency in the migration approach across the module is commendable.
  • 328-328: The CreateGroupPolicy function's adaptation to use context.Context and the new environment bundler, especially for decision policy validation and group policy account creation, is well-executed. This change enhances the module's architecture and maintainability.
  • 370-370: The loop for handling potential address collisions during group policy account creation is a prudent measure. It ensures the uniqueness of the account address, which is crucial for the integrity of group policies.
  • 421-421: The use of k.environment.EventService.EventManager(ctx).Emit for emitting the EventCreateGroupPolicy event is correctly implemented, leveraging the new environment bundler for event management.
  • 428-428: The migration of UpdateGroupPolicyAdmin to use context.Context and the new environment bundler is correctly implemented. This change is consistent with the module's overall migration strategy and improves the code's maintainability.
  • 451-451: The UpdateGroupPolicyDecisionPolicy function's adaptation to use context.Context and the new environment bundler, especially for decision policy validation and update, is well-executed. This enhances the module's architecture and maintainability.
  • 489-489: The changes in UpdateGroupPolicyMetadata to use context.Context and leverage the new environment bundler are correctly implemented. This consistency in the migration approach across the module is commendable.
  • 511-511: The SubmitProposal function's comprehensive update to use context.Context and the new environment bundler, especially for proposal validation and submission, is well-executed. This change significantly enhances the module's functionality and maintainability.
  • 563-563: The logic for ensuring that only group members can submit proposals and for executing proposal messages is well-structured and correctly leverages the new environment bundler. This maintains the integrity and functionality of the proposal submission process.
  • 621-621: The use of k.environment.EventService.EventManager(ctx).Emit for emitting the EventSubmitProposal event is correctly implemented, leveraging the new environment bundler for event management. This enhances the modularity and flexibility of event handling within the module.
  • 655-655: The migration of WithdrawProposal to use context.Context and the new environment bundler is correctly implemented. This change is consistent with the module's overall migration strategy and improves the code's maintainability.
  • 697-697: The Vote function's adaptation to use context.Context and the new environment bundler, especially for vote validation and storage, is well-executed. This enhances the module's architecture and maintainability.
  • 781-781: The doTallyAndUpdate function's logic for performing a tally and updating the proposal status based on the tally result is well-structured and correctly leverages the new environment bundler. This maintains the integrity of the voting and proposal finalization process.
  • 914-914: The LeaveGroup function's comprehensive update to use context.Context and the new environment bundler, especially for group member removal and group weight update, is well-executed. This change significantly enhances the module's functionality and maintainability.

Comment on lines +2030 to +2035
key := storetypes.NewKVStoreKey(group.StoreKey)
env := runtime.NewEnvironment(runtime.NewKVStoreService(key), log.NewNopLogger())
vpe := resp.Proposal.VotingPeriodEnd
timeDiff := vpe.Sub(s.sdkCtx.HeaderInfo().Time)
ctxVPE := sdkCtx.WithHeaderInfo(header.Info{Time: s.sdkCtx.HeaderInfo().Time.Add(timeDiff).Add(time.Second * 1)})
s.Require().NoError(s.groupKeeper.TallyProposalsAtVPEnd(ctxVPE))
s.Require().NoError(s.groupKeeper.TallyProposalsAtVPEnd(ctxVPE, env))
Copy link
Contributor

Choose a reason for hiding this comment

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

The use of runtime.NewEnvironment and runtime.NewKVStoreService within a test case seems unusual and might not reflect a typical usage pattern in Cosmos SDK modules. It's important to ensure that this setup accurately represents the intended environment and store interactions for the functionality being tested. If this pattern is specific to the test environment and does not mirror the actual application's runtime environment, consider adding a comment to clarify its purpose and usage in this context.

// Ensure the use of runtime.NewEnvironment and runtime.NewKVStoreService accurately represents the intended environment for the functionality being tested.

x/group/keeper/msg_server_test.go Show resolved Hide resolved
@julienrbrt julienrbrt added this pull request to the merge queue Feb 20, 2024
@likhita-809 likhita-809 removed this pull request from the merge queue due to a manual request Feb 20, 2024
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.

Review Status

Actionable comments generated: 0

Configuration used: .coderabbit.yml

Commits Files that changed from the base of the PR and between d7a067d and 4f03829.
Files selected for processing (1)
  • x/group/CHANGELOG.md (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • x/group/CHANGELOG.md

@likhita-809 likhita-809 added this pull request to the merge queue Feb 20, 2024
Merged via the queue into main with commit b050ec2 Feb 20, 2024
56 of 61 checks passed
@likhita-809 likhita-809 deleted the likhita/groups-env branch February 20, 2024 10:28
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.

3 participants