@@ -26,7 +26,7 @@ fn get_test_tuples() -> Vec<(String, SignedRawBolt11Invoice, bool, bool)> {
2626 InvoiceBuilder :: new( Currency :: Bitcoin )
2727 . duration_since_epoch( Duration :: from_secs( 1496314658 ) )
2828 . payment_secret( PaymentSecret ( [ 0x11 ; 32 ] ) )
29- . payment_hash( sha256:: Hash :: from_hex (
29+ . payment_hash( sha256:: Hash :: from_str (
3030 "0001020304050607080900010203040506070809000102030405060708090102"
3131 ) . unwrap( ) )
3232 . description( "Please consider supporting this project" . to_owned( ) )
@@ -47,7 +47,7 @@ fn get_test_tuples() -> Vec<(String, SignedRawBolt11Invoice, bool, bool)> {
4747 . amount_milli_satoshis( 250_000_000 )
4848 . duration_since_epoch( Duration :: from_secs( 1496314658 ) )
4949 . payment_secret( PaymentSecret ( [ 0x11 ; 32 ] ) )
50- . payment_hash( sha256:: Hash :: from_hex (
50+ . payment_hash( sha256:: Hash :: from_str (
5151 "0001020304050607080900010203040506070809000102030405060708090102"
5252 ) . unwrap( ) )
5353 . description( "1 cup coffee" . to_owned( ) )
@@ -69,7 +69,7 @@ fn get_test_tuples() -> Vec<(String, SignedRawBolt11Invoice, bool, bool)> {
6969 . amount_milli_satoshis( 250_000_000 )
7070 . duration_since_epoch( Duration :: from_secs( 1496314658 ) )
7171 . payment_secret( PaymentSecret ( [ 0x11 ; 32 ] ) )
72- . payment_hash( sha256:: Hash :: from_hex (
72+ . payment_hash( sha256:: Hash :: from_str (
7373 "0001020304050607080900010203040506070809000102030405060708090102"
7474 ) . unwrap( ) )
7575 . description( "ナンセンス 1杯" . to_owned( ) )
@@ -92,7 +92,7 @@ fn get_test_tuples() -> Vec<(String, SignedRawBolt11Invoice, bool, bool)> {
9292 . duration_since_epoch( Duration :: from_secs( 1496314658 ) )
9393 . description_hash( sha256:: Hash :: hash( b"One piece of chocolate cake, one icecream cone, one pickle, one slice of swiss cheese, one slice of salami, one lollypop, one piece of cherry pie, one sausage, one cupcake, and one slice of watermelon" ) )
9494 . payment_secret( PaymentSecret ( [ 0x11 ; 32 ] ) )
95- . payment_hash( sha256:: Hash :: from_hex (
95+ . payment_hash( sha256:: Hash :: from_str (
9696 "0001020304050607080900010203040506070809000102030405060708090102"
9797 ) . unwrap( ) )
9898 . build_raw( )
@@ -113,7 +113,7 @@ fn get_test_tuples() -> Vec<(String, SignedRawBolt11Invoice, bool, bool)> {
113113 . duration_since_epoch( Duration :: from_secs( 1496314658 ) )
114114 . description_hash( sha256:: Hash :: hash( b"One piece of chocolate cake, one icecream cone, one pickle, one slice of swiss cheese, one slice of salami, one lollypop, one piece of cherry pie, one sausage, one cupcake, and one slice of watermelon" ) )
115115 . payment_secret( PaymentSecret ( [ 0x11 ; 32 ] ) )
116- . payment_hash( sha256:: Hash :: from_hex (
116+ . payment_hash( sha256:: Hash :: from_str (
117117 "0001020304050607080900010203040506070809000102030405060708090102"
118118 ) . unwrap( ) )
119119 . fallback( Fallback :: PubKeyHash ( PubkeyHash :: from_slice( & [ 49 , 114 , 181 , 101 , 79 , 102 , 131 , 200 , 251 , 20 , 105 , 89 , 211 , 71 , 206 , 48 , 60 , 174 , 76 , 167 ] ) . unwrap( ) ) )
@@ -135,7 +135,7 @@ fn get_test_tuples() -> Vec<(String, SignedRawBolt11Invoice, bool, bool)> {
135135 . duration_since_epoch( Duration :: from_secs( 1496314658 ) )
136136 . description_hash( sha256:: Hash :: hash( b"One piece of chocolate cake, one icecream cone, one pickle, one slice of swiss cheese, one slice of salami, one lollypop, one piece of cherry pie, one sausage, one cupcake, and one slice of watermelon" ) )
137137 . payment_secret( PaymentSecret ( [ 0x11 ; 32 ] ) )
138- . payment_hash( sha256:: Hash :: from_hex (
138+ . payment_hash( sha256:: Hash :: from_str (
139139 "0001020304050607080900010203040506070809000102030405060708090102"
140140 ) . unwrap( ) )
141141 . fallback( Fallback :: PubKeyHash ( PubkeyHash :: from_slice( & [ 4 , 182 , 31 , 125 , 193 , 234 , 13 , 201 , 148 , 36 , 70 , 76 , 196 , 6 , 77 , 197 , 100 , 217 , 30 , 137 ] ) . unwrap( ) ) )
@@ -174,7 +174,7 @@ fn get_test_tuples() -> Vec<(String, SignedRawBolt11Invoice, bool, bool)> {
174174 . duration_since_epoch( Duration :: from_secs( 1496314658 ) )
175175 . description_hash( sha256:: Hash :: hash( b"One piece of chocolate cake, one icecream cone, one pickle, one slice of swiss cheese, one slice of salami, one lollypop, one piece of cherry pie, one sausage, one cupcake, and one slice of watermelon" ) )
176176 . payment_secret( PaymentSecret ( [ 0x11 ; 32 ] ) )
177- . payment_hash( sha256:: Hash :: from_hex (
177+ . payment_hash( sha256:: Hash :: from_str (
178178 "0001020304050607080900010203040506070809000102030405060708090102"
179179 ) . unwrap( ) )
180180 . fallback( Fallback :: ScriptHash ( ScriptHash :: from_slice( & [ 143 , 85 , 86 , 59 , 154 , 25 , 243 , 33 , 194 , 17 , 233 , 185 , 243 , 140 , 223 , 104 , 110 , 160 , 120 , 69 ] ) . unwrap( ) ) )
@@ -196,7 +196,7 @@ fn get_test_tuples() -> Vec<(String, SignedRawBolt11Invoice, bool, bool)> {
196196 . duration_since_epoch( Duration :: from_secs( 1496314658 ) )
197197 . description_hash( sha256:: Hash :: hash( b"One piece of chocolate cake, one icecream cone, one pickle, one slice of swiss cheese, one slice of salami, one lollypop, one piece of cherry pie, one sausage, one cupcake, and one slice of watermelon" ) )
198198 . payment_secret( PaymentSecret ( [ 0x11 ; 32 ] ) )
199- . payment_hash( sha256:: Hash :: from_hex (
199+ . payment_hash( sha256:: Hash :: from_str (
200200 "0001020304050607080900010203040506070809000102030405060708090102"
201201 ) . unwrap( ) )
202202 . fallback( Fallback :: SegWitProgram { version: WitnessVersion :: V0 ,
@@ -220,7 +220,7 @@ fn get_test_tuples() -> Vec<(String, SignedRawBolt11Invoice, bool, bool)> {
220220 . duration_since_epoch( Duration :: from_secs( 1496314658 ) )
221221 . description_hash( sha256:: Hash :: hash( b"One piece of chocolate cake, one icecream cone, one pickle, one slice of swiss cheese, one slice of salami, one lollypop, one piece of cherry pie, one sausage, one cupcake, and one slice of watermelon" ) )
222222 . payment_secret( PaymentSecret ( [ 0x11 ; 32 ] ) )
223- . payment_hash( sha256:: Hash :: from_hex (
223+ . payment_hash( sha256:: Hash :: from_str (
224224 "0001020304050607080900010203040506070809000102030405060708090102"
225225 ) . unwrap( ) )
226226 . fallback( Fallback :: SegWitProgram { version: WitnessVersion :: V0 ,
@@ -243,7 +243,7 @@ fn get_test_tuples() -> Vec<(String, SignedRawBolt11Invoice, bool, bool)> {
243243 . amount_milli_satoshis( 967878534 )
244244 . duration_since_epoch( Duration :: from_secs( 1572468703 ) )
245245 . payment_secret( PaymentSecret ( [ 0x11 ; 32 ] ) )
246- . payment_hash( sha256:: Hash :: from_hex (
246+ . payment_hash( sha256:: Hash :: from_str (
247247 "462264ede7e14047e9b249da94fefc47f41f7d02ee9b091815a5506bc8abf75f"
248248 ) . unwrap( ) )
249249 . expiry_time( Duration :: from_secs( 604800 ) )
@@ -275,7 +275,7 @@ fn get_test_tuples() -> Vec<(String, SignedRawBolt11Invoice, bool, bool)> {
275275 . amount_milli_satoshis( 2_500_000_000 )
276276 . duration_since_epoch( Duration :: from_secs( 1496314658 ) )
277277 . payment_secret( PaymentSecret ( [ 0x11 ; 32 ] ) )
278- . payment_hash( sha256:: Hash :: from_hex (
278+ . payment_hash( sha256:: Hash :: from_str (
279279 "0001020304050607080900010203040506070809000102030405060708090102"
280280 ) . unwrap( ) )
281281 . description( "coffee beans" . to_owned( ) )
@@ -296,7 +296,7 @@ fn get_test_tuples() -> Vec<(String, SignedRawBolt11Invoice, bool, bool)> {
296296 . amount_milli_satoshis( 2_500_000_000 )
297297 . duration_since_epoch( Duration :: from_secs( 1496314658 ) )
298298 . payment_secret( PaymentSecret ( [ 0x11 ; 32 ] ) )
299- . payment_hash( sha256:: Hash :: from_hex (
299+ . payment_hash( sha256:: Hash :: from_str (
300300 "0001020304050607080900010203040506070809000102030405060708090102"
301301 ) . unwrap( ) )
302302 . description( "coffee beans" . to_owned( ) )
@@ -317,7 +317,7 @@ fn get_test_tuples() -> Vec<(String, SignedRawBolt11Invoice, bool, bool)> {
317317 . amount_milli_satoshis( 2_500_000_000 )
318318 . duration_since_epoch( Duration :: from_secs( 1496314658 ) )
319319 . payment_secret( PaymentSecret ( [ 0x11 ; 32 ] ) )
320- . payment_hash( sha256:: Hash :: from_hex (
320+ . payment_hash( sha256:: Hash :: from_str (
321321 "0001020304050607080900010203040506070809000102030405060708090102"
322322 ) . unwrap( ) )
323323 . description( "coffee beans" . to_owned( ) )
@@ -337,7 +337,7 @@ fn get_test_tuples() -> Vec<(String, SignedRawBolt11Invoice, bool, bool)> {
337337 InvoiceBuilder :: new( Currency :: Bitcoin )
338338 . amount_milli_satoshis( 1_000_000_000 )
339339 . duration_since_epoch( Duration :: from_secs( 1496314658 ) )
340- . payment_hash( sha256:: Hash :: from_hex (
340+ . payment_hash( sha256:: Hash :: from_str (
341341 "0001020304050607080900010203040506070809000102030405060708090102"
342342 ) . unwrap( ) )
343343 . description( "payment metadata inside" . to_owned( ) )
@@ -363,7 +363,7 @@ fn get_test_tuples() -> Vec<(String, SignedRawBolt11Invoice, bool, bool)> {
363363 InvoiceBuilder :: new( Currency :: Bitcoin )
364364 . amount_milli_satoshis( 1_000_000_000 )
365365 . duration_since_epoch( Duration :: from_secs( 1496314658 ) )
366- . payment_hash( sha256:: Hash :: from_hex (
366+ . payment_hash( sha256:: Hash :: from_str (
367367 "0001020304050607080900010203040506070809000102030405060708090102"
368368 ) . unwrap( ) )
369369 . description( "payment metadata inside" . to_owned( ) )
0 commit comments