From: Matt Corallo Date: Wed, 15 Mar 2023 19:19:49 +0000 (+0000) Subject: Fix onion_message functional_tests `no-std` build X-Git-Tag: v0.0.115~62^2~1 X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=28cc71f9801abd709fdd1481b5fefe748f0e358e;p=rust-lightning Fix onion_message functional_tests `no-std` build --- diff --git a/lightning/src/onion_message/functional_tests.rs b/lightning/src/onion_message/functional_tests.rs index aee7f562..a2f045c3 100644 --- a/lightning/src/onion_message/functional_tests.rs +++ b/lightning/src/onion_message/functional_tests.rs @@ -20,6 +20,7 @@ use bitcoin::network::constants::Network; use bitcoin::secp256k1::{PublicKey, Secp256k1}; use crate::io; +use crate::io_extras::read_to_end; use crate::sync::Arc; struct MessengerNode { @@ -59,8 +60,7 @@ impl CustomOnionMessageHandler for TestCustomMessageHandler { fn handle_custom_message(&self, _msg: Self::CustomMessage) {} fn read_custom_message(&self, message_type: u64, buffer: &mut R) -> Result, DecodeError> where Self: Sized { if message_type == CUSTOM_MESSAGE_TYPE { - let mut buf = Vec::new(); - buffer.read_to_end(&mut buf)?; + let buf = read_to_end(buffer)?; assert_eq!(buf, CUSTOM_MESSAGE_CONTENTS); return Ok(Some(TestCustomMessage {})) }