@@ -6,7 +6,7 @@ use bitcoin_hashes::hex::FromHex;
6
6
use bitcoin_hashes:: sha256:: Sha256Hash ;
7
7
use lightning_invoice:: * ;
8
8
use secp256k1:: { Secp256k1 , RecoverableSignature , RecoveryId } ;
9
- use std:: time:: Duration ;
9
+ use std:: time:: { Duration , UNIX_EPOCH } ;
10
10
11
11
// TODO: add more of the examples from BOLT11 and generate ones causing SemanticErrors
12
12
@@ -17,7 +17,7 @@ fn get_test_tuples() -> Vec<(String, SignedRawInvoice, Option<SemanticError>)> {
17
17
wd5kgetjypeh2ursdae8g6twvus8g6rfwvs8qun0dfjkxaq8rkx3yf5tcsyz3d73gafnh3cax9rn449d9p5uxz9\
18
18
ezhhypd0elx87sjle52x86fux2ypatgddc6k63n7erqz25le42c4u4ecky03ylcqca784w". to_owned( ) ,
19
19
InvoiceBuilder :: new( Currency :: Bitcoin )
20
- . timestamp_raw ( 1496314658 )
20
+ . timestamp ( UNIX_EPOCH + Duration :: from_secs ( 1496314658 ) )
21
21
. payment_hash( Sha256Hash :: from_hex(
22
22
"0001020304050607080900010203040506070809000102030405060708090102"
23
23
) . unwrap( ) )
@@ -46,7 +46,7 @@ fn get_test_tuples() -> Vec<(String, SignedRawInvoice, Option<SemanticError>)> {
46
46
9zw97j25emudupq63nyw24cg27h2rspfj9srp". to_owned( ) ,
47
47
InvoiceBuilder :: new( Currency :: Bitcoin )
48
48
. amount_pico_btc( 2500000000 )
49
- . timestamp_raw ( 1496314658 )
49
+ . timestamp ( UNIX_EPOCH + Duration :: from_secs ( 1496314658 ) )
50
50
. payment_hash( Sha256Hash :: from_hex(
51
51
"0001020304050607080900010203040506070809000102030405060708090102"
52
52
) . unwrap( ) )
@@ -76,7 +76,7 @@ fn get_test_tuples() -> Vec<(String, SignedRawInvoice, Option<SemanticError>)> {
76
76
hhr8wpald05e92xw006sq94mg8v2ndf4sefvf9sygkshp5zfem29trqq2yxxz7". to_owned( ) ,
77
77
InvoiceBuilder :: new( Currency :: Bitcoin )
78
78
. amount_pico_btc( 20000000000 )
79
- . timestamp_raw ( 1496314658 )
79
+ . timestamp ( UNIX_EPOCH + Duration :: from_secs ( 1496314658 ) )
80
80
. payment_hash( Sha256Hash :: from_hex(
81
81
"0001020304050607080900010203040506070809000102030405060708090102"
82
82
) . unwrap( ) )
0 commit comments