X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=lightning%2Fsrc%2Fonion_message%2Ffunctional_tests.rs;h=df13aa2cbec24e5068b7a3cdca31da609a3136aa;hb=efed905a4f90a3ca86b08cd6fb111e7c790ce20d;hp=a2f045c3691df5b534121a60c2495c4254a5b415;hpb=48fa2fd17295bcada25a3ee3f2c6f88d273484ac;p=rust-lightning diff --git a/lightning/src/onion_message/functional_tests.rs b/lightning/src/onion_message/functional_tests.rs index a2f045c3..df13aa2c 100644 --- a/lightning/src/onion_message/functional_tests.rs +++ b/lightning/src/onion_message/functional_tests.rs @@ -9,10 +9,11 @@ //! Onion message testing and test utilities live here. +use crate::blinded_path::BlindedPath; use crate::chain::keysinterface::{NodeSigner, Recipient}; use crate::ln::features::InitFeatures; use crate::ln::msgs::{self, DecodeError, OnionMessageHandler}; -use super::{BlindedPath, CustomOnionMessageContents, CustomOnionMessageHandler, Destination, OnionMessageContents, OnionMessenger, SendError}; +use super::{CustomOnionMessageContents, CustomOnionMessageHandler, Destination, OnionMessageContents, OnionMessenger, SendError}; use crate::util::ser::{Writeable, Writer}; use crate::util::test_utils; @@ -104,8 +105,8 @@ fn pass_along_path(path: &Vec, expected_path_id: Option<[u8; 32]> node.messenger.handle_onion_message(&prev_node.get_node_pk(), &onion_msg); if idx == num_nodes - 1 { node.logger.assert_log_contains( - "lightning::onion_message::messenger".to_string(), - format!("Received an onion message with path_id: {:02x?}", expected_path_id).to_string(), 1); + "lightning::onion_message::messenger", + &format!("Received an onion message with path_id: {:02x?}", expected_path_id), 1); } prev_node = node; } @@ -218,8 +219,8 @@ fn reply_path() { pass_along_path(&nodes, None); // Make sure the last node successfully decoded the reply path. nodes[3].logger.assert_log_contains( - "lightning::onion_message::messenger".to_string(), - format!("Received an onion message with path_id None and a reply_path").to_string(), 1); + "lightning::onion_message::messenger", + &format!("Received an onion message with path_id None and a reply_path"), 1); // Destination::BlindedPath let blinded_path = BlindedPath::new(&[nodes[1].get_node_pk(), nodes[2].get_node_pk(), nodes[3].get_node_pk()], &*nodes[3].keys_manager, &secp_ctx).unwrap(); @@ -228,8 +229,8 @@ fn reply_path() { nodes[0].messenger.send_onion_message(&[], Destination::BlindedPath(blinded_path), OnionMessageContents::Custom(test_msg), Some(reply_path)).unwrap(); pass_along_path(&nodes, None); nodes[3].logger.assert_log_contains( - "lightning::onion_message::messenger".to_string(), - format!("Received an onion message with path_id None and a reply_path").to_string(), 2); + "lightning::onion_message::messenger", + &format!("Received an onion message with path_id None and a reply_path"), 2); } #[test]