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 inscription index to /status #3938

Merged
merged 2 commits into from
Sep 9, 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
5 changes: 5 additions & 0 deletions src/index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,10 @@ impl Index {
self.index_addresses
}

pub fn has_inscription_index(&self) -> bool {
self.index_inscriptions
}

pub fn has_rune_index(&self) -> bool {
self.index_runes
}
Expand Down Expand Up @@ -512,6 +516,7 @@ impl Index {
cursed_inscriptions,
height,
initial_sync_time: Duration::from_micros(initial_sync_time),
inscription_index: self.has_inscription_index(),
inscriptions: blessed_inscriptions + cursed_inscriptions,
lost_sats: statistic(Statistic::LostSats)?,
minimum_rune_for_next_block: Rune::minimum_at_height(
Expand Down
2 changes: 2 additions & 0 deletions src/subcommand/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3556,6 +3556,8 @@ mod tests {
<dd>false</dd>
<dt>address index</dt>
<dd>false</dd>
<dt>inscription index</dt>
<dd>true</dd>
<dt>rune index</dt>
<dd>false</dd>
<dt>sat index</dt>
Expand Down
1 change: 1 addition & 0 deletions src/templates/status.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ pub struct StatusHtml {
pub cursed_inscriptions: u64,
pub height: Option<u32>,
pub initial_sync_time: Duration,
pub inscription_index: bool,
pub inscriptions: u64,
pub lost_sats: u64,
pub minimum_rune_for_next_block: Rune,
Expand Down
2 changes: 2 additions & 0 deletions templates/status.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ <h1>Status</h1>
<dd>{{ self.unrecoverably_reorged }}</dd>
<dt>address index</dt>
<dd>{{ self.address_index }}</dd>
<dt>inscription index</dt>
<dd>{{ self.inscription_index }}</dd>
<dt>rune index</dt>
<dd>{{ self.rune_index }}</dd>
<dt>sat index</dt>
Expand Down
1 change: 1 addition & 0 deletions tests/json_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,7 @@ fn get_status() {
cursed_inscriptions: 0,
height: Some(3),
initial_sync_time: dummy_duration,
inscription_index: true,
inscriptions: 1,
lost_sats: 0,
minimum_rune_for_next_block: Rune(99218849511960410),
Expand Down
Loading