Skip to content

Commit

Permalink
fix semantic diff
Browse files Browse the repository at this point in the history
  • Loading branch information
rnbguy committed Mar 12, 2024
1 parent 1abf751 commit 478fb30
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 20 deletions.
2 changes: 1 addition & 1 deletion ibc-testkit/src/testapp/ibc/core/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use basecoin_store::impls::{GrowingStore, InMemoryStore, RevertibleStore, Shared
use basecoin_store::types::{BinStore, JsonStore, ProtobufStore, TypedSet, TypedStore};
use ibc::core::channel::types::channel::ChannelEnd;
use ibc::core::channel::types::commitment::{AcknowledgementCommitment, PacketCommitment};
use ibc::core::client::context::ClientExecutionContext;
use ibc::core::client::context::{ClientExecutionContext, ClientValidationContext};
use ibc::core::client::types::Height;
use ibc::core::connection::types::ConnectionEnd;
use ibc::core::entrypoint::dispatch;
Expand Down
6 changes: 4 additions & 2 deletions ibc-testkit/tests/core/ics02_client/create_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ fn test_create_client_ok() {

assert!(res.is_ok(), "execution happy path");

let expected_client_state = ClientStateRef::<MockContext>::try_from(msg.client_state).unwrap();
let expected_client_state =
ClientStateRef::<MockContext<MockHost>>::try_from(msg.client_state).unwrap();
assert_eq!(expected_client_state.client_type(), client_type);
assert_eq!(ctx.client_state(&client_id).unwrap(), expected_client_state);
}
Expand Down Expand Up @@ -86,7 +87,8 @@ fn test_tm_create_client_ok() {

assert!(res.is_ok(), "tendermint client execution happy path");

let expected_client_state = ClientStateRef::<MockContext>::try_from(msg.client_state).unwrap();
let expected_client_state =
ClientStateRef::<MockContext<MockHost>>::try_from(msg.client_state).unwrap();
assert_eq!(expected_client_state.client_type(), client_type);
assert_eq!(ctx.client_state(&client_id).unwrap(), expected_client_state);
}
Expand Down
1 change: 0 additions & 1 deletion ibc-testkit/tests/core/ics02_client/upgrade_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ use ibc::core::handler::types::error::ContextError;
use ibc::core::handler::types::events::{IbcEvent, MessageEvent};
use ibc::core::handler::types::msgs::MsgEnvelope;
use ibc::core::host::types::path::ClientConsensusStatePath;
use ibc::core::host::ValidationContext;
use ibc_testkit::fixtures::clients::tendermint::{
dummy_tendermint_header, dummy_tm_client_state_from_header,
};
Expand Down
6 changes: 3 additions & 3 deletions ibc-testkit/tests/core/ics04_channel/acknowledgement.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ fn fixture() -> Fixture {

let client_height = Height::new(0, 2).unwrap();
let ctx = MockContext::<MockHost>::default().with_light_client(
&ClientId::default(),
&ClientId::new("07-tendermint", 0).expect("no error"),
LightClientState::<MockHost>::with_latest_height(client_height),
);

Expand Down Expand Up @@ -125,7 +125,7 @@ fn ack_success_no_packet_commitment(fixture: Fixture) {
} = fixture;
let ctx = ctx
.with_light_client(
&ClientId::default(),
&ClientId::new("07-tendermint", 0).expect("no error"),
LightClientState::<MockHost>::with_latest_height(client_height),
)
.with_channel(
Expand Down Expand Up @@ -160,7 +160,7 @@ fn ack_success_happy_path(fixture: Fixture) {
} = fixture;
let mut ctx = ctx
.with_light_client(
&ClientId::default(),
&ClientId::new("07-tendermint", 0).expect("no error"),
LightClientState::<MockHost>::with_latest_height(client_height),
)
.with_channel(
Expand Down
7 changes: 4 additions & 3 deletions ibc-testkit/tests/core/ics04_channel/recv_packet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ pub struct Fixture {
#[fixture]
fn fixture() -> Fixture {
let context = MockContext::<MockHost>::default();
let client_id = ClientId::new("07-tendermint", 0).expect("no error");

let router = MockRouter::new_with_transfer();

Expand Down Expand Up @@ -120,7 +121,7 @@ fn recv_packet_validate_happy_path(fixture: Fixture) {
let packet = &msg.packet;
let mut context = context
.with_light_client(
&ClientId::default(),
&ClientId::new("07-tendermint", 0).expect("no error"),
LightClientState::<MockHost>::with_latest_height(client_height),
)
.with_connection(ConnectionId::zero(), conn_end_on_b)
Expand Down Expand Up @@ -197,7 +198,7 @@ fn recv_packet_timeout_expired(fixture: Fixture) {

let context = context
.with_light_client(
&ClientId::default(),
&ClientId::new("07-tendermint", 0).expect("no error"),
LightClientState::<MockHost>::with_latest_height(client_height),
)
.with_connection(ConnectionId::zero(), conn_end_on_b)
Expand Down Expand Up @@ -226,7 +227,7 @@ fn recv_packet_execute_happy_path(fixture: Fixture) {
} = fixture;
let mut ctx = context
.with_light_client(
&ClientId::default(),
&ClientId::new("07-tendermint", 0).expect("no error"),
LightClientState::<MockHost>::with_latest_height(client_height),
)
.with_connection(ConnectionId::zero(), conn_end_on_b)
Expand Down
8 changes: 4 additions & 4 deletions ibc-testkit/tests/core/ics04_channel/send_packet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ fn send_packet_processing() {
name: "Good parameters".to_string(),
ctx: MockContext::<MockHost>::default()
.with_light_client(
&ClientId::default(),
&ClientId::new("07-tendermint", 0).expect("no error"),
LightClientState::<MockHost>::with_latest_height(client_height),
)
.with_connection(ConnectionId::zero(), conn_end_on_a.clone())
Expand All @@ -107,7 +107,7 @@ fn send_packet_processing() {
name: "Packet timeout height same as destination chain height".to_string(),
ctx: MockContext::<MockHost>::default()
.with_light_client(
&ClientId::default(),
&ClientId::new("07-tendermint", 0).expect("no error"),
LightClientState::<MockHost>::with_latest_height(client_height),
)
.with_connection(ConnectionId::zero(), conn_end_on_a.clone())
Expand All @@ -120,7 +120,7 @@ fn send_packet_processing() {
name: "Packet timeout height one more than destination chain height".to_string(),
ctx: MockContext::<MockHost>::default()
.with_light_client(
&ClientId::default(),
&ClientId::new("07-tendermint", 0).expect("no error"),
LightClientState::<MockHost>::with_latest_height(client_height),
)
.with_connection(ConnectionId::zero(), conn_end_on_a.clone())
Expand All @@ -133,7 +133,7 @@ fn send_packet_processing() {
name: "Packet timeout due to timestamp".to_string(),
ctx: MockContext::<MockHost>::default()
.with_light_client(
&ClientId::default(),
&ClientId::new("07-tendermint", 0).expect("no error"),
LightClientState::<MockHost>::with_latest_height(client_height),
)
.with_connection(ConnectionId::zero(), conn_end_on_a)
Expand Down
10 changes: 5 additions & 5 deletions ibc-testkit/tests/core/ics04_channel/timeout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ fn fixture() -> Fixture {

let client_height = Height::new(0, 2).unwrap();
let ctx = MockContext::<MockHost>::default().with_light_client(
&ClientId::default(),
&ClientId::new("07-tendermint", 0).expect("no error"),
LightClientState::<MockHost>::with_latest_height(client_height),
);

Expand Down Expand Up @@ -115,7 +115,7 @@ fn timeout_fail_no_channel(fixture: Fixture) {
..
} = fixture;
let ctx = ctx.with_light_client(
&ClientId::default(),
&ClientId::new("07-tendermint", 0).expect("no error"),
LightClientState::<MockHost>::with_latest_height(client_height),
);
let msg_envelope = MsgEnvelope::from(PacketMsg::from(msg));
Expand Down Expand Up @@ -192,7 +192,7 @@ fn timeout_fail_proof_timeout_not_reached(fixture: Fixture) {

let mut ctx = ctx
.with_light_client(
&ClientId::default(),
&ClientId::new("07-tendermint", 0).expect("no error"),
LightClientState::<MockHost>::with_latest_height(client_height),
)
.with_connection(ConnectionId::zero(), conn_end_on_a)
Expand Down Expand Up @@ -273,7 +273,7 @@ fn timeout_unordered_channel_validate(fixture: Fixture) {

let mut ctx = ctx
.with_light_client(
&ClientId::default(),
&ClientId::new("07-tendermint", 0).expect("no error"),
LightClientState::<MockHost>::with_latest_height(client_height),
)
.with_connection(ConnectionId::zero(), conn_end_on_a)
Expand Down Expand Up @@ -323,7 +323,7 @@ fn timeout_ordered_channel_validate(fixture: Fixture) {

let mut ctx = ctx
.with_light_client(
&ClientId::default(),
&ClientId::new("07-tendermint", 0).expect("no error"),
LightClientState::<MockHost>::with_latest_height(client_height),
)
.with_connection(ConnectionId::zero(), conn_end_on_a)
Expand Down
2 changes: 1 addition & 1 deletion ibc-testkit/tests/core/ics04_channel/timeout_on_close.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ fn fixture() -> Fixture {

let client_height = Height::new(0, 2).unwrap();
let context = MockContext::<MockHost>::default().with_light_client(
&ClientId::default(),
&ClientId::new("07-tendermint", 0).expect("no error"),
LightClientState::<MockHost>::with_latest_height(client_height),
);
let router = MockRouter::new_with_transfer();
Expand Down

0 comments on commit 478fb30

Please sign in to comment.