Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make ParsedEnvelope and Envelope public #4249

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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, ParsedEnvelope, RawEnvelope, Inscription, InscriptionId},
object::Object,
options::Options,
wallet::transaction_builder::{Target, TransactionBuilder},
Expand Down
Loading