Skip to content

Commit

Permalink
relax ClientStateExecution to ClientStateValidation
Browse files Browse the repository at this point in the history
  • Loading branch information
rnbguy committed Jun 28, 2024
1 parent e483d9f commit 9236182
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
12 changes: 6 additions & 6 deletions ibc-testkit/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use basecoin_store::context::ProvableStore;
use basecoin_store::impls::InMemoryStore;
use ibc::core::channel::types::channel::ChannelEnd;
use ibc::core::channel::types::commitment::PacketCommitment;
use ibc::core::client::context::client_state::ClientStateExecution;
use ibc::core::client::context::client_state::{ClientStateExecution, ClientStateValidation};
use ibc::core::client::context::consensus_state::ConsensusState;
use ibc::core::client::context::{ClientExecutionContext, ClientValidationContext};
use ibc::core::client::types::error::ClientError;
Expand Down Expand Up @@ -43,7 +43,7 @@ where
H: TestHost,
ACL: From<HostClientState<H>> + ClientStateExecution<MockIbcStore<S, ACL, ACS>> + Clone,
ACS: From<HostConsensusState<H>> + ConsensusState + Clone,
HostClientState<H>: ClientStateExecution<MockIbcStore<S, ACL, ACS>>,
HostClientState<H>: ClientStateValidation<MockIbcStore<S, ACL, ACS>>,
{
/// The multi store of the context.
/// This is where the IBC store root is stored at IBC commitment prefix.
Expand Down Expand Up @@ -80,7 +80,7 @@ where
H: TestHost,
ACL: From<HostClientState<H>> + ClientStateExecution<MockIbcStore<S, ACL, ACS>> + Clone,
ACS: From<HostConsensusState<H>> + ConsensusState + Clone,
HostClientState<H>: ClientStateExecution<MockIbcStore<S, ACL, ACS>>,
HostClientState<H>: ClientStateValidation<MockIbcStore<S, ACL, ACS>>,
MockIbcStore<S, ACL, ACS>:
ClientExecutionContext<ClientStateMut = ACL, ConsensusStateRef = ACS>,
ClientError: From<<ACL as TryFrom<Any>>::Error>,
Expand All @@ -98,7 +98,7 @@ where
H: TestHost,
ACL: From<HostClientState<H>> + ClientStateExecution<MockIbcStore<S, ACL, ACS>> + Clone,
ACS: From<HostConsensusState<H>> + ConsensusState + Clone,
HostClientState<H>: ClientStateExecution<MockIbcStore<S, ACL, ACS>>,
HostClientState<H>: ClientStateValidation<MockIbcStore<S, ACL, ACS>>,
MockIbcStore<S, ACL, ACS>:
ClientExecutionContext<ClientStateMut = ACL, ConsensusStateRef = ACS>,
ClientError: From<<ACL as TryFrom<Any>>::Error>,
Expand Down Expand Up @@ -538,7 +538,7 @@ mod tests {
AnyClientState: From<HostClientState<H>>,
AnyConsensusState: From<HostConsensusState<H>>,
HostConsensusState<H>: ConsensusState,
HostClientState<H>: ClientStateExecution<DefaultIbcStore>,
HostClientState<H>: ClientStateValidation<DefaultIbcStore>,
{
name: String,
ctx: TestContext<H>,
Expand All @@ -550,7 +550,7 @@ mod tests {
AnyClientState: From<HostClientState<H>>,
AnyConsensusState: From<HostConsensusState<H>>,
HostConsensusState<H>: ConsensusState,
HostClientState<H>: ClientStateExecution<DefaultIbcStore>,
HostClientState<H>: ClientStateValidation<DefaultIbcStore>,
{
let cv = 0; // The version to use for all chains.

Expand Down
4 changes: 2 additions & 2 deletions ibc-testkit/src/fixtures/core/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use alloc::fmt::Debug;
use core::time::Duration;

use basecoin_store::context::ProvableStore;
use ibc::core::client::context::client_state::ClientStateExecution;
use ibc::core::client::context::client_state::{ClientStateExecution, ClientStateValidation};
use ibc::core::client::context::consensus_state::ConsensusState;
use ibc::core::client::context::ClientExecutionContext;
use ibc::core::client::types::error::ClientError;
Expand Down Expand Up @@ -48,7 +48,7 @@ where
S: ProvableStore + Debug,
ACL: From<HostClientState<H>> + ClientStateExecution<MockIbcStore<S, ACL, ACS>> + Clone,
ACS: From<HostConsensusState<H>> + ConsensusState + Clone,
HostClientState<H>: ClientStateExecution<MockIbcStore<S, ACL, ACS>>,
HostClientState<H>: ClientStateValidation<MockIbcStore<S, ACL, ACS>>,
MockIbcStore<S, ACL, ACS>:
ClientExecutionContext<ClientStateMut = ACL, ConsensusStateRef = ACS>,
ClientError: From<<ACL as TryFrom<Any>>::Error>,
Expand Down
8 changes: 4 additions & 4 deletions ibc-testkit/src/testapp/ibc/core/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ where
S: ProvableStore + Debug + Default,
ACL: From<HostClientState<H>> + ClientStateExecution<MockIbcStore<S, ACL, ACS>> + Clone,
ACS: From<HostConsensusState<H>> + ConsensusState + Clone,
HostClientState<H>: ClientStateExecution<MockIbcStore<S, ACL, ACS>>,
HostClientState<H>: ClientStateValidation<MockIbcStore<S, ACL, ACS>>,
MockIbcStore<S, ACL, ACS>:
ClientExecutionContext<ClientStateMut = ACL, ConsensusStateRef = ACS>,
ClientError: From<<ACL as TryFrom<Any>>::Error>,
Expand All @@ -474,7 +474,7 @@ where
S: ProvableStore + Debug + Default,
ACL: From<HostClientState<H>> + ClientStateExecution<MockIbcStore<S, ACL, ACS>> + Clone,
ACS: From<HostConsensusState<H>> + ConsensusState + Clone,
HostClientState<H>: ClientStateExecution<MockIbcStore<S, ACL, ACS>>,
HostClientState<H>: ClientStateValidation<MockIbcStore<S, ACL, ACS>>,
MockIbcStore<S, ACL, ACS>:
ClientExecutionContext<ClientStateMut = ACL, ConsensusStateRef = ACS>,
ClientError: From<<ACL as TryFrom<Any>>::Error>,
Expand All @@ -495,7 +495,7 @@ where
S: ProvableStore + Debug,
ACL: From<HostClientState<H>> + ClientStateExecution<MockIbcStore<S, ACL, ACS>> + Clone,
ACS: From<HostConsensusState<H>> + ConsensusState + Clone,
HostClientState<H>: ClientStateExecution<MockIbcStore<S, ACL, ACS>>,
HostClientState<H>: ClientStateValidation<MockIbcStore<S, ACL, ACS>>,
{
context: &'a StoreGenericTestContext<S, H, ACL, ACS>,
#[builder(default, setter(into))]
Expand All @@ -511,7 +511,7 @@ where
S: ProvableStore + Debug,
ACL: From<HostClientState<H>> + ClientStateExecution<MockIbcStore<S, ACL, ACS>> + Clone,
ACS: From<HostConsensusState<H>> + ConsensusState + Clone,
HostClientState<H>: ClientStateExecution<MockIbcStore<S, ACL, ACS>>,
HostClientState<H>: ClientStateValidation<MockIbcStore<S, ACL, ACS>>,
MockIbcStore<S, ACL, ACS>:
ClientExecutionContext<ClientStateMut = ACL, ConsensusStateRef = ACS>,
ClientError: From<<ACL as TryFrom<Any>>::Error>,
Expand Down
4 changes: 2 additions & 2 deletions tests-integration/tests/core/ics02_client/update_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use ibc::clients::tendermint::types::{
client_type as tm_client_type, ClientState as TmClientState, Header as TmHeader,
Misbehaviour as TmMisbehaviour,
};
use ibc::core::client::context::client_state::{ClientStateExecution, ClientStateValidation};
use ibc::core::client::context::client_state::ClientStateValidation;
use ibc::core::client::context::ClientValidationContext;
use ibc::core::client::types::msgs::{ClientMsg, MsgUpdateClient};
use ibc::core::client::types::proto::v1::Height as RawHeight;
Expand Down Expand Up @@ -1530,7 +1530,7 @@ pub(crate) fn build_client_update_datagram<H: TestHeader, Dst: TestHost>(
where
AnyClientState: From<HostClientState<Dst>>,
AnyConsensusState: From<HostConsensusState<Dst>>,
HostClientState<Dst>: ClientStateExecution<DefaultIbcStore>,
HostClientState<Dst>: ClientStateValidation<DefaultIbcStore>,
{
// Check if client for ibc0 on ibc1 has been updated to latest height:
// - query client state on destination chain
Expand Down

0 comments on commit 9236182

Please sign in to comment.