Skip to content

Commit 2d7cabe

Browse files
committed
Fix unit tests.
1 parent a9ab616 commit 2d7cabe

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

lightning/src/ln/chan_utils.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1840,7 +1840,7 @@ mod tests {
18401840
use bitcoin::secp256k1::{PublicKey, SecretKey, Secp256k1};
18411841
use crate::util::test_utils;
18421842
use crate::sign::{ChannelSigner, SignerProvider};
1843-
use bitcoin::{Network, Txid, ScriptBuf};
1843+
use bitcoin::{Network, Txid, ScriptBuf, CompressedPublicKey};
18441844
use bitcoin::hashes::Hash;
18451845
use bitcoin::hashes::hex::FromHex;
18461846
use crate::ln::types::PaymentHash;
@@ -1916,7 +1916,7 @@ mod tests {
19161916
// Generate broadcaster and counterparty outputs
19171917
let tx = builder.build(1000, 2000);
19181918
assert_eq!(tx.built.transaction.output.len(), 2);
1919-
assert_eq!(tx.built.transaction.output[1].script_pubkey, BitcoinPublicKey::new(builder.counterparty_pubkeys.payment_point).p2wpkh_script_code().unwrap());
1919+
assert_eq!(tx.built.transaction.output[1].script_pubkey, bitcoin::address::Address::p2wpkh(&CompressedPublicKey(builder.counterparty_pubkeys.payment_point), Network::Testnet).script_pubkey());
19201920

19211921
// Generate broadcaster and counterparty outputs as well as two anchors
19221922
builder.channel_parameters.channel_type_features = ChannelTypeFeatures::anchors_zero_htlc_fee_and_dependencies();

lightning/src/offers/invoice.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2004,7 +2004,7 @@ mod tests {
20042004
.sign(payer_sign)
20052005
{
20062006
Ok(_) => panic!("expected error"),
2007-
Err(e) => assert_eq!(e, SignError::Verification(secp256k1::Error::InvalidSignature)),
2007+
Err(e) => assert_eq!(e, SignError::Verification(secp256k1::Error::IncorrectSignature)),
20082008
}
20092009
}
20102010

@@ -2415,7 +2415,8 @@ mod tests {
24152415
match Bolt12Invoice::try_from(buffer) {
24162416
Ok(_) => panic!("expected error"),
24172417
Err(e) => {
2418-
assert_eq!(e, Bolt12ParseError::InvalidSignature(secp256k1::Error::InvalidSignature));
2418+
// todo: ensure there is no serious underlying issue here
2419+
assert_eq!(e, Bolt12ParseError::InvalidSignature(secp256k1::Error::IncorrectSignature));
24192420
},
24202421
}
24212422
}

lightning/src/offers/invoice_request.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1850,7 +1850,7 @@ mod tests {
18501850
.sign(recipient_sign)
18511851
{
18521852
Ok(_) => panic!("expected error"),
1853-
Err(e) => assert_eq!(e, SignError::Verification(secp256k1::Error::InvalidSignature)),
1853+
Err(e) => assert_eq!(e, SignError::Verification(secp256k1::Error::IncorrectSignature)),
18541854
}
18551855
}
18561856

@@ -2237,7 +2237,7 @@ mod tests {
22372237
match InvoiceRequest::try_from(buffer) {
22382238
Ok(_) => panic!("expected error"),
22392239
Err(e) => {
2240-
assert_eq!(e, Bolt12ParseError::InvalidSignature(secp256k1::Error::InvalidSignature));
2240+
assert_eq!(e, Bolt12ParseError::InvalidSignature(secp256k1::Error::IncorrectSignature));
22412241
},
22422242
}
22432243
}

0 commit comments

Comments
 (0)