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

Add charms to StreamEvent #55

Merged
merged 1 commit into from
Jan 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
8 changes: 7 additions & 1 deletion src/index/updater/inscription_updater.rs
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,13 @@ impl<'a, 'db, 'tx> InscriptionUpdater<'a, 'db, 'tx> {
self.height,
self.block_hash,
)
.with_create(sat, i64::from(inscription_number), inscription, parent)
.with_create(
sat,
i64::from(inscription_number),
inscription,
parent,
charms,
)
.publish()?;

(unbound, sequence_number)
Expand Down
4 changes: 4 additions & 0 deletions src/index/updater/inscription_updater/stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ pub struct StreamEvent {
sat: Option<Sat>,
sat_details: Option<Output>, // Output is borrowed from subcommand::traits::Output, to show the details of the sat
inscription_number: Option<i64>,
charms: Option<u16>,
content_type: Option<String>,
content_length: Option<usize>,
content_media: Option<String>,
Expand Down Expand Up @@ -206,6 +207,7 @@ impl StreamEvent {
tx_is_coinbase: tx.is_coin_base(),
sat: None,
inscription_number: None,
charms: None,
content_type: None,
content_length: None,
content_media: None,
Expand Down Expand Up @@ -346,11 +348,13 @@ impl StreamEvent {
inscription_number: i64,
inscription: Inscription,
parent: Option<InscriptionId>,
charms: u16,
) -> &mut Self {
self.enrich_content(inscription);
self.sat = sat;
self.inscription_number = Some(inscription_number);
self.parent = parent;
self.charms = Some(charms);
self.sat_details = match self.sat {
Some(Sat(n)) => {
let sat = Sat(n);
Expand Down
Loading