Skip to content

Commit

Permalink
Merge pull request #2079 from get10101/fix/rust-dlc-renewal-bug
Browse files Browse the repository at this point in the history
Let app force-close after channel renewal
  • Loading branch information
luckysori authored Feb 21, 2024
2 parents 8d2e62d + fa785ee commit 8724761
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 10 deletions.
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

0 comments on commit 8724761

Please sign in to comment.