Skip to content

Commit 0fd19f0

Browse files
committed
check if client at counterparty is frozen
1 parent 956a071 commit 0fd19f0

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

ibc-testkit/src/testapp/ibc/core/core_ctx.rs

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -81,13 +81,19 @@ where
8181
&self,
8282
client_state_of_host_on_counterparty: Self::HostClientState,
8383
) -> Result<(), ContextError> {
84-
// // FIXME(rano): is_frozen is specific to Tendermint or Mock client state.
85-
// if client_state_of_host_on_counterparty.is_frozen() {
86-
// return Err(ClientError::ClientFrozen {
87-
// description: String::new(),
88-
// }
89-
// .into());
90-
// }
84+
// TODO(rano): simplify the status method. The client id is not needed here as the client state is at remote chain.
85+
// We use a nonexisting client id to be able to call this method.
86+
// Note, this will never return `Status::Active` and in happy cases it will return `Status::Expired` as
87+
// the client state will not be found.
88+
if client_state_of_host_on_counterparty
89+
.status(self, &ClientId::new("nonexisting", 999).expect("no error"))?
90+
.is_frozen()
91+
{
92+
return Err(ClientError::ClientFrozen {
93+
description: String::new(),
94+
}
95+
.into());
96+
}
9197

9298
let latest_height = self.host_height()?;
9399

0 commit comments

Comments
 (0)