Skip to content

Commit c7f469b

Browse files
committed
fix initialise() to not be able to initialise with the frozen client
Signed-off-by: Jun Kimura <[email protected]>
1 parent 41be5a9 commit c7f469b

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

crates/ibc/src/client_state.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,9 @@ impl<const SYNC_COMMITTEE_SIZE: usize> Ics2ClientState for ClientState<SYNC_COMM
301301
consensus_state: Any,
302302
) -> Result<Box<dyn Ics02ConsensusState>, ClientError> {
303303
self.validate()?;
304+
if self.is_frozen() {
305+
return Err(Error::CannotInitializeFrozenClient.into());
306+
}
304307
let consensus_state = ConsensusState::try_from(consensus_state)?;
305308
consensus_state.validate()?;
306309
Ok(ConsensusState::into_box(consensus_state))

crates/ibc/src/errors.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,8 @@ pub enum Error {
111111
ProtoMissingFieldError(String),
112112
/// unknown message type: `{0}`
113113
UnknownMessageType(String),
114+
/// cannot initialize frozen client
115+
CannotInitializeFrozenClient,
114116
}
115117

116118
impl Error {

0 commit comments

Comments
 (0)