Skip to content

Commit

Permalink
test consensus state recovery
Browse files Browse the repository at this point in the history
  • Loading branch information
rnbguy committed Apr 26, 2024
1 parent d1edd86 commit 0f9f1ee
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions ibc-testkit/tests/core/ics02_client/recover_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use ibc::core::client::types::Height;
use ibc::core::entrypoint::{execute, validate};
use ibc::core::handler::types::msgs::MsgEnvelope;
use ibc::core::host::types::identifiers::ClientId;
use ibc::core::host::types::path::ClientConsensusStatePath;
use ibc::core::host::ValidationContext;
use ibc::core::primitives::{Signer, Timestamp};
use ibc_testkit::fixtures::core::signer::dummy_account_id;
Expand Down Expand Up @@ -126,10 +127,27 @@ fn test_recover_client_ok() {

assert!(res.is_ok(), "client recovery execution happy path");

// client state is copied.
assert_eq!(
ctx.client_state(&msg.subject_client_id).unwrap(),
ctx.client_state(&msg.substitute_client_id).unwrap(),
);

// latest consensus state is copied.
assert_eq!(
ctx.consensus_state(&ClientConsensusStatePath::new(
msg.subject_client_id,
substitute_height.revision_number(),
substitute_height.revision_height(),
))
.unwrap(),
ctx.consensus_state(&ClientConsensusStatePath::new(
msg.substitute_client_id,
substitute_height.revision_number(),
substitute_height.revision_height(),
))
.unwrap(),
);
}

#[rstest]
Expand Down

0 comments on commit 0f9f1ee

Please sign in to comment.