diff --git a/.changelog/unreleased/improvements/ibc/1297-impl-consensus-state.md b/.changelog/unreleased/improvements/ibc/1297-impl-consensus-state.md new file mode 100644 index 0000000000..4719175311 --- /dev/null +++ b/.changelog/unreleased/improvements/ibc/1297-impl-consensus-state.md @@ -0,0 +1,3 @@ +- Implement `ics02_client::client_consensus::ConsensusState` for `AnyConsensusState` ([#1297]) + +[#1297]: https://github.com/informalsystems/ibc-rs/issues/1297 diff --git a/modules/src/ics02_client/client_consensus.rs b/modules/src/ics02_client/client_consensus.rs index da2d0bb12c..3f066d3033 100644 --- a/modules/src/ics02_client/client_consensus.rs +++ b/modules/src/ics02_client/client_consensus.rs @@ -161,11 +161,21 @@ impl ConsensusState for AnyConsensusState { } fn root(&self) -> &CommitmentRoot { - todo!() + match self { + Self::Tendermint(cs_state) => cs_state.root(), + + #[cfg(any(test, feature = "mocks"))] + Self::Mock(mock_state) => mock_state.root(), + } } fn validate_basic(&self) -> Result<(), Infallible> { - todo!() + match self { + Self::Tendermint(cs_state) => cs_state.validate_basic(), + + #[cfg(any(test, feature = "mocks"))] + Self::Mock(mock_state) => mock_state.validate_basic(), + } } fn wrap_any(self) -> AnyConsensusState {