Skip to content

Commit 2e4d7bc

Browse files
TheBlueMattjoostjager
authored andcommitted
try to test
1 parent 8501acf commit 2e4d7bc

File tree

2 files changed

+44
-0
lines changed

2 files changed

+44
-0
lines changed

lightning/src/ln/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,5 +99,8 @@ mod offers_tests;
9999
#[cfg(test)]
100100
#[allow(unused_mut)]
101101
mod dual_funding_tests;
102+
#[cfg(all(not(taproot), test))]
103+
#[allow(unused_mut)]
104+
mod upgrade_downgrade_tests;
102105

103106
pub use self::peer_channel_encryptor::LN_MAX_MSG_LEN;
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
// This file is Copyright its original authors, visible in version control
2+
// history.
3+
//
4+
// This file is licensed under the Apache License, Version 2.0 <LICENSE-APACHE
5+
// or http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
6+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your option.
7+
// You may not use this file except in accordance with one or both of these
8+
// licenses.
9+
10+
//! Tests which test upgrading from previous versions of LDK or downgrading to previous versions of
11+
//! LDK.
12+
13+
use crate::ln::functional_test_utils::*;
14+
use crate::types::payment::PaymentPreimage;
15+
use crate::util::ser::Writeable;
16+
17+
#[test]
18+
fn simple_upgrade() {
19+
let (persister, chain_monitor);
20+
let nodes_0_deserialized;
21+
22+
23+
let chanmon_cfgs = create_chanmon_cfgs(2);
24+
let node_cfgs = create_node_cfgs(2, &chanmon_cfgs);
25+
let node_chanmgrs = create_node_chanmgrs(2, &node_cfgs, &[None, None]);
26+
let mut nodes = create_network(2, &node_cfgs, &node_chanmgrs);
27+
28+
let chan_id = create_announced_chan_between_nodes(&nodes, 0, 1).2;
29+
30+
let payment_preimage = route_payment(&nodes[0], &[&nodes[1]], 1_000_000);
31+
let preimage = PaymentPreimage(payment_preimage.0.0);
32+
33+
let node_a = nodes[0].node.encode();
34+
let mon_a = get_monitor!(nodes[0], chan_id).encode();
35+
36+
reload_node!(nodes[0], test_default_channel_config(), &node_a, &[&mon_a], persister, chain_monitor, nodes_0_deserialized);
37+
38+
reconnect_nodes(ReconnectArgs::new(&nodes[0], &nodes[1]));
39+
40+
claim_payment(&nodes[0], &[&nodes[1]], preimage);
41+
}

0 commit comments

Comments
 (0)