diff --git a/src/compacts.rs b/src/compacts.rs index debd10d..9ffa996 100644 --- a/src/compacts.rs +++ b/src/compacts.rs @@ -70,7 +70,7 @@ where } /// Find compact and move current parser position accordingly. -pub(crate) fn get_compact( +pub fn get_compact( data: &B, ext_memory: &mut E, position: &mut usize, diff --git a/src/decoding_sci.rs b/src/decoding_sci.rs index fe9dc59..717a9f4 100644 --- a/src/decoding_sci.rs +++ b/src/decoding_sci.rs @@ -51,7 +51,7 @@ use crate::MarkedData; /// /// Current parser position gets changed. Propagated to this point /// [`SpecialtySet`] is used. -pub(crate) fn decode_type_def_primitive( +pub fn decode_type_def_primitive( found_ty: &TypeDefPrimitive, data: &B, ext_memory: &mut E, @@ -297,7 +297,7 @@ where } /// [`TypeParameter`](scale_info::TypeParameter) name for `call`. -pub(crate) const CALL_INDICATOR: &str = "Call"; +pub const CALL_INDICATOR: &str = "Call"; /// General decoder function. Parse part of data as [`Ty`]. /// @@ -809,7 +809,7 @@ where /// First data `u8` element is `index` of [`Variant`]. /// /// Does not modify the input. -pub(crate) fn pick_variant<'a, B, E>( +pub fn pick_variant<'a, B, E>( variants: &'a [Variant], data: &B, ext_memory: &mut E, @@ -998,7 +998,7 @@ where } /// Positions and related values for decoding `BitVec`. -pub(crate) struct BitVecPositions { +pub struct BitVecPositions { /// Encoded `BitVec` start position, includes bit length compact. bitvec_start: usize, @@ -1007,7 +1007,7 @@ pub(crate) struct BitVecPositions { data_start: usize, /// Encoded `BitVec` end position. - pub(crate) bitvec_end: usize, + pub bitvec_end: usize, /// Number of bits in `BitVec`, for patch only. #[cfg(any(target_pointer_width = "32", test))] @@ -1025,7 +1025,7 @@ impl BitVecPositions { /// New `BitVecPositions` for given input data and position. /// /// `T` is corresponding `BitStore`. - pub(crate) fn new( + pub fn new( data: &B, ext_memory: &mut E, position: usize, diff --git a/src/lib.rs b/src/lib.rs index abfe103..24ca4d5 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -464,11 +464,11 @@ pub mod additional_types; pub mod cards; pub mod compacts; pub mod cut_metadata; -mod decoding_sci; +pub mod decoding_sci; mod decoding_sci_ext; pub mod error; pub mod printing_balance; -mod propagated; +pub mod propagated; pub mod special_indicators; mod special_types; pub mod storage_data; @@ -565,7 +565,7 @@ where /// /// Extensions are cut to ensure the call decoding never gets outside the /// call data. - pub(crate) fn data_no_extensions(&self) -> B { + pub fn data_no_extensions(&self) -> B { self.data.limit_length(self.extensions_start()) } diff --git a/src/propagated.rs b/src/propagated.rs index ac3b1f8..c3660e7 100644 --- a/src/propagated.rs +++ b/src/propagated.rs @@ -189,12 +189,12 @@ impl Default for Checker { #[derive(Clone, Debug)] pub struct Propagated { /// Type data that is collected and checked during parsing. - pub(crate) checker: Checker, + pub checker: Checker, /// Set of [`Info`] collected while resolving the type. /// /// Only non-empty [`Info`] entries are added. - pub(crate) info: Vec, + pub info: Vec, } impl Propagated { @@ -207,7 +207,7 @@ impl Propagated { } /// Initiate new `Propagated` for signed extensions instance. - pub(crate) fn from_ext_meta(signed_ext_meta: &SignedExtensionMetadata) -> Self { + pub fn from_ext_meta(signed_ext_meta: &SignedExtensionMetadata) -> Self { Self { checker: Checker { specialty_set: SpecialtySet { @@ -221,7 +221,7 @@ impl Propagated { } /// Initiate new `Propagated` with known, propagated from above `Checker`. - pub(crate) fn with_checker(checker: Checker) -> Self { + pub fn with_checker(checker: Checker) -> Self { Self { checker, info: Vec::new(), @@ -230,7 +230,7 @@ impl Propagated { /// Initiate new `Propagated` with known, propagated from above `Checker` /// for an individual [`Field`]. - pub(crate) fn for_field( + pub fn for_field( checker: &Checker, field: &Field, ) -> Result> { @@ -242,7 +242,7 @@ impl Propagated { /// Initiate new `Propagated` with known, propagated from above `Checker` /// for a [`Type`]. - pub(crate) fn for_ty( + pub fn for_ty( checker: &Checker, ty: &Type, id: u32, @@ -254,30 +254,30 @@ impl Propagated { } /// Get associated `compact_at` - pub(crate) fn compact_at(&self) -> Option { + pub fn compact_at(&self) -> Option { self.checker.specialty_set.compact_at } /// Check that `compact_at` field in associated [`SpecialtySet`] is not /// `Some(_)`, i.e. there was no compact type encountered. - pub(crate) fn reject_compact(&self) -> Result<(), ParserError> { + pub fn reject_compact(&self) -> Result<(), ParserError> { self.checker.specialty_set.reject_compact::() } /// Discard previously found [`Hint`]. - pub(crate) fn forget_hint(&mut self) { + pub fn forget_hint(&mut self) { self.checker.forget_hint() } /// Add [`Info`] entry (if non-empty) to `info` set. - pub(crate) fn add_info(&mut self, info_update: &Info) { + pub fn add_info(&mut self, info_update: &Info) { if !info_update.is_empty() { self.info.push(info_update.clone()) } } /// Add `&[Info]` to `info` set. - pub(crate) fn add_info_slice(&mut self, info_update_slice: &[Info]) { + pub fn add_info_slice(&mut self, info_update_slice: &[Info]) { self.info.extend_from_slice(info_update_slice) } }