mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-04-30 09:30:00 -07:00
computer: renames
This commit is contained in:
@@ -6,7 +6,7 @@ use vecdb::{Database, IterableCloneableVec};
|
||||
use super::Vecs;
|
||||
use crate::{
|
||||
indexes,
|
||||
internal::{ComputedBlockLast, ComputedBlockSum, ComputedDateLast, DerivedComputedBlockLast},
|
||||
internal::{ComputedBlockLast, ComputedBlockSum, ComputedDateLast, ComputedDerivedBlockLast},
|
||||
};
|
||||
|
||||
impl Vecs {
|
||||
@@ -106,7 +106,7 @@ impl Vecs {
|
||||
indexes,
|
||||
)?,
|
||||
// Derived from external indexer data - no height storage needed
|
||||
difficulty: DerivedComputedBlockLast::forced_import(
|
||||
difficulty: ComputedDerivedBlockLast::forced_import(
|
||||
db,
|
||||
"difficulty",
|
||||
indexer.vecs.blocks.difficulty.boxed_clone(),
|
||||
|
||||
@@ -2,7 +2,7 @@ use brk_traversable::Traversable;
|
||||
use brk_types::{StoredF32, StoredF64};
|
||||
|
||||
use crate::internal::{
|
||||
ComputedBlockLast, ComputedBlockSum, ComputedDateLast, DerivedComputedBlockLast,
|
||||
ComputedBlockLast, ComputedBlockSum, ComputedDateLast, ComputedDerivedBlockLast,
|
||||
};
|
||||
|
||||
/// Mining-related metrics: hash rate, hash price, hash value, difficulty
|
||||
@@ -24,7 +24,7 @@ pub struct Vecs {
|
||||
pub hash_value_phs_min: ComputedBlockLast<StoredF32>,
|
||||
pub hash_value_rebound: ComputedBlockLast<StoredF32>,
|
||||
/// Derived from indexer - no height storage needed
|
||||
pub difficulty: DerivedComputedBlockLast<StoredF64>,
|
||||
pub difficulty: ComputedDerivedBlockLast<StoredF64>,
|
||||
pub difficulty_as_hash: ComputedBlockLast<StoredF32>,
|
||||
pub difficulty_adjustment: ComputedBlockSum<StoredF32>,
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ use brk_types::{Height, StoredU64, Version};
|
||||
use vecdb::{Database, IterableCloneableVec, VecIndex};
|
||||
|
||||
use super::Vecs;
|
||||
use crate::{indexes, internal::{DerivedComputedBlockFull, LazyComputedBlockFull}};
|
||||
use crate::{indexes, internal::{ComputedDerivedBlockFull, LazyComputedBlockFull}};
|
||||
|
||||
impl Vecs {
|
||||
pub fn forced_import(
|
||||
@@ -26,7 +26,7 @@ impl Vecs {
|
||||
.map(|w| StoredU64::from(w.to_vbytes_floor()))
|
||||
},
|
||||
)?,
|
||||
size: DerivedComputedBlockFull::forced_import(
|
||||
size: ComputedDerivedBlockFull::forced_import(
|
||||
db,
|
||||
"block_size",
|
||||
indexer.vecs.blocks.total_size.boxed_clone(),
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
use brk_traversable::Traversable;
|
||||
use brk_types::{StoredU64, Weight};
|
||||
|
||||
use crate::internal::{DerivedComputedBlockFull, LazyComputedBlockFull};
|
||||
use crate::internal::{ComputedDerivedBlockFull, LazyComputedBlockFull};
|
||||
|
||||
#[derive(Clone, Traversable)]
|
||||
pub struct Vecs {
|
||||
pub vbytes: LazyComputedBlockFull<StoredU64, Weight>,
|
||||
pub size: DerivedComputedBlockFull<StoredU64>,
|
||||
pub size: ComputedDerivedBlockFull<StoredU64>,
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ use brk_types::{Date, Height, Version};
|
||||
use vecdb::{Database, EagerVec, ImportableVec, IterableCloneableVec, LazyVecFrom1, VecIndex};
|
||||
|
||||
use super::Vecs;
|
||||
use crate::{indexes, internal::DerivedComputedBlockFirst};
|
||||
use crate::{indexes, internal::ComputedDerivedBlockFirst};
|
||||
|
||||
impl Vecs {
|
||||
pub fn forced_import(
|
||||
@@ -31,7 +31,7 @@ impl Vecs {
|
||||
|height: Height, timestamp_iter| timestamp_iter.get(height).map(Date::from),
|
||||
),
|
||||
timestamp_fixed: height_to_timestamp_fixed,
|
||||
timestamp: DerivedComputedBlockFirst::forced_import(
|
||||
timestamp: ComputedDerivedBlockFirst::forced_import(
|
||||
db,
|
||||
"timestamp",
|
||||
indexer.vecs.blocks.timestamp.boxed_clone(),
|
||||
|
||||
@@ -2,7 +2,7 @@ use brk_traversable::Traversable;
|
||||
use brk_types::{Date, Height, Timestamp};
|
||||
use vecdb::{EagerVec, LazyVecFrom1, PcoVec};
|
||||
|
||||
use crate::internal::DerivedComputedBlockFirst;
|
||||
use crate::internal::ComputedDerivedBlockFirst;
|
||||
|
||||
/// Timestamp and date metrics for blocks
|
||||
#[derive(Clone, Traversable)]
|
||||
@@ -10,5 +10,5 @@ pub struct Vecs {
|
||||
pub date: LazyVecFrom1<Height, Date, Height, Timestamp>,
|
||||
pub date_fixed: LazyVecFrom1<Height, Date, Height, Timestamp>,
|
||||
pub timestamp_fixed: EagerVec<PcoVec<Height, Timestamp>>,
|
||||
pub timestamp: DerivedComputedBlockFirst<Timestamp>,
|
||||
pub timestamp: ComputedDerivedBlockFirst<Timestamp>,
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ use vecdb::{Database, IterableCloneableVec};
|
||||
use super::Vecs;
|
||||
use crate::{
|
||||
indexes,
|
||||
internal::{DerivedComputedBlockFull, LazyBlockFull, WeightToFullness},
|
||||
internal::{ComputedDerivedBlockFull, LazyBlockFull, WeightToFullness},
|
||||
};
|
||||
|
||||
impl Vecs {
|
||||
@@ -16,7 +16,7 @@ impl Vecs {
|
||||
indexer: &Indexer,
|
||||
indexes: &indexes::Vecs,
|
||||
) -> Result<Self> {
|
||||
let weight = DerivedComputedBlockFull::forced_import(
|
||||
let weight = ComputedDerivedBlockFull::forced_import(
|
||||
db,
|
||||
"block_weight",
|
||||
indexer.vecs.blocks.weight.boxed_clone(),
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
use brk_traversable::Traversable;
|
||||
use brk_types::{StoredF32, Weight};
|
||||
|
||||
use crate::internal::{DerivedComputedBlockFull, LazyBlockFull};
|
||||
use crate::internal::{ComputedDerivedBlockFull, LazyBlockFull};
|
||||
|
||||
#[derive(Clone, Traversable)]
|
||||
pub struct Vecs {
|
||||
pub weight: DerivedComputedBlockFull<Weight>,
|
||||
pub weight: ComputedDerivedBlockFull<Weight>,
|
||||
pub fullness: LazyBlockFull<StoredF32, Weight>,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user