From 28cc71f9801abd709fdd1481b5fefe748f0e358e Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Wed, 15 Mar 2023 19:19:49 +0000 Subject: [PATCH] Fix onion_message functional_tests `no-std` build --- lightning/src/onion_message/functional_tests.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lightning/src/onion_message/functional_tests.rs b/lightning/src/onion_message/functional_tests.rs index aee7f562d..a2f045c36 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 {})) } -- 2.39.5