Skip to content

Commit

Permalink
Add CommonContext::ConversionError
Browse files Browse the repository at this point in the history
  • Loading branch information
plafer committed Jun 28, 2023
1 parent bf69139 commit 0cb3657
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion crates/ibc/src/clients/ics07_tendermint/context.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
use alloc::string::ToString;

use crate::{
core::{
ics02_client::ClientExecutionContext,
Expand All @@ -12,7 +14,8 @@ use super::consensus_state::ConsensusState as TmConsensusState;

/// Client's context required during both validation and execution
pub trait CommonContext {
type AnyConsensusState: TryInto<TmConsensusState, Error = &'static str>;
type ConversionError: ToString;
type AnyConsensusState: TryInto<TmConsensusState, Error = Self::ConversionError>;

/// Retrieve the consensus state for the given client ID at the specified
/// height.
Expand Down
1 change: 1 addition & 0 deletions crates/ibc/src/mock/context/clients.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ use crate::core::ValidationContext;
use crate::Height;

impl TmCommonContext for MockContext {
type ConversionError = &'static str;
type AnyConsensusState = AnyConsensusState;

fn consensus_state(
Expand Down

0 comments on commit 0cb3657

Please sign in to comment.