Skip to content

Commit d44c6c9

Browse files
committed
[tests] Demonstrate that the commit is trivially safe
See comment in the code, This commit exists only to aid reviewers.
1 parent 6e965d7 commit d44c6c9

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lightning/src/ln/functional_test_utils.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ pub fn connect_blocks<'a, 'b, 'c, 'd>(node: &'a Node<'b, 'c, 'd>, depth: u32) ->
100100
}
101101

102102
pub fn connect_block<'a, 'b, 'c, 'd>(node: &'a Node<'b, 'c, 'd>, block: &Block, height: u32) {
103+
assert_eq!(height, node.best_block_info().1 + 1); // height is always equal to the parameter we'll fix it at in the next commit
103104
let txdata: Vec<_> = block.txdata.iter().enumerate().collect();
104105
node.chain_monitor.chain_monitor.block_connected(&block.header, &txdata, height);
105106
node.node.block_connected(&block.header, &txdata, height);
@@ -108,6 +109,7 @@ pub fn connect_block<'a, 'b, 'c, 'd>(node: &'a Node<'b, 'c, 'd>, block: &Block,
108109
}
109110

110111
pub fn disconnect_block<'a, 'b, 'c, 'd>(node: &'a Node<'b, 'c, 'd>, header: &BlockHeader, height: u32) {
112+
assert_eq!(height, node.best_block_info().1); // height is always equal to the parameter we'll fix it at in the next commit
111113
node.chain_monitor.chain_monitor.block_disconnected(header, height);
112114
node.node.block_disconnected(header);
113115
node.blocks.borrow_mut().pop();

0 commit comments

Comments
 (0)