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};
2323use bitcoin::network::constants::Network;
2424
2525use bitcoin::hashes::Hash;
26- use bitcoin::hashes::hex::ToHex;
2726use bitcoin::hashes::sha256::Hash as Sha256;
2827use bitcoin::hash_types::{BlockHash, Txid};
2928
@@ -10364,6 +10363,16 @@ mod tests {
1036410363 let events = nodes[0].node.get_and_clear_pending_msg_events();
1036510364 assert_eq!(events.len(), 0);
1036610365 }
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+ }
1036710376}
1036810377
1036910378#[cfg(ldk_bench)]
Original file line number Diff line number Diff line change @@ -3418,6 +3418,12 @@ pub(crate) mod tests {
34183418 // This serialized info has an address field but no announcement_message, therefore the addresses returned by our function will still be empty
34193419 assert ! ( ann_info_with_addresses. addresses( ) . is_empty( ) ) ;
34203420 }
3421+
3422+ #[ test]
3423+ fn test_node_id_display ( ) {
3424+ let node_id = NodeId ( [ 42 ; 33 ] ) ;
3425+ assert_eq ! ( format!( "{}" , & node_id) , "2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a" ) ;
3426+ }
34213427}
34223428
34233429#[ cfg( ldk_bench) ]
You can’t perform that action at this time.
0 commit comments