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

Simplify bootstrap function arguments with default-able options #2078

Merged
merged 6 commits into from
Apr 22, 2022
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
28 changes: 12 additions & 16 deletions tools/integration-test/src/tests/client_expiration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@ use std::thread::sleep;

use ibc::core::ics03_connection::connection::State as ConnectionState;
use ibc::core::ics04_channel::channel::State as ChannelState;
use ibc::core::ics04_channel::Version as ChannelVersion;
use ibc_relayer::config::default::connection_delay as default_connection_delay;
use ibc_relayer::config::{self, Config, ModeConfig};

use ibc_test_framework::bootstrap::binary::chain::ForeignClientBuilder;
use ibc_test_framework::bootstrap::binary::chain::bootstrap_foreign_client_pair;
use ibc_test_framework::bootstrap::binary::channel::{
bootstrap_channel_with_chains, bootstrap_channel_with_connection,
};
Expand Down Expand Up @@ -140,7 +138,7 @@ impl BinaryChainTest for ChannelExpirationTest {
let connection = {
let _refresh_tasks = spawn_refresh_client_tasks(&chains.foreign_clients)?;

bootstrap_connection(&chains.foreign_clients, default_connection_delay(), false)?
bootstrap_connection(&chains.foreign_clients, Default::default())?
};

wait_for_client_expiry();
Expand Down Expand Up @@ -214,9 +212,11 @@ impl BinaryChainTest for ChannelExpirationTest {
"Trying to create new channel and worker after previous connection worker failed"
);

let foreign_clients_2 = ForeignClientBuilder::new(&chains.handle_a, &chains.handle_b)
.pair()
.bootstrap()?;
let foreign_clients_2 = bootstrap_foreign_client_pair(
&chains.handle_a,
&chains.handle_b,
Default::default(),
)?;

// Need to spawn refresh client for new clients to make sure they don't expire

Expand Down Expand Up @@ -282,10 +282,8 @@ impl BinaryChainTest for PacketExpirationTest {
&chains,
&PortId::transfer(),
&PortId::transfer(),
Order::Unordered,
ChannelVersion::ics20(),
default_connection_delay(),
false,
Default::default(),
Default::default(),
)?
};

Expand Down Expand Up @@ -367,14 +365,14 @@ impl BinaryChainTest for CreateOnExpiredClientTest {
let connection = {
let _refresh_tasks = spawn_refresh_client_tasks(&chains.foreign_clients)?;

bootstrap_connection(&chains.foreign_clients, default_connection_delay(), false)?
bootstrap_connection(&chains.foreign_clients, Default::default())?
};

wait_for_client_expiry();

info!("trying to bootstrap connection after IBC client is expired");

let res = bootstrap_connection(&chains.foreign_clients, default_connection_delay(), false);
let res = bootstrap_connection(&chains.foreign_clients, Default::default());

match res {
Ok(_) => {
Expand All @@ -397,9 +395,7 @@ impl BinaryChainTest for CreateOnExpiredClientTest {
connection,
&DualTagged::new(&PortId::transfer()),
&DualTagged::new(&PortId::transfer()),
Order::Unordered,
ChannelVersion::ics20(),
false,
Default::default(),
);

match res {
Expand Down
Loading