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

Let app force-close after channel renewal #2079

Merged
merged 1 commit into from
Feb 21, 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
10 changes: 5 additions & 5 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ resolver = "2"
# We are using our own fork of `rust-dlc` at least until we can drop all the LN-DLC features. Also,
# `p2pderivatives/rust-dlc#master` is missing certain patches that can only be found in the LN-DLC
# branch.
dlc-manager = { git = "https://github.com/get10101/rust-dlc", rev = "0ce71cb21f2c0e636af96385c3ed660a1c3e9a6b" }
dlc-messages = { git = "https://github.com/get10101/rust-dlc", rev = "0ce71cb21f2c0e636af96385c3ed660a1c3e9a6b" }
dlc = { git = "https://github.com/get10101/rust-dlc", rev = "0ce71cb21f2c0e636af96385c3ed660a1c3e9a6b" }
p2pd-oracle-client = { git = "https://github.com/get10101/rust-dlc", rev = "0ce71cb21f2c0e636af96385c3ed660a1c3e9a6b" }
dlc-trie = { git = "https://github.com/get10101/rust-dlc", rev = "0ce71cb21f2c0e636af96385c3ed660a1c3e9a6b" }
dlc-manager = { git = "https://github.com/get10101/rust-dlc", rev = "0191dc4" }
dlc-messages = { git = "https://github.com/get10101/rust-dlc", rev = "0191dc4" }
dlc = { git = "https://github.com/get10101/rust-dlc", rev = "0191dc4" }
p2pd-oracle-client = { git = "https://github.com/get10101/rust-dlc", rev = "0191dc4" }
dlc-trie = { git = "https://github.com/get10101/rust-dlc", rev = "0191dc4" }

# We should usually track the `p2pderivatives/split-tx-experiment[-10101]` branch. For now we depend
# on a special fork which removes a panic in `rust-lightning`.
Expand Down
17 changes: 17 additions & 0 deletions crates/tests-e2e/tests/e2e_rollover_position.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,12 @@

use bitcoin::Network;
use native::api;
use native::api::ChannelState;
use native::api::SignedChannelState;
use native::trade::position;
use position::PositionState;
use tests_e2e::app::force_close_dlc_channel;
use tests_e2e::app::get_dlc_channels;
use tests_e2e::app::AppHandle;
use tests_e2e::setup;
use tests_e2e::wait_until;
Expand Down Expand Up @@ -38,6 +42,19 @@ async fn can_rollover_position() {
.position()
.map(|p| PositionState::Open == p.position_state)
.unwrap_or(false));

force_close_dlc_channel();

let channels = get_dlc_channels();
let channel = channels.first().unwrap();

wait_until!(matches!(
channel.channel_state,
ChannelState::Signed {
state: SignedChannelState::Closing { .. },
..
}
));
}

fn check_rollover_position(app: &AppHandle, new_expiry: OffsetDateTime) -> bool {
Expand Down
Loading