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

add fetch genesis command #88

Merged
merged 3 commits into from
Feb 28, 2025
Merged

add fetch genesis command #88

merged 3 commits into from
Feb 28, 2025

Conversation

sh-cha
Copy link
Contributor

@sh-cha sh-cha commented Feb 25, 2025

Summary by CodeRabbit

  • New Features

    • Expanded the command-line interface with a new command to fetch the genesis state.
  • Chores

    • Updated dependency management for the cometbft library to a newer version.
    • Added new import statements for improved organization and readability in various files.

@sh-cha sh-cha self-assigned this Feb 25, 2025
@sh-cha sh-cha requested a review from a team as a code owner February 25, 2025 09:08
Copy link

coderabbitai bot commented Feb 25, 2025

Walkthrough

This update adds a new command to the root command structure in the application. It introduces the import of the cmtcmd package in cmd/minitiad/root.go and appends cmtcmd.FetchGenesisCmd to the command set, enabling genesis state fetching. Additionally, the go.mod file is modified to replace the remote dependency for github.com/cometbft/cometbft with a new version. Various import statements across several files have been reorganized for clarity or consistency, but no alterations to functionality have been made.

Changes

File Change Summary
cmd/minitiad/root.go Added import for cmtcmd and appended cmtcmd.FetchGenesisCmd to the root command configuration.
go.mod Updated the replace directive for github.com/cometbft/cometbft to a new version; no change for github.com/cosmos/ibc-go/v8.
app/ante/ante.go Removed and re-added import statements for ibcante and ibckeeper, altering only the formatting.
app/app.go Reorganized import statements for the proto package from gogoproto.
app/app_test.go Reorganized import statements for capability and capability/types modules from ibc-go.
app/encoding.go Added an empty line before the import of github.com/cosmos/cosmos-sdk/client/flags.
app/genesis.go Reintroduced imports for github.com/cosmos/cosmos-sdk/codec and github.com/cosmos/cosmos-sdk/types/module.
app/indexer.go Added import for servertypes from the Cosmos SDK.
app/keepers/keepers.go Reorganized import statements for capabilitykeeper and capabilitytypes.
app/keepers/keys.go Removed and re-added import for capabilitytypes, maintaining the same context.
app/test_helpers.go Reorganized import statements for opchildtypes and types from initia-labs.
app/upgrade.go Added an empty line after the import statement for upgradetypes.
cmd/minitiad/config.go Added import for serverconfig from the Cosmos SDK.
cmd/minitiad/rollback.go Added an empty line for improved readability in the import section.

Sequence Diagram(s)

sequenceDiagram
    participant U as User
    participant RC as RootCmd
    participant FGC as FetchGenesisCmd

    U->>RC: Execute command
    RC->>FGC: Delegate to FetchGenesisCmd
    FGC-->>U: Return genesis state data
Loading

Possibly related PRs

  • add rollback cmd #62: The changes in the main PR, specifically the addition of the cmtcmd.FetchGenesisCmd command in cmd/minitiad/root.go, are related to the changes in the retrieved PR, which also modifies cmd/minitiad/root.go by adding the NewMultipleRollbackCmd command, indicating both PRs enhance the command structure of the same file.

Suggested reviewers

  • beer-1

Poem

I'm a rabbit on the code trail, hopping with cheer,
New commands make the blockchain world crystal clear.
Genesis fetch now in the command parade,
Local paths light the way, a temporary upgrade.
With each leap, our code blooms bright – oh dear! 🐇💻


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 82deaca and 76799b8.

⛔ Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing (14)
  • app/ante/ante.go (1 hunks)
  • app/app.go (1 hunks)
  • app/app_test.go (1 hunks)
  • app/encoding.go (1 hunks)
  • app/genesis.go (1 hunks)
  • app/indexer.go (1 hunks)
  • app/keepers/keepers.go (1 hunks)
  • app/keepers/keys.go (1 hunks)
  • app/test_helpers.go (1 hunks)
  • app/upgrade.go (1 hunks)
  • cmd/minitiad/config.go (1 hunks)
  • cmd/minitiad/rollback.go (1 hunks)
  • cmd/minitiad/root.go (3 hunks)
  • go.mod (1 hunks)
✅ Files skipped from review due to trivial changes (12)
  • cmd/minitiad/config.go
  • app/indexer.go
  • app/test_helpers.go
  • app/encoding.go
  • app/ante/ante.go
  • app/upgrade.go
  • app/genesis.go
  • app/keepers/keepers.go
  • app/app_test.go
  • cmd/minitiad/rollback.go
  • app/app.go
  • app/keepers/keys.go
🚧 Files skipped from review as they are similar to previous changes (2)
  • cmd/minitiad/root.go
  • go.mod
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Minitiad

🪧 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>, please review it.
    • 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 gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @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 generate docstrings to generate docstrings for this 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.

CodeRabbit Configuration 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
Member

@beer-1 beer-1 left a comment

Choose a reason for hiding this comment

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

LGTM; but need to replace cometbft hash to new one

Copy link

codecov bot commented Feb 28, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 77.39%. Comparing base (9ceb00e) to head (76799b8).
Report is 7 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #88      +/-   ##
==========================================
+ Coverage   77.33%   77.39%   +0.06%     
==========================================
  Files          14       14              
  Lines        1416     1420       +4     
==========================================
+ Hits         1095     1099       +4     
  Misses        271      271              
  Partials       50       50              
Files with missing lines Coverage Δ
app/ante/ante.go 58.82% <ø> (ø)
app/app.go 56.70% <ø> (ø)
app/encoding.go 44.11% <ø> (ø)
app/genesis.go 90.90% <ø> (ø)
app/indexer.go 33.33% <ø> (ø)
app/keepers/keepers.go 97.41% <ø> (ø)
app/keepers/keys.go 93.33% <ø> (ø)
app/test_helpers.go 80.00% <ø> (ø)
app/upgrade.go 20.00% <ø> (ø)

@beer-1 beer-1 merged commit ddaf487 into main Feb 28, 2025
10 checks passed
@beer-1 beer-1 deleted the feat/add-genesis-fetcher-command branch February 28, 2025 05:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants