Skip to content

Commit

Permalink
Make ParsedEnvelope and Envelope public (#4249)
Browse files Browse the repository at this point in the history
  • Loading branch information
NCrashed authored Mar 5, 2025
1 parent 54bfc90 commit 7e96b24
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
7 changes: 5 additions & 2 deletions src/inscriptions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@ use super::*;

use tag::Tag;

pub(crate) use self::{envelope::ParsedEnvelope, media::Media};
pub(crate) use self::media::Media;

pub use self::{envelope::Envelope, inscription::Inscription, inscription_id::InscriptionId};
pub use self::{
envelope::Envelope, envelope::ParsedEnvelope, envelope::RawEnvelope, inscription::Inscription,
inscription_id::InscriptionId,
};

mod envelope;
mod inscription;
Expand Down
8 changes: 4 additions & 4 deletions src/inscriptions/envelope.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ pub(crate) const PROTOCOL_ID: [u8; 3] = *b"ord";
pub(crate) const BODY_TAG: [u8; 0] = [];

type Result<T> = std::result::Result<T, script::Error>;
type RawEnvelope = Envelope<Vec<Vec<u8>>>;
pub(crate) type ParsedEnvelope = Envelope<Inscription>;
pub type RawEnvelope = Envelope<Vec<Vec<u8>>>;
pub type ParsedEnvelope = Envelope<Inscription>;

#[derive(Default, PartialEq, Clone, Serialize, Deserialize, Debug, Eq)]
pub struct Envelope<T> {
Expand Down Expand Up @@ -92,7 +92,7 @@ impl From<RawEnvelope> for ParsedEnvelope {
}

impl ParsedEnvelope {
pub(crate) fn from_transaction(transaction: &Transaction) -> Vec<Self> {
pub fn from_transaction(transaction: &Transaction) -> Vec<Self> {
RawEnvelope::from_transaction(transaction)
.into_iter()
.map(|envelope| envelope.into())
Expand All @@ -101,7 +101,7 @@ impl ParsedEnvelope {
}

impl RawEnvelope {
pub(crate) fn from_transaction(transaction: &Transaction) -> Vec<Self> {
pub fn from_transaction(transaction: &Transaction) -> Vec<Self> {
let mut envelopes = Vec::new();

for (i, input) in transaction.input.iter().enumerate() {
Expand Down
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use {
inscriptions::{
inscription_id,
media::{self, ImageRendering, Media},
teleburn, ParsedEnvelope,
teleburn,
},
into_usize::IntoUsize,
option_ext::OptionExt,
Expand Down Expand Up @@ -96,7 +96,7 @@ pub use self::{
chain::Chain,
fee_rate::FeeRate,
index::{Index, RuneEntry},
inscriptions::{Envelope, Inscription, InscriptionId},
inscriptions::{Envelope, Inscription, InscriptionId, ParsedEnvelope, RawEnvelope},
object::Object,
options::Options,
wallet::transaction_builder::{Target, TransactionBuilder},
Expand Down

0 comments on commit 7e96b24

Please sign in to comment.