Skip to content

Commit e1c1ac7

Browse files
committed
Fetch latest local commitment txn via a macro in tests
This makes it easier to swap out how we fetch the latest local commitment txn in testing (which we use to check or broadcast old states).
1 parent 03b5da1 commit e1c1ac7

File tree

3 files changed

+48
-43
lines changed

3 files changed

+48
-43
lines changed

lightning/src/ln/functional_test_utils.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,12 @@ macro_rules! get_feerate {
257257
}
258258
}
259259

260+
macro_rules! get_local_commitment_txn {
261+
($node: expr, $channel_id: expr) => {
262+
$node.node.channel_state.lock().unwrap().by_id.get_mut(&$channel_id).unwrap().channel_monitor().get_latest_local_commitment_txn()
263+
}
264+
}
265+
260266
pub fn create_funding_transaction<'a, 'b, 'c>(node: &Node<'a, 'b, 'c>, expected_chan_value: u64, expected_user_chan_id: u64) -> ([u8; 32], Transaction, OutPoint) {
261267
let chan_id = *node.network_chan_count.borrow();
262268

0 commit comments

Comments
 (0)