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

chore: remove go-tss imports from observer/types #2799

Merged
merged 1 commit into from
Sep 2, 2024

Conversation

gartnera
Copy link
Member

@gartnera gartnera commented Aug 30, 2024

Part of #2798. Should resolve this issue:

go: zetacored-rpc imports
	github.com/zeta-chain/node/pkg/rpc imports
	github.com/zeta-chain/node/x/observer/types imports
	gitlab.com/thorchain/tss/go-tss/blame imports
	gitlab.com/thorchain/tss/go-tss/conversion imports
	gitlab.com/thorchain/tss/tss-lib/crypto imports
	github.com/decred/dcrd/dcrec/edwards/v2 imports
	github.com/agl/ed25519: module github.com/agl/ed25519@latest found (v0.0.0-20200225211852-fd4d107ace12), but does not contain package github.com/agl/ed25519

Summary by CodeRabbit

  • New Features

    • Introduced a utility function for converting blame nodes, enhancing data processing within the observer module.
  • Bug Fixes

    • Updated the method for converting blame nodes in the voting process, improving reliability and consistency.
  • Refactor

    • Reorganized code structure by moving utility functions to a dedicated package, improving maintainability and clarity.
  • Tests

    • Adjusted test cases to reflect changes in the utility function's package, ensuring accurate testing of the new structure.

Copy link
Contributor

coderabbitai bot commented Aug 30, 2024

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

Walkthrough

The changes involve refactoring the node conversion logic within the codebase. The ConvertNodes function has been moved from the types package to the utils package, affecting multiple files that utilize this function. This adjustment includes updates in the CmdVoteBlame function and the associated tests, ensuring that the new utility function is correctly referenced and utilized throughout the affected components.

Changes

File Path Change Summary
x/observer/client/cli/tx_vote_blame.go Modified CmdVoteBlame to use utils.ConvertNodes(nodes) instead of types.ConvertNodes(nodes).
x/observer/utils/utils.go Introduced ConvertNodes function that converts blame.Node to types.Node.
x/observer/utils/utils_test.go Changed package declaration from types_test to utils and updated function call to ConvertNodes.
zetaclient/zetacore/client_vote.go Updated PostVoteBlameData to use observerutils.ConvertNodes(blame.BlameNodes) instead of observertypes.ConvertNodes(blame.BlameNodes).

Sequence Diagram(s)

sequenceDiagram
    participant CLI as Command Line Interface
    participant Observer as Observer Module
    participant Utils as Utils Package
    participant Client as Client Module

    CLI->>Observer: CmdVoteBlame()
    Observer->>Utils: ConvertNodes(nodes)
    Utils-->>Observer: Converted Nodes
    Observer-->>CLI: Result

    Client->>Observer: PostVoteBlameData()
    Observer->>Utils: ConvertNodes(blame.BlameNodes)
    Utils-->>Observer: Converted Blame Nodes
    Observer-->>Client: Result
Loading

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

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

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.

@gartnera gartnera force-pushed the remove-go-tss-observer-imports branch from 78fca03 to 8dc8c41 Compare August 30, 2024 00:55
Copy link

codecov bot commented Aug 30, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 66.60%. Comparing base (b516a46) to head (f36588a).
Report is 1 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #2799      +/-   ##
===========================================
- Coverage    66.62%   66.60%   -0.02%     
===========================================
  Files          370      369       -1     
  Lines        20735    20727       -8     
===========================================
- Hits         13814    13806       -8     
  Misses        6283     6283              
  Partials       638      638              
Files with missing lines Coverage Δ
zetaclient/zetacore/client_vote.go 57.54% <100.00%> (ø)

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

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 91c323d and 8dc8c41.

Files selected for processing (4)
  • x/observer/client/cli/tx_vote_blame.go (2 hunks)
  • x/observer/utils/utils.go (1 hunks)
  • x/observer/utils/utils_test.go (2 hunks)
  • zetaclient/zetacore/client_vote.go (2 hunks)
Files skipped from review due to trivial changes (1)
  • x/observer/utils/utils_test.go
Additional context used
Path-based instructions (3)
x/observer/utils/utils.go (1)

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

x/observer/client/cli/tx_vote_blame.go (1)

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

zetaclient/zetacore/client_vote.go (1)

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

x/observer/utils/utils.go Outdated Show resolved Hide resolved
x/observer/client/cli/tx_vote_blame.go Outdated Show resolved Hide resolved
zetaclient/zetacore/client_vote.go Outdated Show resolved Hide resolved
x/observer/utils/utils.go Outdated Show resolved Hide resolved
@gartnera gartnera force-pushed the remove-go-tss-observer-imports branch from 8dc8c41 to 1ea3416 Compare August 30, 2024 15:51
@gartnera gartnera requested review from lumtis and kingpinXD August 30, 2024 15:52
@gartnera gartnera force-pushed the remove-go-tss-observer-imports branch 2 times, most recently from ac5787b to d26230f Compare August 30, 2024 16:35
@gartnera gartnera enabled auto-merge August 30, 2024 16:36
@gartnera gartnera force-pushed the remove-go-tss-observer-imports branch from d26230f to f36588a Compare August 30, 2024 16:55
@gartnera gartnera added this pull request to the merge queue Sep 2, 2024
Merged via the queue into develop with commit f617c89 Sep 2, 2024
30 checks passed
@gartnera gartnera deleted the remove-go-tss-observer-imports branch September 2, 2024 16:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking:cli no-changelog Skip changelog CI check
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants