Reduce visibility for offer auxiliary types
authorJeffrey Czyz <jkczyz@gmail.com>
Fri, 2 Dec 2022 23:26:27 +0000 (15:26 -0800)
committerJeffrey Czyz <jkczyz@gmail.com>
Fri, 2 Dec 2022 23:26:27 +0000 (15:26 -0800)
lightning/src/offers/offer.rs
lightning/src/offers/parse.rs
lightning/src/util/ser_macros.rs

index 704045f760b02867e094026a3a0e87816bd82189..5995c513dab9c00301bfb5c442428719bf3da230 100644 (file)
@@ -242,7 +242,7 @@ pub struct Offer {
 
 /// The contents of an [`Offer`], which may be shared with an `InvoiceRequest` or an `Invoice`.
 #[derive(Clone, Debug)]
-pub(crate) struct OfferContents {
+pub(super) struct OfferContents {
        chains: Option<Vec<ChainHash>>,
        metadata: Option<Vec<u8>>,
        amount: Option<Amount>,
index 19d7d74ed6111fd6ddc9fef9d7410a8a47b43354..013970981767acb6f51062f9eefd9af445f71593 100644 (file)
@@ -20,7 +20,7 @@ use crate::util::ser::SeekReadable;
 use crate::prelude::*;
 
 /// Indicates a message can be encoded using bech32.
-pub(crate) trait Bech32Encode: AsRef<[u8]> + TryFrom<Vec<u8>, Error=ParseError> {
+pub(super) trait Bech32Encode: AsRef<[u8]> + TryFrom<Vec<u8>, Error=ParseError> {
        /// Human readable part of the message's bech32 encoding.
        const BECH32_HRP: &'static str;
 
@@ -78,7 +78,7 @@ impl<'a> AsRef<str> for Bech32String<'a> {
 
 /// A wrapper for reading a message as a TLV stream `T` from a byte sequence, while still
 /// maintaining ownership of the bytes for later use.
-pub(crate) struct ParsedMessage<T: SeekReadable> {
+pub(super) struct ParsedMessage<T: SeekReadable> {
        pub bytes: Vec<u8>,
        pub tlv_stream: T,
 }
index 3e1d8a9280d43da344076854739a5a81436f450b..6cc9d947753440bf61a55aa0e013d7213086cc6d 100644 (file)
@@ -504,15 +504,15 @@ macro_rules! tlv_stream {
                $(($type:expr, $field:ident : $fieldty:tt)),* $(,)*
        }) => {
                #[derive(Debug)]
-               pub(crate) struct $name {
+               pub(super) struct $name {
                        $(
                                $field: Option<tlv_record_type!($fieldty)>,
                        )*
                }
 
-               pub(crate) struct $nameref<'a> {
+               pub(super) struct $nameref<'a> {
                        $(
-                               pub(crate) $field: Option<tlv_record_ref_type!($fieldty)>,
+                               pub(super) $field: Option<tlv_record_ref_type!($fieldty)>,
                        )*
                }