Skip to content

Commit 3b17045

Browse files
committed
[test] Demonstrate that the next commit is trivially safe
See comment in the code. This commit exists only to aid reviewers.
1 parent 20e8c7b commit 3b17045

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lightning/src/ln/functional_test_utils.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,12 @@ pub fn confirm_transaction_at<'a, 'b, 'c, 'd>(node: &'a Node<'b, 'c, 'd>, tx: &T
8383
}
8484

8585
pub fn connect_blocks<'a, 'b, 'c, 'd>(node: &'a Node<'b, 'c, 'd>, depth: u32, height: u32, parent: bool, prev_blockhash: BlockHash) -> BlockHash {
86+
// The next commit drops the height, parent, and prev_blockhash parameters. In order to
87+
// demonstrate that they are currently unused, we assert that they always match the new default
88+
// parameters here.
89+
if parent { assert_eq!(prev_blockhash, node.best_block_hash()); }
90+
assert_eq!(node.best_block_info().1, height);
91+
8692
let mut block = Block {
8793
header: BlockHeader { version: 0x2000000, prev_blockhash: if parent { prev_blockhash } else { node.best_block_hash() }, merkle_root: Default::default(), time: 42, bits: 42, nonce: 42 },
8894
txdata: vec![],

0 commit comments

Comments
 (0)