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

Use a flag to indicate a mint #3068

Merged
merged 15 commits into from
Feb 2, 2024
Prev Previous commit
Next Next commit
Tests compiling
  • Loading branch information
casey committed Feb 2, 2024
commit aa5e287aba7336cd399782a58cc8b90d33415d96
4 changes: 1 addition & 3 deletions src/index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@ use {
},
};

pub use self::entry::RuneEntry;

pub(crate) use entry::MintEntry;
pub use {self::entry::RuneEntry, entry::MintEntry};

pub(crate) mod entry;
mod fetcher;
Expand Down
17 changes: 9 additions & 8 deletions src/index/entry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ pub(super) type RuneEntryValue = (
u32, // timestamp
);

#[derive(Debug, PartialEq, Copy, Clone, Serialize, Deserialize)]
#[derive(Debug, PartialEq, Copy, Clone, Serialize, Deserialize, Default)]
pub struct MintEntry {
pub deadline: Option<u32>,
pub end: Option<u32>,
Expand Down Expand Up @@ -445,15 +445,17 @@ mod tests {
fn rune_entry() {
let entry = RuneEntry {
burned: 1,
deadline: Some(2),
divisibility: 3,
end: Some(4),
etching: Txid::from_byte_array([
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E,
0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D,
0x1E, 0x1F,
]),
limit: Some(5),
mint: Some(MintEntry {
deadline: Some(2),
end: Some(4),
limit: Some(5),
}),
mints: 11,
number: 6,
rune: Rune(7),
Expand All @@ -465,15 +467,14 @@ mod tests {

let value = (
1,
Some(2),
3,
Some(4),
(
0x0F0E0D0C0B0A09080706050403020100,
0x1F1E1D1C1B1A19181716151413121110,
),
Some(5),
(11, 6),
Some((Some(2), Some(4), Some(5))),
11,
6,
7,
8,
9,
Expand Down
3 changes: 1 addition & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ use {
deserialize_from_str::DeserializeFromStr,
epoch::Epoch,
height::Height,
index::MintEntry,
inscriptions::{media, teleburn, Charm, Media, ParsedEnvelope},
representation::Representation,
runes::{Etching, Pile, SpacedRune},
Expand Down Expand Up @@ -84,7 +83,7 @@ use {
pub use self::{
chain::Chain,
fee_rate::FeeRate,
index::{Index, RuneEntry},
index::{Index, MintEntry, RuneEntry},
inscriptions::{Envelope, Inscription, InscriptionId},
object::Object,
options::Options,
Expand Down
Loading