@@ -23,7 +23,7 @@ use num_traits::{CheckedAdd, CheckedMul};
23
23
use secp256k1:: ecdsa:: { RecoveryId , RecoverableSignature } ;
24
24
use secp256k1:: PublicKey ;
25
25
26
- use super :: { Bolt11Invoice , Sha256 , TaggedField , ExpiryTime , MinFinalCltvExpiryDelta , Fallback , PayeePubKey , InvoiceSignature , PositiveTimestamp ,
26
+ use super :: { Bolt11Invoice , Sha256 , TaggedField , ExpiryTime , MinFinalCltvExpiryDelta , Fallback , PayeePubKey , Bolt11InvoiceSignature , PositiveTimestamp ,
27
27
Bolt11SemanticError , PrivateRoute , Bolt11ParseError , ParseOrSemanticError , Description , RawTaggedField , Currency , RawHrp , SiPrefix , RawBolt11Invoice ,
28
28
constants, SignedRawBolt11Invoice , RawDataPart , Bolt11InvoiceFeatures } ;
29
29
@@ -292,7 +292,7 @@ impl FromStr for SignedRawBolt11Invoice {
292
292
hrp. as_bytes ( ) ,
293
293
& data[ ..data. len ( ) -104 ]
294
294
) ,
295
- signature : InvoiceSignature :: from_base32 ( & data[ data. len ( ) -104 ..] ) ?,
295
+ signature : Bolt11InvoiceSignature :: from_base32 ( & data[ data. len ( ) -104 ..] ) ?,
296
296
} )
297
297
}
298
298
}
@@ -365,17 +365,17 @@ impl FromBase32 for PositiveTimestamp {
365
365
}
366
366
}
367
367
368
- impl FromBase32 for InvoiceSignature {
368
+ impl FromBase32 for Bolt11InvoiceSignature {
369
369
type Err = Bolt11ParseError ;
370
370
fn from_base32 ( signature : & [ u5 ] ) -> Result < Self , Self :: Err > {
371
371
if signature. len ( ) != 104 {
372
- return Err ( Bolt11ParseError :: InvalidSliceLength ( "InvoiceSignature ::from_base32()" . into ( ) ) ) ;
372
+ return Err ( Bolt11ParseError :: InvalidSliceLength ( "Bolt11InvoiceSignature ::from_base32()" . into ( ) ) ) ;
373
373
}
374
374
let recoverable_signature_bytes = Vec :: < u8 > :: from_base32 ( signature) ?;
375
375
let signature = & recoverable_signature_bytes[ 0 ..64 ] ;
376
376
let recovery_id = RecoveryId :: from_i32 ( recoverable_signature_bytes[ 64 ] as i32 ) ?;
377
377
378
- Ok ( InvoiceSignature ( RecoverableSignature :: from_compact (
378
+ Ok ( Bolt11InvoiceSignature ( RecoverableSignature :: from_compact (
379
379
signature,
380
380
recovery_id
381
381
) ?) )
@@ -972,7 +972,7 @@ mod test {
972
972
use lightning:: ln:: features:: Bolt11InvoiceFeatures ;
973
973
use secp256k1:: ecdsa:: { RecoveryId , RecoverableSignature } ;
974
974
use crate :: TaggedField :: * ;
975
- use crate :: { SiPrefix , SignedRawBolt11Invoice , InvoiceSignature , RawBolt11Invoice , RawHrp , RawDataPart ,
975
+ use crate :: { SiPrefix , SignedRawBolt11Invoice , Bolt11InvoiceSignature , RawBolt11Invoice , RawHrp , RawDataPart ,
976
976
Currency , Sha256 , PositiveTimestamp } ;
977
977
978
978
// Feature bits 9, 15, and 99 are set.
@@ -998,7 +998,7 @@ mod test {
998
998
hash : [ 0xb1 , 0x96 , 0x46 , 0xc3 , 0xbc , 0x56 , 0x76 , 0x1d , 0x20 , 0x65 , 0x6e , 0x0e , 0x32 ,
999
999
0xec , 0xd2 , 0x69 , 0x27 , 0xb7 , 0x62 , 0x6e , 0x2a , 0x8b , 0xe6 , 0x97 , 0x71 , 0x9f ,
1000
1000
0xf8 , 0x7e , 0x44 , 0x54 , 0x55 , 0xb9 ] ,
1001
- signature : InvoiceSignature ( RecoverableSignature :: from_compact (
1001
+ signature : Bolt11InvoiceSignature ( RecoverableSignature :: from_compact (
1002
1002
& [ 0xd7 , 0x90 , 0x4c , 0xc4 , 0xb7 , 0x4a , 0x22 , 0x26 , 0x9c , 0x68 , 0xc1 , 0xdf , 0x68 ,
1003
1003
0xa9 , 0x6c , 0x21 , 0x4d , 0x65 , 0x1b , 0x93 , 0x76 , 0xe9 , 0xf1 , 0x64 , 0xd3 , 0x60 ,
1004
1004
0x4d , 0xa4 , 0xb7 , 0xde , 0xcc , 0xce , 0x0e , 0x82 , 0xaa , 0xab , 0x4c , 0x85 , 0xd3 ,
@@ -1018,7 +1018,7 @@ mod test {
1018
1018
fn test_raw_signed_invoice_deserialization ( ) {
1019
1019
use crate :: TaggedField :: * ;
1020
1020
use secp256k1:: ecdsa:: { RecoveryId , RecoverableSignature } ;
1021
- use crate :: { SignedRawBolt11Invoice , InvoiceSignature , RawBolt11Invoice , RawHrp , RawDataPart , Currency , Sha256 ,
1021
+ use crate :: { SignedRawBolt11Invoice , Bolt11InvoiceSignature , RawBolt11Invoice , RawHrp , RawDataPart , Currency , Sha256 ,
1022
1022
PositiveTimestamp } ;
1023
1023
1024
1024
assert_eq ! (
@@ -1051,7 +1051,7 @@ mod test {
1051
1051
0x7b , 0x1d , 0x85 , 0x8d , 0xb1 , 0xd1 , 0xf7 , 0xab , 0x71 , 0x37 , 0xdc , 0xb7 ,
1052
1052
0x83 , 0x5d , 0xb2 , 0xec , 0xd5 , 0x18 , 0xe1 , 0xc9
1053
1053
] ,
1054
- signature: InvoiceSignature ( RecoverableSignature :: from_compact(
1054
+ signature: Bolt11InvoiceSignature ( RecoverableSignature :: from_compact(
1055
1055
& [
1056
1056
0x38u8 , 0xec , 0x68 , 0x91 , 0x34 , 0x5e , 0x20 , 0x41 , 0x45 , 0xbe , 0x8a ,
1057
1057
0x3a , 0x99 , 0xde , 0x38 , 0xe9 , 0x8a , 0x39 , 0xd6 , 0xa5 , 0x69 , 0x43 ,
0 commit comments