diff --git a/src/index.rs b/src/index.rs index 17dd962730..ebbc2f4873 100644 --- a/src/index.rs +++ b/src/index.rs @@ -54,7 +54,6 @@ define_multimap_table! { SATPOINT_TO_SEQUENCE_NUMBER, &SatPointValue, u32 } define_multimap_table! { SAT_TO_SEQUENCE_NUMBER, u64, u32 } define_multimap_table! { SEQUENCE_NUMBER_TO_CHILDREN, u32, u32 } define_multimap_table! { SCRIPT_PUBKEY_TO_OUTPOINT, &[u8], OutPointValue } -define_table! { CONTENT_TYPE_TO_COUNT, Option<&[u8]>, u64 } define_table! { HEIGHT_TO_BLOCK_HEADER, u32, &HeaderValue } define_table! { HEIGHT_TO_LAST_SEQUENCE_NUMBER, u32, u32 } define_table! { HOME_INSCRIPTIONS, u32, InscriptionIdValue } @@ -302,7 +301,6 @@ impl Index { tx.open_multimap_table(SAT_TO_SEQUENCE_NUMBER)?; tx.open_multimap_table(SCRIPT_PUBKEY_TO_OUTPOINT)?; tx.open_multimap_table(SEQUENCE_NUMBER_TO_CHILDREN)?; - tx.open_table(CONTENT_TYPE_TO_COUNT)?; tx.open_table(HEIGHT_TO_BLOCK_HEADER)?; tx.open_table(HEIGHT_TO_LAST_SEQUENCE_NUMBER)?; tx.open_table(HOME_INSCRIPTIONS)?; @@ -515,21 +513,10 @@ impl Index { let cursed_inscriptions = statistic(Statistic::CursedInscriptions)?; let initial_sync_time = statistic(Statistic::InitialSyncTime)?; - let mut content_type_counts = rtx - .open_table(CONTENT_TYPE_TO_COUNT)? - .iter()? - .map(|result| { - result.map(|(key, value)| (key.value().map(|slice| slice.into()), value.value())) - }) - .collect::>, u64)>, StorageError>>()?; - - content_type_counts.sort_by_key(|(_content_type, count)| Reverse(*count)); - Ok(StatusHtml { address_index: self.has_address_index(), blessed_inscriptions, chain: self.settings.chain(), - content_type_counts, cursed_inscriptions, height, initial_sync_time: Duration::from_micros(initial_sync_time), diff --git a/src/index/updater.rs b/src/index/updater.rs index 6ba680883a..d494f12176 100644 --- a/src/index/updater.rs +++ b/src/index/updater.rs @@ -416,7 +416,6 @@ impl<'index> Updater<'index> { } }; - let mut content_type_to_count = wtx.open_table(CONTENT_TYPE_TO_COUNT)?; let mut height_to_block_header = wtx.open_table(HEIGHT_TO_BLOCK_HEADER)?; let mut height_to_last_sequence_number = wtx.open_table(HEIGHT_TO_LAST_SEQUENCE_NUMBER)?; let mut home_inscriptions = wtx.open_table(HOME_INSCRIPTIONS)?; @@ -465,7 +464,6 @@ impl<'index> Updater<'index> { let mut inscription_updater = InscriptionUpdater { blessed_inscription_count, chain: self.index.settings.chain(), - content_type_to_count: &mut content_type_to_count, cursed_inscription_count, event_sender: self.index.event_sender.as_ref(), flotsam: Vec::new(), diff --git a/src/index/updater/inscription_updater.rs b/src/index/updater/inscription_updater.rs index bc762c990e..218c80e0c1 100644 --- a/src/index/updater/inscription_updater.rs +++ b/src/index/updater/inscription_updater.rs @@ -40,7 +40,6 @@ enum Origin { pub(super) struct InscriptionUpdater<'a, 'tx> { pub(super) blessed_inscription_count: u64, pub(super) chain: Chain, - pub(super) content_type_to_count: &'a mut Table<'tx, Option<&'static [u8]>, u64>, pub(super) cursed_inscription_count: u64, pub(super) event_sender: Option<&'a mpsc::Sender>, pub(super) flotsam: Vec, @@ -194,18 +193,6 @@ impl<'a, 'tx> InscriptionUpdater<'a, 'tx> { .filter(|&pointer| pointer < total_output_value) .unwrap_or(offset); - let content_type = inscription.payload.content_type.as_deref(); - - let content_type_count = self - .content_type_to_count - .get(content_type)? - .map(|entry| entry.value()) - .unwrap_or_default(); - - self - .content_type_to_count - .insert(content_type, content_type_count + 1)?; - floating_inscriptions.push(Flotsam { inscription_id, offset, diff --git a/src/lib.rs b/src/lib.rs index 49810323cb..e172e7da8c 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -62,7 +62,7 @@ use { snafu::{Backtrace, ErrorCompat, Snafu}, std::{ backtrace::BacktraceStatus, - cmp::{self, Reverse}, + cmp, collections::{BTreeMap, BTreeSet, HashMap, HashSet, VecDeque}, env, ffi::OsString, diff --git a/src/subcommand/server.rs b/src/subcommand/server.rs index f7eaf2909a..a01a767f0c 100644 --- a/src/subcommand/server.rs +++ b/src/subcommand/server.rs @@ -3564,15 +3564,6 @@ mod tests { [[:xdigit:]]{40} -
inscription content types
-
-
-
text/plain;charset=utf-8
-
2 -
none
-
1 -
-
.*", ); diff --git a/src/templates/status.rs b/src/templates/status.rs index 000f2274f1..043dff6da1 100644 --- a/src/templates/status.rs +++ b/src/templates/status.rs @@ -5,7 +5,6 @@ pub struct StatusHtml { pub address_index: bool, pub blessed_inscriptions: u64, pub chain: Chain, - pub content_type_counts: Vec<(Option>, u64)>, pub cursed_inscriptions: u64, pub height: Option, pub initial_sync_time: Duration, diff --git a/templates/status.html b/templates/status.html index 426226a836..b2356c80f3 100644 --- a/templates/status.html +++ b/templates/status.html @@ -48,17 +48,4 @@

Status

%% } -
inscription content types
-
-
-%% for (content_type, count) in &self.content_type_counts { -%% if let Some(content_type) = content_type { -
{{String::from_utf8_lossy(&content_type)}}
-%% } else { -
none
-%% } -
{{count}} -%% } -
-
diff --git a/tests/json_api.rs b/tests/json_api.rs index 1f209de852..78420bae21 100644 --- a/tests/json_api.rs +++ b/tests/json_api.rs @@ -496,7 +496,6 @@ fn get_status() { address_index: false, blessed_inscriptions: 1, chain: Chain::Regtest, - content_type_counts: vec![(Some("text/plain;charset=utf-8".into()), 1)], cursed_inscriptions: 0, height: Some(3), initial_sync_time: dummy_duration,