global: snapshot

This commit is contained in:
nym21
2025-12-26 22:41:36 +01:00
parent d538280f4b
commit de93f08e93
120 changed files with 1125 additions and 1773 deletions

View File

@@ -7,7 +7,7 @@ use brk_types::{
AddressIndexTxIndex, AddressStats, AnyAddressDataIndexEnum, OutputType, Sats, TxIndex,
TxStatus, Txid, TypeIndex, Unit, Utxo, Vout,
};
use vecdb::{IterableVec, TypedVecIterator};
use vecdb::TypedVecIterator;
use crate::Query;
@@ -169,7 +169,7 @@ impl Query {
let mut txindex_to_txid_iter = vecs.tx.txindex_to_txid.iter()?;
let mut txindex_to_height_iter = vecs.tx.txindex_to_height.iter()?;
let mut txindex_to_first_txoutindex_iter = vecs.tx.txindex_to_first_txoutindex.iter()?;
let mut txoutindex_to_value_iter = vecs.txout.txoutindex_to_value.iter();
let mut txoutindex_to_value_iter = vecs.txout.txoutindex_to_value.iter()?;
let mut height_to_blockhash_iter = vecs.block.height_to_blockhash.iter()?;
let mut height_to_timestamp_iter = vecs.block.height_to_timestamp.iter()?;

View File

@@ -8,8 +8,7 @@ use brk_types::{
};
use vecdb::AnyExportableVec;
use crate::vecs::{IndexToVec, MetricToVec};
use crate::{DataRangeFormat, MetricSelection, Output, Query};
use crate::{vecs::{IndexToVec, MetricToVec}, DataRangeFormat, MetricSelection, Output, Query};
/// Estimated bytes per column header
const CSV_HEADER_BYTES_PER_COL: usize = 10;

View File

@@ -1,5 +1,3 @@
//! Deprecated metrics formatting without MetricData wrapper.
use brk_error::{Error, Result};
use brk_types::Format;
use vecdb::AnyExportableVec;

View File

@@ -1,7 +1,3 @@
//! Query implementation modules.
//!
//! Each module extends `Query` with domain-specific methods using `impl Query` blocks.
mod address;
mod block;
mod mempool;

View File

@@ -6,7 +6,7 @@ use brk_types::{
Sats, Transaction, TxIn, TxInIndex, TxIndex, TxOut, TxOutspend, TxStatus, Txid, TxidParam,
TxidPrefix, Vin, Vout, Weight,
};
use vecdb::{GenericStoredVec, IterableVec, TypedVecIterator};
use vecdb::{GenericStoredVec, TypedVecIterator};
use crate::Query;
@@ -119,10 +119,9 @@ impl Query {
let txoutindex = first_txoutindex + vout;
// Look up spend status
let indexer = self.indexer();
let txinindex = indexer
.vecs
.txout
let computer = self.computer();
let txinindex = computer
.txouts
.txoutindex_to_txinindex
.read_once(txoutindex)?;
@@ -168,7 +167,8 @@ impl Query {
let output_count = usize::from(next_first_txoutindex) - usize::from(first_txoutindex);
// Get spend status for each output
let mut txoutindex_to_txinindex_iter = indexer.vecs.txout.txoutindex_to_txinindex.iter()?;
let computer = self.computer();
let mut txoutindex_to_txinindex_iter = computer.txouts.txoutindex_to_txinindex.iter()?;
let mut outspends = Vec::with_capacity(output_count);
for i in 0..output_count {
@@ -220,7 +220,7 @@ impl Query {
let mut txindex_to_first_txoutindex_iter =
indexer.vecs.tx.txindex_to_first_txoutindex.iter()?;
let mut txinindex_to_outpoint_iter = indexer.vecs.txin.txinindex_to_outpoint.iter()?;
let mut txoutindex_to_value_iter = indexer.vecs.txout.txoutindex_to_value.iter();
let mut txoutindex_to_value_iter = indexer.vecs.txout.txoutindex_to_value.iter()?;
// Build inputs with prevout information
let input: Vec<TxIn> = tx