Skip to content

Commit

Permalink
Remove incorrect timeout channel upgrade test
Browse files Browse the repository at this point in the history
  • Loading branch information
ljoss17 committed Jan 8, 2024
1 parent 4722b38 commit ae0e73c
Showing 1 changed file with 0 additions and 124 deletions.
124 changes: 0 additions & 124 deletions tools/integration-test/src/tests/channel_upgrade/upgrade_handshake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,6 @@ fn test_channel_upgrade_clear_handshake() -> Result<(), Error> {
run_binary_channel_test(&ChannelUpgradeClearHandshake)
}

/*#[test]
fn test_channel_upgrade_timeout_try_handshake() -> Result<(), Error> {
run_binary_channel_test(&ChannelUpgradeTimeoutTryHandshake)
}*/

#[test]
fn test_channel_upgrade_timeout_ack_handshake() -> Result<(), Error> {
run_binary_channel_test(&ChannelUpgradeTimeoutAckHandshake)
Expand Down Expand Up @@ -258,125 +253,6 @@ impl BinaryChannelTest for ChannelUpgradeClearHandshake {
}
}

// TODO: Disabled while figuring out some details.
/*pub struct ChannelUpgradeTimeoutTryHandshake;
impl TestOverrides for ChannelUpgradeTimeoutTryHandshake {
fn modify_relayer_config(&self, config: &mut Config) {
config.mode.channels.enabled = true;
}
fn modify_genesis_file(&self, genesis: &mut serde_json::Value) -> Result<(), Error> {
set_max_deposit_period(genesis, MAX_DEPOSIT_PERIOD)?;
set_voting_period(genesis, VOTING_PERIOD)?;
Ok(())
}
fn should_spawn_supervisor(&self) -> bool {
false
}
}
impl BinaryChannelTest for ChannelUpgradeTimeoutTryHandshake {
fn run<ChainA: ChainHandle, ChainB: ChainHandle>(
&self,
_config: &TestConfig,
relayer: RelayerDriver,
chains: ConnectedChains<ChainA, ChainB>,
channels: ConnectedChannel<ChainA, ChainB>,
) -> Result<(), Error> {
info!("Check that channels are both in OPEN State");
assert_eventually_channel_established(
&chains.handle_b,
&chains.handle_a,
&channels.channel_id_b.as_ref(),
&channels.port_b.as_ref(),
)?;
let channel_end_a = chains
.handle_a
.query_channel(
QueryChannelRequest {
port_id: channels.port_a.0.clone(),
channel_id: channels.channel_id_a.0.clone(),
height: QueryHeight::Latest,
},
IncludeProof::No,
)
.map(|(channel_end, _)| channel_end)
.map_err(|e| eyre!("Error querying ChannelEnd A: {e}"))?;
let channel_end_b = chains
.handle_b
.query_channel(
QueryChannelRequest {
port_id: channels.port_b.0.clone(),
channel_id: channels.channel_id_b.0.clone(),
height: QueryHeight::Latest,
},
IncludeProof::No,
)
.map(|(channel_end, _)| channel_end)
.map_err(|e| eyre!("Error querying ChannelEnd B: {e}"))?;
let old_version = channel_end_a.version;
let old_ordering = channel_end_a.ordering;
let old_connection_hops_a = channel_end_a.connection_hops;
let old_connection_hops_b = channel_end_b.connection_hops;
let channel = channels.channel;
let new_version = Version::ics20_with_fee();
let old_attrs = ChannelUpgradableAttributes::new(
old_version.clone(),
old_version.clone(),
old_ordering,
old_connection_hops_a.clone(),
old_connection_hops_b.clone(),
Sequence::from(1),
);
info!("Will update channel params to set a short upgrade timeout...");
chains.node_a.chain_driver().update_channel_params(
4000000000,
chains.handle_a().get_signer().unwrap().as_ref(),
"1",
)?;
info!("Will initialise upgrade handshake with governance proposal...");
chains.node_a.chain_driver().initialise_channel_upgrade(
channel.src_port_id().as_str(),
channel.src_channel_id().unwrap().as_str(),
old_ordering.as_str(),
old_connection_hops_a.first().unwrap().as_str(),
&serde_json::to_string(&new_version.0).unwrap(),
chains.handle_a().get_signer().unwrap().as_ref(),
"2",
)?;
std::thread::sleep(Duration::from_secs(10));
info!("Check that the channel upgrade was successfully cancelled...");
// This will assert that both channel ends are eventually
// in Open state, and that the fields have not changed.
relayer.with_supervisor(|| {
assert_eventually_channel_upgrade_cancel(
&chains.handle_a,
&chains.handle_b,
&channels.channel_id_a.as_ref(),
&channels.port_a.as_ref(),
&old_attrs,
)?;
Ok(())
})
}
}*/

pub struct ChannelUpgradeTimeoutAckHandshake;

impl TestOverrides for ChannelUpgradeTimeoutAckHandshake {
Expand Down

0 comments on commit ae0e73c

Please sign in to comment.