Skip to content

Commit 5e7d840

Browse files
committed
Check local signtures explicitly in channel tx-generation tests
It appears the local signatures which are specified in the channel transaction-generation tests were never checked directly (though they were checked as a part of the overall fully-signed-transaction tests). Check them explicitly so that they can be updated for static remote key.
1 parent eee4a1c commit 5e7d840

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lightning/src/ln/channel.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4518,6 +4518,7 @@ mod tests {
45184518

45194519
localtx = LocalCommitmentTransaction::new_missing_local_sig(unsigned_tx.0.clone(), their_signature.clone(), &PublicKey::from_secret_key(&secp_ctx, chan.local_keys.funding_key()), chan.their_funding_pubkey(), keys.clone(), chan.feerate_per_kw, per_htlc);
45204520
let local_sig = chan_keys.sign_local_commitment(&localtx, &chan.secp_ctx).unwrap();
4521+
assert_eq!(Signature::from_der(&hex::decode($our_sig_hex).unwrap()[..]).unwrap(), local_sig);
45214522

45224523
assert_eq!(serialize(&localtx.add_local_sig(&redeemscript, local_sig))[..],
45234524
hex::decode($tx_hex).unwrap()[..]);
@@ -4550,6 +4551,8 @@ mod tests {
45504551
while (htlc_sig.1).1.is_none() { htlc_sig = htlc_sig_iter.next().unwrap(); }
45514552
assert_eq!((htlc_sig.0).0.transaction_output_index, Some($htlc_idx));
45524553

4554+
let our_signature = Signature::from_der(&hex::decode($our_htlc_sig_hex).unwrap()[..]).unwrap();
4555+
assert_eq!(Some(our_signature), *(htlc_sig.1).1);
45534556
assert_eq!(serialize(&localtx.get_signed_htlc_tx((htlc_sig.1).0, &(htlc_sig.1).1.unwrap(), &preimage, chan.their_to_self_delay))[..],
45544557
hex::decode($htlc_tx_hex).unwrap()[..]);
45554558
})*

0 commit comments

Comments
 (0)