1 // This file is Copyright its original authors, visible in version control
4 // This file is licensed under the Apache License, Version 2.0 <LICENSE-APACHE
5 // or http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
6 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your option.
7 // You may not use this file except in accordance with one or both of these
10 // This file is auto-generated by gen_target.sh based on msg_target_template.txt
11 // To modify it, modify msg_target_template.txt and run gen_target.sh instead.
13 use crate::utils::test_logger;
14 use lightning::util::test_utils;
17 pub fn onion_hop_data_test<Out: test_logger::Output>(data: &[u8], _out: Out) {
18 use lightning::util::ser::ReadableArgs;
19 let mut r = ::std::io::Cursor::new(data);
20 let node_signer = test_utils::TestNodeSigner::new(test_utils::privkey(42));
21 let _ = <lightning::ln::msgs::InboundOnionPayload as ReadableArgs<&&test_utils::TestNodeSigner>>::read(&mut r, &&node_signer);
25 pub extern "C" fn onion_hop_data_run(data: *const u8, datalen: usize) {
26 use lightning::util::ser::ReadableArgs;
27 let data = unsafe { std::slice::from_raw_parts(data, datalen) };
28 let mut r = ::std::io::Cursor::new(data);
29 let node_signer = test_utils::TestNodeSigner::new(test_utils::privkey(42));
30 let _ = <lightning::ln::msgs::InboundOnionPayload as ReadableArgs<&&test_utils::TestNodeSigner>>::read(&mut r, &&node_signer);