Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Perform channel handshake in IBC state machine tests #4830

Merged
merged 1 commit into from
Aug 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 18 additions & 5 deletions crates/core/app/tests/common/ibc_tests/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,11 @@ use {
},
ibc_types::{
core::{
channel::{ChannelEnd, ChannelId, PortId, Version as ChannelVersion},
client::{ClientId, ClientType, Height},
connection::{ChainId, ConnectionEnd, ConnectionId, Counterparty, Version},
connection::{
ChainId, ConnectionEnd, ConnectionId, Counterparty, Version as ConnectionVersion,
},
},
lightclients::tendermint::{
consensus_state::ConsensusState, header::Header as TendermintHeader,
Expand Down Expand Up @@ -46,17 +49,21 @@ use {
#[allow(unused)]
pub struct TestNodeWithIBC {
pub connection_id: ConnectionId,
pub channel_id: ChannelId,
pub client_id: ClientId,
pub port_id: PortId,
pub chain_id: String,
pub counterparty: Counterparty,
pub version: Version,
pub connection_version: ConnectionVersion,
pub channel_version: ChannelVersion,
pub signer: String,
pub connection: Option<ConnectionEnd>,
pub channel: Option<ChannelEnd>,
pub node: TestNode<Actor<ConsensusRequest, ConsensusResponse, Box<dyn Error + Send + Sync>>>,
pub storage: TempStorage,
pub ibc_client_query_client: IbcClientQueryClient<Channel>,
pub ibc_connection_query_client: IbcConnectionQueryClient<Channel>,
pub _ibc_channel_query_client: IbcChannelQueryClient<Channel>,
pub ibc_channel_query_client: IbcChannelQueryClient<Channel>,
pub tendermint_proxy_service_client: TendermintProxyServiceClient<Channel>,
}

Expand Down Expand Up @@ -149,6 +156,10 @@ impl TestNodeWithIBC {
Ok(Self {
// the test relayer supports only a single connection on each chain as of now
connection_id: ConnectionId::new(0),
// the test relayer supports only a single channel per connection on each chain as of now
channel_id: ChannelId::new(0),
// Only ICS20 transfers are supported
port_id: PortId::transfer(),
node,
storage,
client_id: ClientId::new(ClientType::new("07-tendermint".to_string()), 0)?,
Expand All @@ -158,11 +169,13 @@ impl TestNodeWithIBC {
connection_id: None,
prefix: IBC_COMMITMENT_PREFIX.to_owned(),
},
version: Version::default(),
connection_version: ConnectionVersion::default(),
channel_version: ChannelVersion::new("ics20-1".to_string()),
signer: hex::encode_upper(proposer_address),
connection: None,
channel: None,
ibc_connection_query_client,
_ibc_channel_query_client: ibc_channel_query_client,
ibc_channel_query_client,
ibc_client_query_client,
tendermint_proxy_service_client,
})
Expand Down
Loading
Loading