Skip to content

Commit

Permalink
Set upgrade client state latest height rev number to new chain-id
Browse files Browse the repository at this point in the history
  • Loading branch information
ancazamfir committed Feb 2, 2023
1 parent 097c5df commit 5235a95
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion crates/relayer-types/src/core/ics02_client/height.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use crate::core::ics02_client::error::Error;
#[derive(Copy, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub struct Height {
/// Previously known as "epoch"
revision_number: u64,
pub revision_number: u64,

/// The height of a block
revision_height: u64,
Expand Down
3 changes: 2 additions & 1 deletion crates/relayer/src/upgrade_chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,11 @@ pub fn build_and_send_ibc_upgrade_proposal(
src_chain: impl ChainHandle, // the source chain; supplies a client state for building the upgrade plan
opts: &UpgradePlanOptions,
) -> Result<TxHash, UpgradeChainError> {
let upgrade_height = dst_chain
let mut upgrade_height = dst_chain
.query_latest_height() // FIXME(romac): Use query_chain_latest_height once added to ChainHandle
.map_err(UpgradeChainError::query)?
.add(opts.height_offset);
upgrade_height.revision_number = opts.upgraded_chain_id.version();

let (client_state, _) = src_chain
.query_client_state(
Expand Down

0 comments on commit 5235a95

Please sign in to comment.