Skip to content

Commit 5b17762

Browse files
committed
f Adjust test cases
Some test cases have hard-coded values which we change here (to be squashed in after review).
1 parent f40cace commit 5b17762

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

lightning/src/ln/chan_utils.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -2015,9 +2015,9 @@ mod tests {
20152015
assert_eq!(tx.built.transaction.output[0].script_pubkey, get_htlc_redeemscript(&received_htlc, &ChannelTypeFeatures::only_static_remote_key(), &keys).to_p2wsh());
20162016
assert_eq!(tx.built.transaction.output[1].script_pubkey, get_htlc_redeemscript(&offered_htlc, &ChannelTypeFeatures::only_static_remote_key(), &keys).to_p2wsh());
20172017
assert_eq!(get_htlc_redeemscript(&received_htlc, &ChannelTypeFeatures::only_static_remote_key(), &keys).to_p2wsh().to_hex_string(),
2018-
"0020e43a7c068553003fe68fcae424fb7b28ec5ce48cd8b6744b3945631389bad2fb");
2018+
"0020c5e8964fba38daa0dded0cc93c6e94fa56dea59ea0fa6a177fdfec6b25ab313d");
20192019
assert_eq!(get_htlc_redeemscript(&offered_htlc, &ChannelTypeFeatures::only_static_remote_key(), &keys).to_p2wsh().to_hex_string(),
2020-
"0020215d61bba56b19e9eadb6107f5a85d7f99c40f65992443f69229c290165bc00d");
2020+
"0020b45dcbfdfa8371bd9b22bf4b64018a35bb45d1cbb0af9e5151d6a69a5b27238d");
20212021

20222022
// Generate broadcaster output and received and offered HTLC outputs, with anchors
20232023
builder.channel_parameters.channel_type_features = ChannelTypeFeatures::anchors_zero_htlc_fee_and_dependencies();
@@ -2027,9 +2027,9 @@ mod tests {
20272027
assert_eq!(tx.built.transaction.output[2].script_pubkey, get_htlc_redeemscript(&received_htlc, &ChannelTypeFeatures::anchors_zero_htlc_fee_and_dependencies(), &keys).to_p2wsh());
20282028
assert_eq!(tx.built.transaction.output[3].script_pubkey, get_htlc_redeemscript(&offered_htlc, &ChannelTypeFeatures::anchors_zero_htlc_fee_and_dependencies(), &keys).to_p2wsh());
20292029
assert_eq!(get_htlc_redeemscript(&received_htlc, &ChannelTypeFeatures::anchors_zero_htlc_fee_and_dependencies(), &keys).to_p2wsh().to_hex_string(),
2030-
"0020b70d0649c72b38756885c7a30908d912a7898dd5d79457a7280b8e9a20f3f2bc");
2030+
"00207d3737187745d7f0a763c57595c0de042d979ec772d0e8eccf436ab10a9f0b12");
20312031
assert_eq!(get_htlc_redeemscript(&offered_htlc, &ChannelTypeFeatures::anchors_zero_htlc_fee_and_dependencies(), &keys).to_p2wsh().to_hex_string(),
2032-
"002087a3faeb1950a469c0e2db4a79b093a41b9526e5a6fc6ef5cb949bde3be379c7");
2032+
"0020e383e832ec143c95b80378dc21ee9620f0770ba5886bc315c789828f5b882269");
20332033
}
20342034

20352035
#[test]

lightning/src/ln/functional_tests.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -7687,8 +7687,8 @@ fn test_bump_penalty_txn_on_revoked_htlcs() {
76877687
assert_ne!(node_txn[0].input[0].previous_output, node_txn[2].input[0].previous_output);
76887688
assert_ne!(node_txn[1].input[0].previous_output, node_txn[2].input[0].previous_output);
76897689

7690-
assert_eq!(node_txn[0].input[0].previous_output, revoked_htlc_txn[1].input[0].previous_output);
7691-
assert_eq!(node_txn[1].input[0].previous_output, revoked_htlc_txn[0].input[0].previous_output);
7690+
assert_eq!(node_txn[0].input[0].previous_output, revoked_htlc_txn[0].input[0].previous_output);
7691+
assert_eq!(node_txn[1].input[0].previous_output, revoked_htlc_txn[1].input[0].previous_output);
76927692

76937693
// node_txn[3] spends the revoked outputs from the revoked_htlc_txn (which only have one
76947694
// output, checked above).

lightning/src/ln/monitor_tests.rs

+1
Original file line numberDiff line numberDiff line change
@@ -2290,6 +2290,7 @@ fn do_test_restored_packages_retry(check_old_monitor_retries_after_upgrade: bool
22902290
check_spends!(txn[0], commitment_tx);
22912291
txn.pop().unwrap()
22922292
};
2293+
println!("TXID WE EXPECT: {:?}", htlc_timeout_tx.input[0].previous_output);
22932294

22942295
// Check that we can still rebroadcast these packages/transactions if we're upgrading from an
22952296
// old `ChannelMonitor` that did not exercise said rebroadcasting logic.

0 commit comments

Comments
 (0)