Skip to content

Commit fe1be69

Browse files
authored
Merge pull request #1810 from TheBlueMatt/2022-10-112-bindings-base
0.0.112 Bindings Branch
2 parents 42ab358 + 83af710 commit fe1be69

File tree

14 files changed

+118
-124
lines changed

14 files changed

+118
-124
lines changed

fuzz/src/onion_message.rs

+8-10
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@ use lightning::ln::msgs::{self, DecodeError, OnionMessageHandler};
1010
use lightning::ln::script::ShutdownScript;
1111
use lightning::util::enforcing_trait_impls::EnforcingSigner;
1212
use lightning::util::logger::Logger;
13-
use lightning::util::ser::{MaybeReadableArgs, Readable, Writeable, Writer};
14-
use lightning::onion_message::{CustomOnionMessageContents, CustomOnionMessageHandler, OnionMessenger};
13+
use lightning::util::ser::{Readable, Writeable, Writer};
14+
use lightning::onion_message::packet::CustomOnionMessageContents;
15+
use lightning::onion_message::messenger::{OnionMessenger, CustomOnionMessageHandler};
1516

1617
use crate::utils::test_logger;
1718

@@ -67,19 +68,16 @@ impl Writeable for TestCustomMessage {
6768
}
6869
}
6970

70-
impl MaybeReadableArgs<u64> for TestCustomMessage {
71-
fn read<R: io::Read>(buffer: &mut R, _message_type: u64,) -> Result<Option<Self>, DecodeError> where Self: Sized {
72-
let mut buf = Vec::new();
73-
buffer.read_to_end(&mut buf)?;
74-
return Ok(Some(TestCustomMessage {}))
75-
}
76-
}
77-
7871
struct TestCustomMessageHandler {}
7972

8073
impl CustomOnionMessageHandler for TestCustomMessageHandler {
8174
type CustomMessage = TestCustomMessage;
8275
fn handle_custom_message(&self, _msg: Self::CustomMessage) {}
76+
fn read_custom_message<R: io::Read>(&self, _message_type: u64, buffer: &mut R) -> Result<Option<Self::CustomMessage>, msgs::DecodeError> {
77+
let mut buf = Vec::new();
78+
buffer.read_to_end(&mut buf)?;
79+
return Ok(Some(TestCustomMessage {}))
80+
}
8381
}
8482

8583
pub struct VecWriter(pub Vec<u8>);

lightning-rapid-gossip-sync/src/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,10 @@ use lightning::io;
7979
use lightning::routing::gossip::NetworkGraph;
8080
use lightning::util::logger::Logger;
8181

82-
pub use crate::error::GraphSyncError;
82+
use crate::error::GraphSyncError;
8383

8484
/// Error types that these functions can return
85-
mod error;
85+
pub mod error;
8686

8787
/// Core functionality of this crate
8888
mod processing;

lightning/src/ln/chan_utils.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -737,7 +737,7 @@ pub(crate) fn get_anchor_output<'a>(commitment_tx: &'a Transaction, funding_pubk
737737
}
738738

