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 client update command for Cosmos chains #151

Merged
merged 3 commits into from
Feb 12, 2024
Merged

Conversation

romac
Copy link
Member

@romac romac commented Feb 12, 2024

Closes: #144

Description

Not all arguments of its v1 counterpart have been implemented yet. We can do this in a separate pass.


PR author checklist:

  • Added changelog entry, using unclog.
  • Added tests: integration (for Hermes) or unit/mock tests (for modules).
  • Linked to GitHub issue.
  • Updated code comments and documentation (e.g., docs/).
  • Tagged one reviewer who will be the one responsible for shepherding this PR.

Reviewer checklist:

  • Reviewed Files changed in the GitHub PR explorer.
  • Manually tested (in case integration/unit/mock tests are absent).

Comment on lines 100 to 107
let height = reference_chain
.with_blocking_chain_handle(|handle| {
handle
.query_latest_height()
.map_err(|e| BaseError::relayer(e).into())
})
.await
.wrap_err("Failed to fetch latest height on reference chain")?;
Copy link
Collaborator

Choose a reason for hiding this comment

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

We can use CanQueryChainHeight to query the latest chain height here.

Suggested change
let height = reference_chain
.with_blocking_chain_handle(|handle| {
handle
.query_latest_height()
.map_err(|e| BaseError::relayer(e).into())
})
.await
.wrap_err("Failed to fetch latest height on reference chain")?;
let height = reference_chain.query_chain_height().await?;

let reference_chain_id = client_state.chain_id;
let reference_chain = builder.build_chain(&reference_chain_id).await?;

let relayer = CanBuildRelay::build_relay(
Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's rename CosmosBuilder::build_relay to CosmosBuilder::build_cosmos_relay, so that we can use builder.build_relay() here without the method name ambiguity.

// help_heading = "Update the client across a genesis restart",
// help = "The height that the chain underwent a genesis restart at. Requires --archive-address if used."
// )]
// restart_height: Option<u64>,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's remove the commented CLI options for now.

@soareschen soareschen merged commit 415ded4 into main Feb 12, 2024
10 checks passed
@soareschen soareschen deleted the romac/client-update-cmd branch February 12, 2024 20:18
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.

Implement client update command for Cosmos chains
2 participants