Skip to content

Commit

Permalink
update mock client state
Browse files Browse the repository at this point in the history
  • Loading branch information
rnbguy committed Apr 25, 2024
1 parent a47744e commit 66321c6
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions ibc-testkit/src/testapp/ibc/clients/mock/client_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,7 @@ where
ctx: &mut E,
subject_client_id: &ClientId,
substitute_client_state: Any,
substitute_consensus_state: Any,
) -> Result<(), ClientError> {
let substitute_client_state = MockClientState::try_from(substitute_client_state)?;

Expand All @@ -453,6 +454,17 @@ where
let host_timestamp = ctx.host_timestamp()?;
let host_height = ctx.host_height()?;

let mock_consensus_state = MockConsensusState::try_from(substitute_consensus_state)?;

ctx.store_consensus_state(
ClientConsensusStatePath::new(
subject_client_id.clone(),
new_mock_client_state.latest_height().revision_number(),
new_mock_client_state.latest_height().revision_height(),
),
mock_consensus_state.into(),
)?;

ctx.store_client_state(
ClientStatePath::new(subject_client_id.clone()),
new_mock_client_state.into(),
Expand Down

0 comments on commit 66321c6

Please sign in to comment.