File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,6 @@ use bitcoin::blockdata::constants::{genesis_block, ChainHash};
23
23
use bitcoin::network::constants::Network;
24
24
25
25
use bitcoin::hashes::Hash;
26
- use bitcoin::hashes::hex::ToHex;
27
26
use bitcoin::hashes::sha256::Hash as Sha256;
28
27
use bitcoin::hash_types::{BlockHash, Txid};
29
28
@@ -10364,6 +10363,16 @@ mod tests {
10364
10363
let events = nodes[0].node.get_and_clear_pending_msg_events();
10365
10364
assert_eq!(events.len(), 0);
10366
10365
}
10366
+
10367
+ #[test]
10368
+ fn test_payment_display() {
10369
+ let payment_id = PaymentId([42; 32]);
10370
+ assert_eq!(format!("{}", &payment_id), "2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a");
10371
+ let payment_hash = PaymentHash([42; 32]);
10372
+ assert_eq!(format!("{}", &payment_hash), "2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a");
10373
+ let payment_preimage = PaymentPreimage([42; 32]);
10374
+ assert_eq!(format!("{}", &payment_preimage), "2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a");
10375
+ }
10367
10376
}
10368
10377
10369
10378
#[cfg(ldk_bench)]
Original file line number Diff line number Diff line change @@ -3418,6 +3418,12 @@ pub(crate) mod tests {
3418
3418
// This serialized info has an address field but no announcement_message, therefore the addresses returned by our function will still be empty
3419
3419
assert ! ( ann_info_with_addresses. addresses( ) . is_empty( ) ) ;
3420
3420
}
3421
+
3422
+ #[ test]
3423
+ fn test_node_id_display ( ) {
3424
+ let node_id = NodeId ( [ 42 ; 33 ] ) ;
3425
+ assert_eq ! ( format!( "{}" , & node_id) , "2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a" ) ;
3426
+ }
3421
3427
}
3422
3428
3423
3429
#[ cfg( ldk_bench) ]
You can’t perform that action at this time.
0 commit comments