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: add VoteOnBallot function #2464

Merged
merged 12 commits into from
Jul 15, 2024
Merged

refactor: add VoteOnBallot function #2464

merged 12 commits into from
Jul 15, 2024

Conversation

fbac
Copy link
Contributor

@fbac fbac commented Jul 11, 2024

Description

How Has This Been Tested?

  • Tested CCTX in localnet
  • Tested in development environment
  • Go unit tests
  • Go integration tests
  • Tested via GitHub Actions

Summary by CodeRabbit

  • New Features

    • Introduced a new voting function to streamline the process and improve voting logic consistency.
  • Refactor

    • Refactored voting logic for both inbound and outbound ballots to enhance readability and maintainability.
    • Improved error handling by adopting standardized error wrapping.
  • Bug Fixes

    • Corrected issues related to ballot voting and finalization logic, ensuring more accurate ballot management.

Copy link
Contributor

coderabbitai bot commented Jul 11, 2024

Walkthrough

The changes refactor the voting process in the observer module by introducing a high-level function VoteOnBallot, which consolidates common logic for various ballot voting types (inbound, outbound, etc.). This streamlines code, improves error handling, and ensures consistent behavior across different vote types.

Changes

File(s) Change Summary
x/observer/keeper/vote_inbound.go Refactored VoteOnInboundBallot function, enhanced error handling, adjusted imports
x/observer/keeper/vote_outbound.go Refactored VoteOnOutboundBallot function, added imports, and updated logic
x/observer/keeper/voting.go Introduced VoteOnBallot function to manage the voting process

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Keeper
    participant Ballot
    participant VoteOnBallot

    User->>Keeper: VoteOnInboundBallot()
    Keeper->>VoteOnBallot: VoteOnBallot()
    VoteOnBallot->>Ballot: Check if ballot exists
    Ballot-->>VoteOnBallot: Ballot found or created
    VoteOnBallot->>Ballot: Cast vote
    Ballot-->>VoteOnBallot: Vote casted, check if finalized
    VoteOnBallot-->>Keeper: Return results (isFinalized, isNew, error)
    Keeper-->>User: Return results (isFinalized, isNew, error)
Loading

Assessment against linked issues