739739
/// Returns the witness required to satisfy and spend an anchor input.
740-
pub fn build_anchor_input_witness(funding_key: &PublicKey, funding_sig: &Signature) -> Witness {
740+
pub(crate) fn build_anchor_input_witness(funding_key: &PublicKey, funding_sig: &Signature) -> Witness {
741741
let anchor_redeem_script = chan_utils::get_anchor_redeemscript(funding_key);
742742
let mut funding_sig = funding_sig.serialize_der().to_vec();
743743
funding_sig.push(EcdsaSighashType::All as u8);

lightning/src/ln/msgs.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ pub struct UpdateAddHTLC {
310310
pub struct OnionMessage {
311311
/// Used in decrypting the onion packet's payload.
312312
pub blinding_point: PublicKey,
313-
pub(crate) onion_routing_packet: onion_message::Packet,
313+
pub(crate) onion_routing_packet: onion_message::packet::Packet,
314314
}
315315

316316
/// An update_fulfill_htlc message to be sent or received from a peer
@@ -1422,7 +1422,7 @@ impl Readable for OnionMessage {
14221422
let blinding_point: PublicKey = Readable::read(r)?;
14231423
let len: u16 = Readable::read(r)?;
14241424
let mut packet_reader = FixedLengthReader::new(r, len as u64);
1425-
let onion_routing_packet: onion_message::Packet = <onion_message::Packet as LengthReadable>::read(&mut packet_reader)?;
1425+
let onion_routing_packet = <onion_message::packet::Packet as LengthReadable>::read(&mut packet_reader)?;
14261426
Ok(Self {
14271427
blinding_point,
14281428
onion_routing_packet,

lightning/src/ln/onion_utils.rs

+9-30
Original file line numberDiff line numberDiff line change
@@ -589,31 +589,6 @@ pub(super) fn process_onion_failure<T: secp256k1::Signing, L: Deref>(secp_ctx: &
589589
} else { unreachable!(); }
590590
}
591591

592-
/// An input used when decoding an onion packet.
593-
pub(crate) trait DecodeInput {
594-
type Arg;
595-
/// If Some, this is the input when checking the hmac of the onion packet.
596-
fn payment_hash(&self) -> Option<&PaymentHash>;
597-
/// Read argument when decrypting our hop payload.
598-
fn read_arg(self) -> Self::Arg;
599-
}
600-
601-
impl DecodeInput for PaymentHash {
602-
type Arg = ();
603-
fn payment_hash(&self) -> Option<&PaymentHash> {
604-
Some(self)
605-
}
606-
fn read_arg(self) -> Self::Arg { () }
607-
}
608-
609-
impl DecodeInput for SharedSecret {
610-
type Arg = SharedSecret;
611-
fn payment_hash(&self) -> Option<&PaymentHash> {
612-
None
613-
}
614-
fn read_arg(self) -> Self::Arg { self }
615-
}
616-
617592
/// Allows `decode_next_hop` to return the next hop packet bytes for either payments or onion
618593
/// message forwards.
619594
pub(crate) trait NextPacketBytes: AsMut<[u8]> {
@@ -664,7 +639,7 @@ pub(crate) enum OnionDecodeErr {
664639
}
665640

666641
pub(crate) fn decode_next_payment_hop(shared_secret: [u8; 32], hop_data: &[u8], hmac_bytes: [u8; 32], payment_hash: PaymentHash) -> Result<Hop, OnionDecodeErr> {
667-
match decode_next_hop(shared_secret, hop_data, hmac_bytes, payment_hash) {
642+
match decode_next_hop(shared_secret, hop_data, hmac_bytes, Some(payment_hash), ()) {
668643
Ok((next_hop_data, None)) => Ok(Hop::Receive(next_hop_data)),
669644
Ok((next_hop_data, Some((next_hop_hmac, FixedSizeOnionPacket(new_packet_bytes))))) => {
670645
Ok(Hop::Forward {
@@ -677,12 +652,16 @@ pub(crate) fn decode_next_payment_hop(shared_secret: [u8; 32], hop_data: &[u8],
677652
}
678653
}
679654

680-
pub(crate) fn decode_next_hop<D: DecodeInput, R: ReadableArgs<D::Arg>, N: NextPacketBytes>(shared_secret: [u8; 32], hop_data: &[u8], hmac_bytes: [u8; 32], decode_input: D) -> Result<(R, Option<([u8; 32], N)>), OnionDecodeErr> {
655+
pub(crate) fn decode_next_untagged_hop<T, R: ReadableArgs<T>, N: NextPacketBytes>(shared_secret: [u8; 32], hop_data: &[u8], hmac_bytes: [u8; 32], read_args: T) -> Result<(R, Option<([u8; 32], N)>), OnionDecodeErr> {
656+
decode_next_hop(shared_secret, hop_data, hmac_bytes, None, read_args)
657+
}
658+
659+
fn decode_next_hop<T, R: ReadableArgs<T>, N: NextPacketBytes>(shared_secret: [u8; 32], hop_data: &[u8], hmac_bytes: [u8; 32], payment_hash: Option<PaymentHash>, read_args: T) -> Result<(R, Option<([u8; 32], N)>), OnionDecodeErr> {
681660
let (rho, mu) = gen_rho_mu_from_shared_secret(&shared_secret);
682661
let mut hmac = HmacEngine::<Sha256>::new(&mu);
683662
hmac.input(hop_data);
684-
if let Some(payment_hash) = decode_input.payment_hash() {
685-
hmac.input(&payment_hash.0[..]);
663+
if let Some(tag) = payment_hash {
664+
hmac.input(&tag.0[..]);
686665
}
687666
if !fixed_time_eq(&Hmac::from_engine(hmac).into_inner(), &hmac_bytes) {
688667
return Err(OnionDecodeErr::Malformed {
@@ -693,7 +672,7 @@ pub(crate) fn decode_next_hop<D: DecodeInput, R: ReadableArgs<D::Arg>, N: NextPa
693672

694673
let mut chacha = ChaCha20::new(&rho, &[0u8; 8]);
695674
let mut chacha_stream = ChaChaReader { chacha: &mut chacha, read: Cursor::new(&hop_data[..]) };
696-
match R::read(&mut chacha_stream, decode_input.read_arg()) {
675+
match R::read(&mut chacha_stream, read_args) {
697676
Err(err) => {
698677
let error_code = match err {
699678
msgs::DecodeError::UnknownVersion => 0x4000 | 1, // unknown realm byte

lightning/src/ln/peer_handler.rs

+5-6
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,12 @@ use crate::ln::features::{InitFeatures, NodeFeatures};
2121
use crate::ln::msgs;
2222
use crate::ln::msgs::{ChannelMessageHandler, LightningError, NetAddress, OnionMessageHandler, RoutingMessageHandler};
2323
use crate::ln::channelmanager::{SimpleArcChannelManager, SimpleRefChannelManager};
24-
use crate::util::ser::{MaybeReadableArgs, VecWriter, Writeable, Writer};
24+
use crate::util::ser::{VecWriter, Writeable, Writer};
2525
use crate::ln::peer_channel_encryptor::{PeerChannelEncryptor,NextNoiseStep};
2626
use crate::ln::wire;
2727
use crate::ln::wire::Encode;
28-
use crate::onion_message::{CustomOnionMessageContents, CustomOnionMessageHandler, SimpleArcOnionMessenger, SimpleRefOnionMessenger};
28+
use crate::onion_message::messenger::{CustomOnionMessageHandler, SimpleArcOnionMessenger, SimpleRefOnionMessenger};
29+
use crate::onion_message::packet::CustomOnionMessageContents;
2930
use crate::routing::gossip::{NetworkGraph, P2PGossipSync};
3031
use crate::util::atomic_counter::AtomicCounter;
3132
use crate::util::crypto::sign;
@@ -97,13 +98,11 @@ impl OnionMessageHandler for IgnoringMessageHandler {
9798
}
9899
impl CustomOnionMessageHandler for IgnoringMessageHandler {
99100
type CustomMessage = Infallible;
100-
fn handle_custom_message(&self, _msg: Self::CustomMessage) {
101+
fn handle_custom_message(&self, _msg: Infallible) {
101102
// Since we always return `None` in the read the handle method should never be called.
102103
unreachable!();
103104
}
104-
}
105-
impl MaybeReadableArgs<u64> for Infallible {
106-
fn read<R: io::Read>(_buffer: &mut R, _msg_type: u64) -> Result<Option<Self>, msgs::DecodeError> where Self: Sized {
105+
fn read_custom_message<R: io::Read>(&self, _msg_type: u64, _buffer: &mut R) -> Result<Option<Infallible>, msgs::DecodeError> where Self: Sized {
107106
Ok(None)
108107
}
109108
}

lightning/src/onion_message/functional_tests.rs

+10-17
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,11 @@
1212
use crate::chain::keysinterface::{KeysInterface, Recipient};
1313
use crate::ln::features::InitFeatures;
1414
use crate::ln::msgs::{self, DecodeError, OnionMessageHandler};
15-
use super::{BlindedRoute, CustomOnionMessageContents, CustomOnionMessageHandler, Destination, OnionMessageContents, OnionMessenger, SendError};
15+
use super::blinded_route::BlindedRoute;
16+
use super::messenger::{CustomOnionMessageHandler, Destination, OnionMessenger, SendError};
17+
use super::packet::{CustomOnionMessageContents, OnionMessageContents};
1618
use crate::util::enforcing_trait_impls::EnforcingSigner;
17-
use crate::util::ser::{MaybeReadableArgs, Writeable, Writer};
19+
use crate::util::ser::{ Writeable, Writer};
1820
use crate::util::test_utils;
1921

2022
use bitcoin::network::constants::Network;
@@ -54,8 +56,12 @@ impl Writeable for TestCustomMessage {
5456
}
5557
}
5658

57-
impl MaybeReadableArgs<u64> for TestCustomMessage {
58-
fn read<R: io::Read>(buffer: &mut R, message_type: u64) -> Result<Option<Self>, DecodeError> where Self: Sized {
59+
struct TestCustomMessageHandler {}
60+
61+
impl CustomOnionMessageHandler for TestCustomMessageHandler {
62+
type CustomMessage = TestCustomMessage;
63+
fn handle_custom_message(&self, _msg: Self::CustomMessage) {}
64+
fn read_custom_message<R: io::Read>(&self, message_type: u64, buffer: &mut R) -> Result<Option<Self::CustomMessage>, DecodeError> where Self: Sized {
5965
if message_type == CUSTOM_MESSAGE_TYPE {
6066
let mut buf = Vec::new();
6167
buffer.read_to_end(&mut buf)?;
@@ -66,13 +72,6 @@ impl MaybeReadableArgs<u64> for TestCustomMessage {
6672
}
6773
}
6874

69-
struct TestCustomMessageHandler {}
70-
71-
impl CustomOnionMessageHandler for TestCustomMessageHandler {
72-
type CustomMessage = TestCustomMessage;
73-
fn handle_custom_message(&self, _msg: Self::CustomMessage) {}
74-
}
75-
7675
fn create_nodes(num_messengers: u8) -> Vec<MessengerNode> {
7776
let mut nodes = Vec::new();
7877
for i in 0..num_messengers {
@@ -233,12 +232,6 @@ fn invalid_custom_message_type() {
233232
fn write<W: Writer>(&self, _w: &mut W) -> Result<(), io::Error> { unreachable!() }
234233
}
235234

236-
impl MaybeReadableArgs<u64> for InvalidCustomMessage {
237-
fn read<R: io::Read>(_buffer: &mut R, _message_type: u64) -> Result<Option<Self>, DecodeError> where Self: Sized {
238-
unreachable!()
239-
}
240-
}
241-
242235
let test_msg = OnionMessageContents::Custom(InvalidCustomMessage {});
243236
let err = nodes[0].messenger.send_onion_message(&[], Destination::Node(nodes[1].get_node_pk()), test_msg, None).unwrap_err();
244237
assert_eq!(err, SendError::InvalidMessage);

lightning/src/onion_message/messenger.rs

+24-21
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,15 @@ use crate::ln::msgs::{self, OnionMessageHandler};
2121
use crate::ln::onion_utils;
2222
use crate::ln::peer_handler::IgnoringMessageHandler;
2323
use super::blinded_route::{BlindedRoute, ForwardTlvs, ReceiveTlvs};
24-
pub use super::packet::{CustomOnionMessageContents, OnionMessageContents};
24+
use super::packet::{CustomOnionMessageContents, OnionMessageContents};
2525
use super::packet::{BIG_PACKET_HOP_DATA_LEN, ForwardControlTlvs, Packet, Payload, ReceiveControlTlvs, SMALL_PACKET_HOP_DATA_LEN};
2626
use super::utils;
2727
use crate::util::events::OnionMessageProvider;
2828
use crate::util::logger::Logger;
2929
use crate::util::ser::Writeable;
3030

3131
use core::ops::Deref;
32+
use crate::io;
3233
use crate::sync::{Arc, Mutex};
3334
use crate::prelude::*;
3435

@@ -45,9 +46,11 @@ use crate::prelude::*;
4546
/// # use lightning::chain::keysinterface::{InMemorySigner, KeysManager, KeysInterface};
4647
/// # use lightning::ln::msgs::DecodeError;
4748
/// # use lightning::ln::peer_handler::IgnoringMessageHandler;
48-
/// # use lightning::onion_message::{BlindedRoute, CustomOnionMessageContents, Destination, OnionMessageContents, OnionMessenger};
49+
/// # use lightning::onion_message::messenger::{Destination, OnionMessenger};
50+
/// # use lightning::onion_message::packet::CustomOnionMessageContents;
51+
/// # use lightning::onion_message::blinded_route::BlindedRoute;
4952
/// # use lightning::util::logger::{Logger, Record};
50-
/// # use lightning::util::ser::{MaybeReadableArgs, Writeable, Writer};
53+
/// # use lightning::util::ser::{Writeable, Writer};
5154
/// # use lightning::io;
5255
/// # use std::sync::Arc;
5356
/// # struct FakeLogger {};
@@ -81,19 +84,11 @@ use crate::prelude::*;
8184
/// your_custom_message_type
8285
/// }
8386
/// }
84-
/// impl MaybeReadableArgs<u64> for YourCustomMessage {
85-
/// fn read<R: io::Read>(r: &mut R, message_type: u64) -> Result<Option<Self>, DecodeError> {
86-
/// # unreachable!()
87-
/// // Read your custom onion message of type `message_type` from `r`, or return `None`
88-
/// // if the message type is unknown
89-
/// }
90-
/// }
9187
/// // Send a custom onion message to a node id.
9288
/// let intermediate_hops = [hop_node_id1, hop_node_id2];
9389
/// let reply_path = None;
9490
/// # let your_custom_message = YourCustomMessage {};
95-
/// let message = OnionMessageContents::Custom(your_custom_message);
96-
/// onion_messenger.send_onion_message(&intermediate_hops, Destination::Node(destination_node_id), message, reply_path);
91+
/// onion_messenger.send_custom_onion_message(&intermediate_hops, Destination::Node(destination_node_id), your_custom_message, reply_path);
9792
///
9893
/// // Create a blinded route to yourself, for someone to send an onion message to.
9994
/// # let your_node_id = hop_node_id1;
@@ -104,8 +99,7 @@ use crate::prelude::*;
10499
/// # let intermediate_hops = [hop_node_id1, hop_node_id2];
105100
/// let reply_path = None;
106101
/// # let your_custom_message = YourCustomMessage {};
107-
/// let message = OnionMessageContents::Custom(your_custom_message);
108-
/// onion_messenger.send_onion_message(&intermediate_hops, Destination::BlindedRoute(blinded_route), message, reply_path);
102+
/// onion_messenger.send_custom_onion_message(&intermediate_hops, Destination::BlindedRoute(blinded_route), your_custom_message, reply_path);
109103
/// ```
110104
///
111105
/// [offers]: <https://github.com/lightning/bolts/pull/798>
@@ -143,7 +137,7 @@ impl Destination {
143137

144138
/// Errors that may occur when [sending an onion message].
145139
///
146-
/// [sending an onion message]: OnionMessenger::send_onion_message
140+
/// [sending an onion message]: OnionMessenger::send_custom_onion_message
147141
#[derive(Debug, PartialEq, Eq)]
148142
pub enum SendError {
149143
/// Errored computing onion message packet keys.
@@ -178,6 +172,9 @@ pub trait CustomOnionMessageHandler {
178172
type CustomMessage: CustomOnionMessageContents;
179173
/// Called with the custom message that was received.
180174
fn handle_custom_message(&self, msg: Self::CustomMessage);
175+
/// Read a custom message of type `message_type` from `buffer`, returning `Ok(None)` if the
176+
/// message type is unknown.
177+
fn read_custom_message<R: io::Read>(&self, message_type: u64, buffer: &mut R) -> Result<Option<Self::CustomMessage>, msgs::DecodeError>;
181178
}
182179

183180
impl<Signer: Sign, K: Deref, L: Deref, CMH: Deref> OnionMessenger<Signer, K, L, CMH>
@@ -201,13 +198,19 @@ impl<Signer: Sign, K: Deref, L: Deref, CMH: Deref> OnionMessenger<Signer, K, L,
201198

202199
/// Send an onion message with contents `message` to `destination`, routing it through `intermediate_nodes`.
203200
/// See [`OnionMessenger`] for example usage.
204-
pub fn send_onion_message<T: CustomOnionMessageContents>(&self, intermediate_nodes: &[PublicKey], destination: Destination, message: OnionMessageContents<T>, reply_path: Option<BlindedRoute>) -> Result<(), SendError> {
201+
pub(crate) fn send_onion_message<T: CustomOnionMessageContents>(&self, intermediate_nodes: &[PublicKey], destination: Destination, msg: OnionMessageContents<T>, reply_path: Option<BlindedRoute>) -> Result<(), SendError> {
202+
let OnionMessageContents::Custom(message) = msg;
203+
self.send_custom_onion_message(intermediate_nodes, destination, message, reply_path)
204+
}
205+
206+
/// Send an onion message with contents `message` to `destination`, routing it through `intermediate_nodes`.
207+
/// See [`OnionMessenger`] for example usage.
208+
pub fn send_custom_onion_message<T: CustomOnionMessageContents>(&self, intermediate_nodes: &[PublicKey], destination: Destination, msg: T, reply_path: Option<BlindedRoute>) -> Result<(), SendError> {
205209
if let Destination::BlindedRoute(BlindedRoute { ref blinded_hops, .. }) = destination {
206210
if blinded_hops.len() < 2 {
207211
return Err(SendError::TooFewBlindedHops);
208212
}
209213
}
210-
let OnionMessageContents::Custom(ref msg) = message;
211214
if msg.tlv_type() < 64 { return Err(SendError::InvalidMessage) }
212215

213216
let blinding_secret_bytes = self.keys_manager.get_secure_random_bytes();
@@ -222,7 +225,7 @@ impl<Signer: Sign, K: Deref, L: Deref, CMH: Deref> OnionMessenger<Signer, K, L,
222225
}
223226
};
224227
let (packet_payloads, packet_keys) = packet_payloads_and_keys(
225-
&self.secp_ctx, intermediate_nodes, destination, message, reply_path, &blinding_secret)
228+
&self.secp_ctx, intermediate_nodes, destination, OnionMessageContents::Custom(msg), reply_path, &blinding_secret)
226229
.map_err(|e| SendError::Secp256k1(e))?;
227230

228231
let prng_seed = self.keys_manager.get_secure_random_bytes();
@@ -279,7 +282,7 @@ fn outbound_buffer_full(peer_node_id: &PublicKey, buffer: &HashMap<PublicKey, Ve
279282
impl<Signer: Sign, K: Deref, L: Deref, CMH: Deref> OnionMessageHandler for OnionMessenger<Signer, K, L, CMH>
280283
where K::Target: KeysInterface<Signer = Signer>,
281284
L::Target: Logger,
282-
CMH::Target: CustomOnionMessageHandler,
285+
CMH::Target: CustomOnionMessageHandler + Sized,
283286
{
284287
/// Handle an incoming onion message. Currently, if a message was destined for us we will log, but
285288
/// soon we'll delegate the onion message to a handler that can generate invoices or send
@@ -308,8 +311,8 @@ impl<Signer: Sign, K: Deref, L: Deref, CMH: Deref> OnionMessageHandler for Onion
308311
}
309312
}
310313
};
311-
match onion_utils::decode_next_hop(onion_decode_ss, &msg.onion_routing_packet.hop_data[..],
312-
msg.onion_routing_packet.hmac, control_tlvs_ss)
314+
match onion_utils::decode_next_untagged_hop(onion_decode_ss, &msg.onion_routing_packet.hop_data[..],
315+
msg.onion_routing_packet.hmac, (control_tlvs_ss, &*self.custom_handler))
313316
{
314317
Ok((Payload::Receive::<<<CMH as Deref>::Target as CustomOnionMessageHandler>::CustomMessage> {
315318
message, control_tlvs: ReceiveControlTlvs::Unblinded(ReceiveTlvs { path_id }), reply_path,

lightning/src/onion_message/mod.rs

+5-9
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,12 @@
1818
//! information on its usage.
1919
//!
2020
//! [offers]: <https://github.com/lightning/bolts/pull/798>
21-
//! [blinded routes]: crate::onion_message::BlindedRoute
21+
//! [blinded routes]: crate::onion_message::blinded_route::BlindedRoute
22+
//! [`OnionMessenger`]: crate::onion_message::messenger::OnionMessenger
2223
23-
mod blinded_route;
24-
mod messenger;
25-
mod packet;
24+
pub mod blinded_route;
25+
pub mod messenger;
26+
pub mod packet;
2627
mod utils;
2728
#[cfg(test)]
2829
mod functional_tests;
29-
30-
// Re-export structs so they can be imported with just the `onion_message::` module prefix.
31-
pub use self::blinded_route::{BlindedRoute, BlindedHop};
32-
pub use self::messenger::{CustomOnionMessageContents, CustomOnionMessageHandler, Destination, OnionMessageContents, OnionMessenger, SendError, SimpleArcOnionMessenger, SimpleRefOnionMessenger};
33-
pub(crate) use self::packet::Packet;

0 commit comments

Comments
 (0)