Skip to content

Commit 58cdbc9

Browse files
committed
f Adjust test cases to accommodate new derivation scheme
Some test cases have hard-coded values which we change here (to be squashed in after review).
1 parent 04c2bfc commit 58cdbc9

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-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+
"0020510277dd095f7e3a7a46efbd9de3a49f527b5b32f4acc70f144dc5c928529520");
20192019
assert_eq!(get_htlc_redeemscript(&offered_htlc, &ChannelTypeFeatures::only_static_remote_key(), &keys).to_p2wsh().to_hex_string(),
2020-
"0020215d61bba56b19e9eadb6107f5a85d7f99c40f65992443f69229c290165bc00d");
2020+
"0020b981c1ea6c0d0c3971e89800312d6fd5564872f22040771d1555605edf5b1cfe");
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+
"002078193f615fc1b050814d866d6c46097f9d19fdae0dbc4905b2b35f427c8d0662");
20312031
assert_eq!(get_htlc_redeemscript(&offered_htlc, &ChannelTypeFeatures::anchors_zero_htlc_fee_and_dependencies(), &keys).to_p2wsh().to_hex_string(),
2032-
"002087a3faeb1950a469c0e2db4a79b093a41b9526e5a6fc6ef5cb949bde3be379c7");
2032+
"0020ac28c4778c24e79755cedc11e7feb638630aa74478781ae7c809aed06e6bd325");
20332033
}
20342034

20352035
#[test]

lightning/src/ln/functional_tests.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -7683,8 +7683,8 @@ fn test_bump_penalty_txn_on_revoked_htlcs() {
76837683
assert_ne!(node_txn[0].input[0].previous_output, node_txn[2].input[0].previous_output);
76847684
assert_ne!(node_txn[1].input[0].previous_output, node_txn[2].input[0].previous_output);
76857685

7686-
assert_eq!(node_txn[0].input[0].previous_output, revoked_htlc_txn[1].input[0].previous_output);
7687-
assert_eq!(node_txn[1].input[0].previous_output, revoked_htlc_txn[0].input[0].previous_output);
7686+
assert_eq!(node_txn[0].input[0].previous_output, revoked_htlc_txn[0].input[0].previous_output);
7687+
assert_eq!(node_txn[1].input[0].previous_output, revoked_htlc_txn[1].input[0].previous_output);
76887688

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

0 commit comments

Comments
 (0)