Objective Addressed Explanation
Implement a function like VoteOnBallot in the observer module (#1806)
Add unit test to this function (#1806) No unit tests for VoteOnBallot were found.
Change logic of the messages listed above to include this function (#1806)

Poem

Amidst the code where ballots hide,
A function stands, votes unified.
Errors wrapped in careful care,
Logic streamlined, nothing spare.
Votes inbound, outbound too,
Keeper's path now clear and true.
🎉 A rabbit's joy, the code anew! 🐇✨


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

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

CodeRabbit Configration File (.coderabbit.yaml)

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

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

codecov bot commented Jul 11, 2024

Codecov Report

Attention: Patch coverage is 93.85965% with 7 lines in your changes missing coverage. Please review.

Project coverage is 47.21%. Comparing base (a076710) to head (9ff66ae).

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #2464      +/-   ##
===========================================
+ Coverage    47.16%   47.21%   +0.05%     
===========================================
  Files          444      444              
  Lines        29346    29358      +12     
===========================================
+ Hits         13840    13861      +21     
+ Misses       14696    14691       -5     
+ Partials       810      806       -4     
Files Coverage Δ
x/crosschain/keeper/msg_server_vote_gas_price.go 100.00% <100.00%> (ø)
x/crosschain/keeper/msg_server_vote_inbound_tx.go 100.00% <100.00%> (ø)
x/observer/keeper/msg_server_vote_blame.go 100.00% <100.00%> (+8.00%) ⬆️
x/observer/keeper/msg_server_vote_block_header.go 100.00% <100.00%> (+7.40%) ⬆️
x/observer/keeper/msg_server_vote_tss.go 100.00% <100.00%> (ø)
x/observer/keeper/vote_inbound.go 94.44% <100.00%> (+5.87%) ⬆️
x/observer/keeper/vote_outbound.go 100.00% <100.00%> (+11.11%) ⬆️
x/observer/keeper/voting.go 93.40% <100.00%> (ø)
x/crosschain/keeper/msg_server_vote_outbound_tx.go 92.55% <84.21%> (-0.24%) ⬇️
x/observer/keeper/msg_server_update_observer.go 80.70% <60.00%> (+0.05%) ⬆️

@fbac fbac changed the title refactor: add FindBallotAndFinalize function refactor: add VoteOnBallot function Jul 12, 2024
@fbac fbac marked this pull request as ready for review July 12, 2024 14:13
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 (2)
x/observer/keeper/utils.go (2)

151-153: Enhance function documentation.

The comments for the VoteOnBallot function are clear but can be further detailed to explain the parameters and return values.

- // VoteOnBallot finds a ballot or creates a new one if not found,
- // and casts a vote on it. Then proceed to check if the vote has been finalized.
- // This function holds generic logic for all types of votes.
+ // VoteOnBallot finds a ballot or creates a new one if not found, 
+ // and casts a vote on it. Then proceeds to check if the vote has been finalized.
+ // This function holds generic logic for all types of votes.
+ //
+ // Parameters:
+ // - ctx: The context of the current state.
+ // - chain: The chain information.
+ // - ballotIndex: The identifier of the ballot.
+ // - observationType: The type of observation.
+ // - voter: The address of the voter.
+ // - voteType: The type of vote.
+ //
+ // Returns:
+ // - ballot: The updated ballot.
+ // - isFinalized: Whether the vote has finalized the ballot.
+ // - isNew: Whether the ballot was newly created.
+ // - err: Error encountered during the process, if any.

166-166: Ensure proper error handling for observer set retrieval.

The FindBallot function in ./x/observer/keeper/utils.go handles errors related to chain parameters but does not handle errors for observer set retrieval. Ensure that the GetObserverSet function's error is properly handled.

  • ./x/observer/keeper/utils.go:65: Add error handling for the GetObserverSet function.
Analysis chain

Ensure proper error handling.

Ensure that FindBallot handles all possible errors, especially related to chain parameters and observer set retrieval.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify error handling in FindBallot function.

# Test: Search for error handling in FindBallot. Expect: Proper handling for observer set and chain parameters.
rg --type go -A 5 'func (k Keeper) FindBallot'

Length of output: 48


Script:

#!/bin/bash
# Locate the FindBallot function and inspect its error handling.

# Search for the FindBallot function definition in the codebase.
ast-grep --lang go --pattern 'func (k $_) FindBallot($_, $_, $_, $_) ($_, $_, $_) {
  $$$
}'

Length of output: 2010

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between ce8afec and 33d0485.

Files selected for processing (6)
  • x/observer/keeper/msg_server_vote_blame.go (2 hunks)
  • x/observer/keeper/msg_server_vote_block_header.go (3 hunks)
  • x/observer/keeper/msg_server_vote_tss.go (1 hunks)
  • x/observer/keeper/utils.go (1 hunks)
  • x/observer/keeper/vote_inbound.go (3 hunks)
  • x/observer/keeper/vote_outbound.go (2 hunks)
Files skipped from review due to trivial changes (1)
  • x/observer/keeper/msg_server_vote_tss.go
Additional context used
Path-based instructions (5)
x/observer/keeper/msg_server_vote_blame.go (1)

Pattern **/*.go: Review the Go code, point out issues relative to principles of clean code, expressiveness, and performance.

x/observer/keeper/msg_server_vote_block_header.go (1)

Pattern **/*.go: Review the Go code, point out issues relative to principles of clean code, expressiveness, and performance.

x/observer/keeper/vote_outbound.go (1)

Pattern **/*.go: Review the Go code, point out issues relative to principles of clean code, expressiveness, and performance.

x/observer/keeper/vote_inbound.go (1)

Pattern **/*.go: Review the Go code, point out issues relative to principles of clean code, expressiveness, and performance.

x/observer/keeper/utils.go (1)

Pattern **/*.go: Review the Go code, point out issues relative to principles of clean code, expressiveness, and performance.

Additional comments not posted (13)
x/observer/keeper/msg_server_vote_blame.go (4)

7-7: Approved change: Updated import for error handling.

The import for cosmossdk.io/errors aligns with the objective to replace the deprecated package.


16-16: Approved change: Renamed parameter for clarity.

The parameter vote has been renamed to msg, which improves consistency and clarity.


33-42: Approved change: Integrated VoteOnBallot function.

The integration of the VoteOnBallot function consolidates common logic for various vote types, enhancing maintainability.


46-55: Approved change: Updated finalization logic.

The changes related to event emission and response handling for finalized ballots align with the new consolidated logic and enhance clarity.

x/observer/keeper/msg_server_vote_block_header.go (3)

6-6: Approved change: Updated import for error handling.

The import for cosmossdk.io/errors aligns with the objective to replace the deprecated package.


23-23: Approved change: Updated error handling logic.

The error handling logic has been updated to use sdkerrors.Wrap, improving consistency.


37-46: Approved change: Integrated VoteOnBallot function.

The integration of the VoteOnBallot function consolidates common logic for various vote types, enhancing maintainability.

x/observer/keeper/vote_outbound.go (2)

4-4: Approved change: Updated import for error handling.

The import for cosmossdk.io/errors aligns with the objective to replace the deprecated package.


40-49: Approved change: Integrated VoteOnBallot function.

The integration of the VoteOnBallot function consolidates common logic for various vote types, enhancing maintainability.

x/observer/keeper/vote_inbound.go (2)

6-6: Approved change: Updated import for error handling.

The import for cosmossdk.io/errors aligns with the objective to replace the deprecated package.


67-76: Approved change: Integrated VoteOnBallot function.

The integration of the VoteOnBallot function consolidates common logic for various vote types, enhancing maintainability.

x/observer/keeper/utils.go (2)

171-171: Confirm AddVoteToBallot implementation.

Verify that AddVoteToBallot correctly handles vote addition and logs the process as expected.


176-176: Validate CheckIfFinalizingVote logic.

Ensure that CheckIfFinalizingVote correctly determines if a ballot is finalized and updates it accordingly.

Francisco de Borja Aranda Castillejo added 5 commits July 12, 2024 18:13
Signed-off-by: Francisco de Borja Aranda Castillejo <[email protected]>
Signed-off-by: Francisco de Borja Aranda Castillejo <[email protected]>
Signed-off-by: Francisco de Borja Aranda Castillejo <[email protected]>
Signed-off-by: Francisco de Borja Aranda Castillejo <[email protected]>
Signed-off-by: Francisco de Borja Aranda Castillejo <[email protected]>
changelog.md Outdated Show resolved Hide resolved
changelog.md Show resolved Hide resolved
x/observer/keeper/msg_server_vote_tss.go Show resolved Hide resolved
x/observer/keeper/utils.go Show resolved Hide resolved
Signed-off-by: Francisco de Borja Aranda Castillejo <[email protected]>
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.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 33d0485 and 9b98839.

Files selected for processing (7)
  • changelog.md (2 hunks)
  • x/observer/keeper/msg_server_vote_blame.go (2 hunks)
  • x/observer/keeper/msg_server_vote_block_header.go (3 hunks)
  • x/observer/keeper/msg_server_vote_tss.go (1 hunks)
  • x/observer/keeper/vote_inbound.go (3 hunks)
  • x/observer/keeper/vote_outbound.go (2 hunks)
  • x/observer/keeper/voting.go (1 hunks)
Files skipped from review due to trivial changes (1)
  • x/observer/keeper/msg_server_vote_tss.go
Files skipped from review as they are similar to previous changes (2)
  • x/observer/keeper/msg_server_vote_block_header.go
  • x/observer/keeper/vote_outbound.go
Additional context used
Path-based instructions (3)
x/observer/keeper/msg_server_vote_blame.go (1)

Pattern **/*.go: Review the Go code, point out issues relative to principles of clean code, expressiveness, and performance.

x/observer/keeper/vote_inbound.go (1)

Pattern **/*.go: Review the Go code, point out issues relative to principles of clean code, expressiveness, and performance.

x/observer/keeper/voting.go (1)

Pattern **/*.go: Review the Go code, point out issues relative to principles of clean code, expressiveness, and performance.

Additional comments not posted (21)
x/observer/keeper/msg_server_vote_blame.go (9)

7-7: Update imports to follow standard conventions.

Importing sdkerrors from cosmossdk.io/errors aligns with the latest package conventions. Ensure all references to error handling are updated accordingly.


16-16: Ensure consistency in parameter naming.

Renaming vote to msg improves clarity. Ensure this naming convention is consistent across the codebase.


21-25: Improve error message clarity.

The updated error message provides a better context for unsupported chains, enhancing debugging.


29-29: Check observer status before voting.

The function IsNonTombstonedObserver checks if the observer is authorized. This is a crucial validation step before proceeding with the vote.


33-40: Centralize voting logic with VoteOnBallot.

Introducing VoteOnBallot centralizes the voting logic, reducing redundancy. Ensure that all necessary parameters are correctly passed.


42-42: Update error handling for voting.

Using sdkerrors.Wrap provides more context in error messages, improving the debugging process.


46-46: Emit events for new ballots.

Emitting events when a new ballot is created helps in tracking and logging significant actions in the system.


50-50: Handle non-finalized ballots appropriately.

Returning a response when the ballot is not finalized ensures that the state is correctly committed.


54-55: Finalize ballots and set blame information.

Setting the blame information when the ballot is finalized ensures that the necessary state changes are made.

x/observer/keeper/vote_inbound.go (5)

6-6: Update imports to follow standard conventions.

Importing sdkerrors from cosmossdk.io/errors aligns with the latest package conventions. Ensure all references to error handling are updated accordingly.


24-24: Update function return values.

Updating the return values to (isFinalized bool, isNew bool, err error) ensures consistency with other voting functions.


67-74: Centralize voting logic with VoteOnBallot.

Introducing VoteOnBallot centralizes the voting logic, reducing redundancy. Ensure that all necessary parameters are correctly passed.


76-76: Update error handling for voting.

Using sdkerrors.Wrap provides more context in error messages, improving the debugging process.


78-78: Emit events for new ballots.

Emitting events when a new ballot is created helps in tracking and logging significant actions in the system.

x/observer/keeper/voting.go (6)

150-154: Document the new function with clear comments.

The comments provide a clear explanation of the purpose and functionality of the VoteOnBallot function, enhancing readability.


155-165: Ensure correct ballot retrieval or creation.

The function FindBallot retrieves an existing ballot or creates a new one if not found. Ensure that the parameters passed are correct and the logic handles both scenarios appropriately.


167-169: Handle errors during ballot retrieval or creation.

Returning errors encountered during ballot retrieval or creation ensures that issues are caught early and handled appropriately.


171-174: Add votes to the ballot and handle errors.

The function AddVoteToBallot adds votes to the ballot and handles any errors. Ensure that the parameters passed are correct and the logic handles error scenarios appropriately.


176-177: Check if the vote finalizes the ballot.

The function CheckIfFinalizingVote checks if the vote finalizes the ballot. Ensure that this check is performed correctly and the ballot status is updated accordingly.


178-179: Return the final ballot status and errors.

Returning the final ballot status and any errors ensures that the function provides comprehensive feedback on the voting process.

changelog.md (1)

61-61: Ensure the changelog entry is clear and accurate.

The entry for VoteOnBallot under the "Refactor" section accurately reflects the changes made. Ensure that the entry provides clear information for users.

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

Commits

Files that changed from the base of the PR and between 9b98839 and 732f11f.

Files selected for processing (7)
  • x/observer/keeper/msg_server_update_observer.go (5 hunks)
  • x/observer/keeper/msg_server_vote_blame.go (2 hunks)
  • x/observer/keeper/msg_server_vote_block_header.go (3 hunks)
  • x/observer/keeper/msg_server_vote_tss.go (3 hunks)
  • x/observer/keeper/vote_inbound.go (5 hunks)
  • x/observer/keeper/vote_outbound.go (2 hunks)
  • x/observer/keeper/voting.go (2 hunks)
Files skipped from review due to trivial changes (1)
  • x/observer/keeper/msg_server_vote_tss.go
Files skipped from review as they are similar to previous changes (4)
  • x/observer/keeper/msg_server_vote_block_header.go
  • x/observer/keeper/vote_inbound.go
  • x/observer/keeper/vote_outbound.go
  • x/observer/keeper/voting.go
Additional context used
Path-based instructions (2)
x/observer/keeper/msg_server_vote_blame.go (1)

Pattern **/*.go: Review the Go code, point out issues relative to principles of clean code, expressiveness, and performance.

x/observer/keeper/msg_server_update_observer.go (1)

Pattern **/*.go: Review the Go code, point out issues relative to principles of clean code, expressiveness, and performance.

Additional comments not posted (12)
x/observer/keeper/msg_server_vote_blame.go (6)

6-6: Approved: Import change for error handling.

The import statement for sdkerrors replaces the deprecated cosmoserrors package, aligning with the objective of using the new error handling package.


15-15: Approved: Parameter name change.

The parameter name change from vote to msg improves code readability and consistency with other functions.


22-24: Approved: Error handling improvement.

The error handling has been updated to use sdkerrors.Wrapf for unsupported chain errors, improving error message clarity and consistency.


40-40: Approved: Error handling improvement.

The error handling has been updated to use sdkerrors.Wrap for general errors, improving error message clarity and consistency.


44-53: Verify the integration of unchanged logic.

The event emission and finalization logic remains unchanged but is now part of the new centralized voting logic. Ensure it correctly integrates with the new VoteOnBallot function.

Verification successful

Verify the integration of unchanged logic.

The VoteOnBallot function correctly integrates the unchanged event emission and finalization logic. Here are the relevant locations confirming the integration:

  • x/observer/keeper/msg_server_vote_blame.go (lines 44-53)
  • x/observer/keeper/voting.go (implementation of VoteOnBallot)
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the integration of unchanged logic with the new `VoteOnBallot` function.

# Test: Search for the function usage and context. Expect: Correct integration of unchanged logic.
rg --type go -A 10 $'VoteOnBallot'

Length of output: 6071


31-38: Approved: Centralized voting logic.

The function call to VoteOnBallot replaces the previous FindBallot function call, centralizing the voting logic for improved maintainability and consistency.

However, verify the new function usage to ensure it is correctly integrated across the codebase.

Verification successful

Approved: Centralized voting logic.

The function call to VoteOnBallot replaces the previous FindBallot function call, centralizing the voting logic for improved maintainability and consistency. The old function FindBallot is now encapsulated within VoteOnBallot, ensuring the new function is correctly integrated across the codebase.

  • No occurrences of FindBallot function outside of encapsulated usage within VoteOnBallot.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the integration of the new `VoteOnBallot` function.

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

Length of output: 4017


Script:

#!/bin/bash
# Description: Verify the replacement of previous voting-related functions by `VoteOnBallot`.

# Test: Search for the usage of `FindBallot` function. Expect: No occurrences or deprecated usage.
rg --type go -A 5 $'FindBallot'

# Test: Search for the usage of `CastVote` function. Expect: No occurrences or deprecated usage.
rg --type go -A 5 $'CastVote'

# Test: Search for the usage of `FinalizeVote` function. Expect: No occurrences or deprecated usage.
rg --type go -A 5 $'FinalizeVote'

Length of output: 3911


Script:

#!/bin/bash
# Description: Verify if `FindBallot` function is used in the main codebase.

# Test: Search for the usage of `FindBallot` function excluding test and mock files. Expect: No occurrences in main codebase.
rg --type go -A 5 $'FindBallot' --glob '!*test.go' --glob '!*mock*'

Length of output: 1361

x/observer/keeper/msg_server_update_observer.go (6)

27-29: Approved: Error handling improvement.

The error handling has been updated to use errorsmod.Wrapf for unsupported update reasons, improving error message clarity and consistency.


34-36: Approved: Error handling improvement.

The error handling has been updated to use errorsmod.Wrapf for unauthorized observer addresses, improving error message clarity and consistency.


53-55: Approved: Error handling improvement.

The error handling has been updated to use errorsmod.Wrapf for node account not found errors, improving error message clarity and consistency.


67-67: Approved: Error handling improvement.

The error handling has been updated to use errorsmod.Wrap for observer set not found errors, improving error message clarity and consistency.


72-72: Approved: Error handling improvement.

The error handling has been updated to use errorsmod.Wrap for observer count not found errors, improving error message clarity and consistency.


75-75: Approved: Error handling improvement.

The error handling has been updated to use errorsmod.Wrap for observer count mismatch errors, improving error message clarity and consistency.

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 (1)
changelog.md (1)

63-63: Add PR link to the changelog.

As per the existing comment, please add the link to this PR in the changelog for better traceability.

- 
+ [2464](https://github.com/zeta-chain/node/pull/2464)
Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 732f11f and f62a1d5.

Files selected for processing (1)
  • changelog.md (2 hunks)
Additional comments not posted (1)
changelog.md (1)

62-62: Confirm addition of new entry for PR #2464.

The new entry for PR #2464 looks correct. Ensure that the formatting is consistent with the rest of the document.

Signed-off-by: Francisco de Borja Aranda Castillejo <[email protected]>
Signed-off-by: Francisco de Borja Aranda Castillejo <[email protected]>
@fbac fbac requested review from kingpinXD and lumtis July 12, 2024 19:43
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.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between f62a1d5 and 1a12af3.

Files selected for processing (9)
  • changelog.md (6 hunks)
  • x/observer/keeper/msg_server_update_observer.go (5 hunks)
  • x/observer/keeper/msg_server_vote_blame.go (2 hunks)
  • x/observer/keeper/msg_server_vote_block_header.go (3 hunks)
  • x/observer/keeper/msg_server_vote_tss.go (3 hunks)
  • x/observer/keeper/vote_inbound.go (5 hunks)
  • x/observer/keeper/vote_outbound.go (2 hunks)
  • x/observer/keeper/voting.go (2 hunks)
  • x/observer/keeper/voting_test.go (1 hunks)
Files skipped from review as they are similar to previous changes (7)
  • changelog.md
  • x/observer/keeper/msg_server_vote_blame.go
  • x/observer/keeper/msg_server_vote_block_header.go
  • x/observer/keeper/msg_server_vote_tss.go
  • x/observer/keeper/vote_inbound.go
  • x/observer/keeper/vote_outbound.go
  • x/observer/keeper/voting.go
Additional context used
Path-based instructions (2)
x/observer/keeper/msg_server_update_observer.go (1)

Pattern **/*.go: Review the Go code, point out issues relative to principles of clean code, expressiveness, and performance.

x/observer/keeper/voting_test.go (1)

Pattern **/*.go: Review the Go code, point out issues relative to principles of clean code, expressiveness, and performance.

Additional comments not posted (10)
x/observer/keeper/msg_server_update_observer.go (4)

27-29: Approved: Improved error message formatting.

The use of errorsmod.Wrapf improves error message clarity.


34-36: Approved: Improved error message formatting.

The use of errorsmod.Wrapf improves error message clarity.


53-55: Approved: Improved error message formatting.

The use of errorsmod.Wrapf improves error message clarity.


67-67: Approved: Improved error message formatting.

The use of errorsmod.Wrap improves error message clarity.

x/observer/keeper/voting_test.go (6)

324-347: Approved: New test for unsupported chain.

The test correctly verifies that VoteOnBallot fails when the chain is not supported.


349-371: Approved: New test for user vote addition failure.

The test correctly verifies that VoteOnBallot fails when the user cannot add a vote.


373-405: Approved: New test for ballot creation and vote addition.

The test correctly verifies that a user can create a ballot and successfully add a vote.


407-446: Approved: New test for non-finalized ballot.

The test correctly verifies that a user can create a ballot and add a vote without finalizing the ballot.


448-499: Approved: New test for adding a vote to an existing ballot.

The test correctly verifies that a user can add a vote to an existing ballot.


501-552: Approved: New test for adding a vote to an existing ballot and finalizing it.

The test correctly verifies that a user can add a vote to an existing ballot and finalize it.

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

Commits

Files that changed from the base of the PR and between 1a12af3 and 22a0e4b.

Files selected for processing (1)
  • changelog.md (6 hunks)
Files skipped from review as they are similar to previous changes (1)
  • changelog.md

Copy link
Contributor

@kingpinXD kingpinXD left a comment

Choose a reason for hiding this comment

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

lgtm , left a minor suggestion

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

Commits

Files that changed from the base of the PR and between 22a0e4b and 18e7acf.

Files selected for processing (1)
  • x/observer/keeper/voting_test.go (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • x/observer/keeper/voting_test.go

Signed-off-by: Francisco de Borja Aranda Castillejo <[email protected]>
@fbac fbac added the refactor label Jul 13, 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.

Actionable comments posted: 0

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 18e7acf and 6e9e2cf.

Files selected for processing (1)
  • x/observer/keeper/voting_test.go (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • x/observer/keeper/voting_test.go

Copy link
Member

@lumtis lumtis left a comment

Choose a reason for hiding this comment

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

Seeing an error in E2E test, rerunning it to confirm if this is related to this change

x/observer/keeper/voting.go Outdated Show resolved Hide resolved
x/observer/keeper/msg_server_vote_blame.go Outdated Show resolved Hide resolved
Copy link
Member

@lumtis lumtis left a comment

Choose a reason for hiding this comment

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

Looks good after CI passing. If you can check my previous comments then it would be good to go.

Signed-off-by: Francisco de Borja Aranda Castillejo <[email protected]>
@fbac fbac requested a review from lumtis July 15, 2024 10:56
@lumtis lumtis added UPGRADE_LIGHT_TESTS Run make start-upgrade-test-light ADMIN_TESTS Run make start-admin-tests labels Jul 15, 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.

Actionable comments posted: 0

Outside diff range, codebase verification and nitpick comments (8)
x/observer/keeper/msg_server_vote_blame.go (2)

24-26: Use sdkerrors.Wrap for error consistency.

Consider using sdkerrors.Wrap instead of sdkerrors.Wrapf for consistency in error handling.

- return nil, sdkerrors.Wrapf(
+ return nil, sdkerrors.Wrap(

43-45: Use sdkerrors.Wrap for error consistency.

Consider using sdkerrors.Wrap instead of sdkerrors.Wrapf for consistency in error handling.

- return nil, sdkerrors.Wrapf(
+ return nil, sdkerrors.Wrap(
x/crosschain/keeper/msg_server_vote_gas_price.go (1)

30-30: Use cosmoserrors.Wrap for error consistency.

Consider using cosmoserrors.Wrap instead of cosmoserrors.Wrapf for consistency in error handling.

- return nil, cosmoserrors.Wrapf(types.ErrUnsupportedChain, "ChainID: %d ", msg.ChainId)
+ return nil, cosmoserrors.Wrap(types.ErrUnsupportedChain, fmt.Sprintf("ChainID: %d", msg.ChainId))
x/crosschain/keeper/msg_server_vote_inbound_tx.go (2)

77-77: Use sdkerrors.Wrap for error consistency.

Consider using sdkerrors.Wrap instead of sdkerrors.Wrapf for consistency in error handling.

- return nil, sdkerrors.Wrap(err, voteInboundID)
+ return nil, sdkerrors.Wrapf(err, "%s", voteInboundID)

85-91: Use sdkerrors.Wrap for error consistency.

Consider using sdkerrors.Wrap instead of sdkerrors.Wrapf for consistency in error handling.

- return nil, sdkerrors.Wrapf(
+ return nil, sdkerrors.Wrap(
x/observer/keeper/voting.go (2)

173-173: Use sdkerrors.Wrap for error consistency.

Consider using sdkerrors.Wrap instead of sdkerrors.Wrapf for consistency in error handling.

- return ballot, false, false, sdkerrors.Wrap(err, msgVoteOnBallot)
+ return ballot, false, false, sdkerrors.Wrapf(err, "%s", msgVoteOnBallot)

178-178: Use sdkerrors.Wrap for error consistency.

Consider using sdkerrors.Wrap instead of sdkerrors.Wrapf for consistency in error handling.

- return ballot, false, isNew, sdkerrors.Wrap(err, msgVoteOnBallot)
+ return ballot, false, isNew, sdkerrors.Wrapf(err, "%s", msgVoteOnBallot)
x/crosschain/keeper/msg_server_vote_outbound_tx.go (1)

83-87: Ensure event emission is tested.

It appears that there are no unit tests covering the event emission for EmitEventBallotCreated. Please add unit tests to ensure that this event emission is properly tested.

  • x/crosschain/keeper/msg_server_vote_outbound_tx.go
Analysis chain

Ensure event emission is tested.

Ensure that the event emission for a new ballot is covered by unit tests.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify test coverage for event emission in `VoteOutbound`.

# Test: Search for test cases that cover event emission for a new ballot.
rg --type go -A 5 'EmitEventBallotCreated'

Length of output: 2290


Script:

#!/bin/bash
# Description: Verify test coverage for event emission in `VoteOutbound`.

# Test: Search for test files that cover event emission for a new ballot.
rg --type go -l 'EmitEventBallotCreated' | xargs -I {} rg --type go -l 'testing' {}

Length of output: 85


Script:

#!/bin/bash
# Description: Verify test coverage for event emission in `VoteOutbound`.

# Test: Search for test functions that might be covering event emission for a new ballot.
rg --type go -l 'EmitEventBallotCreated' | xargs -I {} rg --type go -A 5 'func Test' {}

Length of output: 91


Script:

#!/bin/bash
# Description: Verify test coverage for event emission in `VoteOutbound`.

# Test: Search for assertions or checks related to event emissions in the test files.
rg --type go -l 'EmitEventBallotCreated' | xargs -I {} rg --type go -e 'require' -e 'assert' -e 'check' {}

Length of output: 520

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 6e9e2cf and 9ff66ae.

Files selected for processing (9)
  • x/crosschain/keeper/msg_server_vote_gas_price.go (2 hunks)
  • x/crosschain/keeper/msg_server_vote_inbound_tx.go (3 hunks)
  • x/crosschain/keeper/msg_server_vote_outbound_tx.go (6 hunks)
  • x/observer/keeper/msg_server_vote_blame.go (1 hunks)
  • x/observer/keeper/msg_server_vote_block_header.go (2 hunks)
  • x/observer/keeper/msg_server_vote_tss.go (6 hunks)
  • x/observer/keeper/vote_inbound.go (5 hunks)
  • x/observer/keeper/vote_outbound.go (2 hunks)
  • x/observer/keeper/voting.go (2 hunks)
Files skipped from review as they are similar to previous changes (4)
  • x/observer/keeper/msg_server_vote_block_header.go
  • x/observer/keeper/msg_server_vote_tss.go
  • x/observer/keeper/vote_inbound.go
  • x/observer/keeper/vote_outbound.go
Additional context used
Path-based instructions (5)
x/observer/keeper/msg_server_vote_blame.go (1)

Pattern **/*.go: Review the Go code, point out issues relative to principles of clean code, expressiveness, and performance.

x/crosschain/keeper/msg_server_vote_gas_price.go (1)

Pattern **/*.go: Review the Go code, point out issues relative to principles of clean code, expressiveness, and performance.

x/crosschain/keeper/msg_server_vote_inbound_tx.go (1)

Pattern **/*.go: Review the Go code, point out issues relative to principles of clean code, expressiveness, and performance.

x/observer/keeper/voting.go (1)

Pattern **/*.go: Review the Go code, point out issues relative to principles of clean code, expressiveness, and performance.

x/crosschain/keeper/msg_server_vote_outbound_tx.go (1)

Pattern **/*.go: Review the Go code, point out issues relative to principles of clean code, expressiveness, and performance.

GitHub Check: codecov/patch
x/crosschain/keeper/msg_server_vote_outbound_tx.go

[warning] 80-80: x/crosschain/keeper/msg_server_vote_outbound_tx.go#L80
Added line #L80 was not covered by tests


[warning] 96-96: x/crosschain/keeper/msg_server_vote_outbound_tx.go#L96
Added line #L96 was not covered by tests


[warning] 120-120: x/crosschain/keeper/msg_server_vote_outbound_tx.go#L120
Added line #L120 was not covered by tests

Additional comments not posted (10)
x/crosschain/keeper/msg_server_vote_outbound_tx.go (10)

66-69: Ensure comprehensive test coverage for error handling.

The error handling for ValidateOutboundMessage is improved using cosmoserrors.Wrap. Ensure that this path is covered by unit tests.

Verification successful

Ensure comprehensive test coverage for error handling.

The error handling for ValidateOutboundMessage is well-covered by multiple test cases in msg_server_vote_outbound_tx_test.go. These tests validate both successful and error conditions, ensuring robust coverage.

  • x/crosschain/keeper/msg_server_vote_outbound_tx_test.go
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify test coverage for error handling in `VoteOutbound`.

# Test: Search for test cases that cover `ValidateOutboundMessage` error handling.
rg --type go -A 5 'ValidateOutboundMessage'

Length of output: 4624


216-219: Ensure comprehensive test coverage for CCTX validation.

Ensure that the logic for validating the CCTX and handling errors is covered by unit tests.

Verification successful

Ensure comprehensive test coverage for CCTX validation.

The ValidateOutboundMessage function is comprehensively covered by unit tests in msg_server_vote_outbound_tx_test.go. The tests include scenarios for successful validation and various failure conditions.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify test coverage for CCTX validation in `ValidateOutboundMessage`.

# Test: Search for test cases that cover CCTX validation logic.
rg --type go -A 5 'ValidateOutboundMessage'

Length of output: 4624


147-152: Ensure comprehensive test coverage for gas stability pool funding.

Ensure that the logic for funding the gas stability pool and handling errors is covered by unit tests.

Verification successful

Ensure comprehensive test coverage for gas stability pool funding.

The logic for funding the gas stability pool and handling errors is well-covered by unit tests in both x/fungible/keeper/gas_stability_pool_test.go and x/crosschain/keeper/msg_server_vote_outbound_tx_test.go.

  • x/fungible/keeper/gas_stability_pool_test.go: Tests for FundGasStabilityPool.
  • x/crosschain/keeper/msg_server_vote_outbound_tx_test.go: Tests for FundGasStabilityPoolFromRemainingFees.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify test coverage for gas stability pool funding in `FundGasStabilityPoolFromRemainingFees`.

# Test: Search for test cases that cover gas stability pool funding logic.
rg --type go -A 5 'FundGasStabilityPool'

Length of output: 7261


117-120: Ensure comprehensive test coverage for stability pool funding.

Ensure that the logic for funding the stability pool and logging errors is covered by unit tests.

Verification successful

Ensure comprehensive test coverage for stability pool funding.

The logic for funding the stability pool and logging errors is covered by unit tests in msg_server_vote_outbound_tx_test.go.

  • msg_server_vote_outbound_tx_test.go: Test cases for FundGasStabilityPoolFromRemainingFees.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify test coverage for stability pool funding in `FundStabilityPool`.

# Test: Search for test cases that cover stability pool funding logic.
rg --type go -A 5 'FundGasStabilityPoolFromRemainingFees'

Length of output: 2888

Tools
GitHub Check: codecov/patch

[warning] 120-120: x/crosschain/keeper/msg_server_vote_outbound_tx.go#L120
Added line #L120 was not covered by tests


204-210: Ensure comprehensive test coverage for outbound saving and logging.

Ensure that the logic for saving outbound transactions and logging is covered by unit tests.

Verification successful

Ensure comprehensive test coverage for outbound saving and logging.

The SaveOutbound function is covered by unit tests, as evidenced by its presence in x/crosschain/keeper/msg_server_vote_outbound_tx_test.go and related mock functions in testutil/keeper/crosschain.go.

  • x/crosschain/keeper/msg_server_vote_outbound_tx_test.go
  • testutil/keeper/crosschain.go
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify test coverage for outbound saving and logging in `SaveOutbound`.

# Test: Search for test cases that cover outbound saving and logging logic.
rg --type go -A 5 'SaveOutbound'

Length of output: 6572


99-107: Ensure comprehensive test coverage for stability pool funding and observer validation.

Ensure that the logic for funding the stability pool and validating outbound observers is covered by unit tests.

Verification successful

Comprehensive test coverage for stability pool funding and observer validation is confirmed.

The logic for funding the stability pool and validating outbound observers is covered by unit tests in the following files:

  • x/crosschain/keeper/msg_server_vote_outbound_tx_test.go
  • x/crosschain/keeper/cctx_orchestrator_validate_outbound_test.go
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify test coverage for stability pool funding and observer validation in `VoteOutbound`.

# Test: Search for test cases that cover stability pool funding and observer validation logic.
rg --type go -A 5 'FundStabilityPool'
rg --type go -A 5 'ValidateOutboundObservers'

Length of output: 20637


234-237: Ensure comprehensive test coverage for failed outbound transactions.

Ensure that the logic for saving failed outbound transactions and logging errors is covered by unit tests.

Verification successful

Ensure comprehensive test coverage for failed outbound transactions.

The SaveFailedOutbound function is covered by unit tests, as evidenced by the TestKeeper_SaveFailedOutbound function in the msg_server_vote_outbound_tx_test.go file. This test verifies the correct handling of failed outbound transactions.

  • File: x/crosschain/keeper/msg_server_vote_outbound_tx_test.go
  • Test Function: TestKeeper_SaveFailedOutbound
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify test coverage for failed outbound transactions in `SaveFailedOutbound`.

# Test: Search for test cases that cover failed outbound transaction logic.
rg --type go -A 5 'SaveFailedOutbound'

Length of output: 3395


93-96: Ensure comprehensive test coverage for outbound processing.

Ensure that the logic for processing a successful outbound vote is covered by unit tests.

Verification successful

Ensure comprehensive test coverage for outbound processing.

The AddOutbound function is well-covered by unit tests, as evidenced by multiple test cases in x/crosschain/types/cctx_test.go. These tests cover various scenarios, ensuring comprehensive test coverage for outbound processing.

  • x/crosschain/types/cctx_test.go
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify test coverage for outbound processing in `VoteOutbound`.

# Test: Search for test cases that cover outbound processing logic.
rg --type go -A 5 'AddOutbound'

Length of output: 85772

Tools
GitHub Check: codecov/patch

[warning] 96-96: x/crosschain/keeper/msg_server_vote_outbound_tx.go#L96
Added line #L96 was not covered by tests


88-93: Ensure state commit logic is tested.

Ensure that the logic for committing state when the vote is not finalized is covered by unit tests.

Verification successful

Let's correct the search pattern by escaping the curly braces and rerun the script to verify the test coverage for the state commit logic.


Let's search for test files in the x/crosschain/keeper directory to verify if they cover the state commit logic for the VoteOutbound function.


Let's inspect the msg_server_vote_outbound_tx_test.go file to verify if it contains test cases that handle the scenario where the vote is not finalized and ensure that the state commit logic is tested.


The test cases in the msg_server_vote_outbound_tx_test.go file do cover various scenarios for the VoteOutbound function. However, to ensure that the state commit logic is specifically tested when the vote is not finalized, the following points should be verified:

  • Assertions that check the state of the CrossChainTx object.
  • Assertions that verify the presence or absence of ballots.

The test cases do include such assertions, indicating that the state commit logic when the vote is not finalized is indeed tested.

Ensure state commit logic is tested.

The state commit logic when the vote is not finalized is covered by the following test cases in the msg_server_vote_outbound_tx_test.go file:

  • TestKeeper_VoteOutbound
  • TestKeeper_SaveFailedOutbound

These test cases include assertions that verify the state of the CrossChainTx object and the presence of ballots, ensuring that the state commit logic is tested.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify test coverage for state commit logic in `VoteOutbound`.

# Test: Search for test cases that cover state commit logic when the vote is not finalized.
rg --type go -A 5 'return &types.MsgVoteOutboundResponse{}, nil'

Length of output: 231


Script:

#!/bin/bash
# Description: Verify test coverage for state commit logic in `VoteOutbound`.

# Test: Search for test cases that cover state commit logic when the vote is not finalized.
rg --type go -A 5 'return &types.MsgVoteOutboundResponse\{\}, nil'

Length of output: 1537


Script:

#!/bin/bash
# Description: Verify test coverage for state commit logic in `VoteOutbound`.

# Find all test files in the `x/crosschain/keeper` directory.
fd --type f --extension go --glob '*_test.go' x/crosschain/keeper

# Search for test cases that might be testing the `VoteOutbound` function.
rg 'VoteOutbound' x/crosschain/keeper/*_test.go

Length of output: 5668


Script:

#!/bin/bash
# Description: Verify test coverage for state commit logic in `VoteOutbound`.

# Search for test cases in the `msg_server_vote_outbound_tx_test.go` file that handle the scenario where the vote is not finalized.
rg 'VoteOutbound' -A 10 x/crosschain/keeper/msg_server_vote_outbound_tx_test.go

Length of output: 7352


71-80: Verify the integration with VoteOnBallot.

Ensure that the function call to VoteOnBallot is correct and that all parameters are appropriately passed.

Verification successful

Verify the integration with VoteOnBallot.

The function VoteOnOutboundBallot is correctly defined and used in the codebase. The parameters passed to VoteOnOutboundBallot in msg_server_vote_outbound_tx.go are appropriately mapped and consistent with the function definition.

  • ctx is passed as sdk.Context.
  • ballotIndex is passed as string.
  • msg.OutboundChain is passed as int64.
  • msg.Status is passed as chains.ReceiveStatus.
  • msg.Creator is passed as string.

The integration with VoteOnBallot appears to be correct.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the integration with `VoteOnBallot`.

# Test: Search for the `VoteOnBallot` function definition and its usage.
ast-grep --lang go --pattern $'func (k Keeper) VoteOnBallot(ctx sdk.Context, chain chains.Chain, ballotIndex string, observationType types.ObservationType, voter string, voteType types.VoteType) (ballot types.Ballot, isFinalized bool, isNew bool, err error)'

Length of output: 1807


Script:

#!/bin/bash
# Description: Verify the integration with `VoteOnOutboundBallot`.

# Test: Search for the `VoteOnOutboundBallot` function definition and its usage.
ast-grep --lang go --pattern $'func (k Keeper) VoteOnOutboundBallot(ctx sdk.Context, ballotIndex string, outboundChain chains.Chain, status types.Status, creator string) (isFinalizingVote bool, isNew bool, ballot types.Ballot, observationChain chains.Chain, err error)' --context 10

Length of output: 283


Script:

#!/bin/bash
# Description: Verify the integration with `VoteOnOutboundBallot`.

# Test: Search for the `VoteOnOutboundBallot` function definition in the codebase.
rg 'func (k Keeper) VoteOnOutboundBallot' -A 10

Length of output: 49


Script:

#!/bin/bash
# Description: Verify the integration with `VoteOnOutboundBallot`.

# Test: Search for the `VoteOnOutboundBallot` function definition in the codebase.
rg 'VoteOnOutboundBallot' -A 10

Length of output: 17668

Tools
GitHub Check: codecov/patch

[warning] 80-80: x/crosschain/keeper/msg_server_vote_outbound_tx.go#L80
Added line #L80 was not covered by tests

@lumtis lumtis added this pull request to the merge queue Jul 15, 2024
Merged via the queue into develop with commit 0d79cfb Jul 15, 2024
39 of 42 checks passed
@lumtis lumtis deleted the refactor-vote branch July 15, 2024 11:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ADMIN_TESTS Run make start-admin-tests refactor UPGRADE_LIGHT_TESTS Run make start-upgrade-test-light
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create a high level VoteOnBallot function
3 participants