mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-07-13 12:08:13 -07:00
global: refactor
This commit is contained in:
@@ -6,7 +6,7 @@ use super::Vecs;
|
||||
use crate::{
|
||||
indexes,
|
||||
internal::{
|
||||
AmountPerBlockCumulative, AmountPerBlockCumulativeRolling, AmountPerBlockFull,
|
||||
ValuePerBlockCumulative, ValuePerBlockCumulativeRolling, ValuePerBlockFull,
|
||||
LazyPercentCumulativeRolling, OneMinusBp16, PercentCumulativeRolling, RatioRollingWindows,
|
||||
WindowStartVec, Windows,
|
||||
},
|
||||
@@ -29,23 +29,23 @@ impl Vecs {
|
||||
);
|
||||
|
||||
Ok(Self {
|
||||
coinbase: AmountPerBlockCumulativeRolling::forced_import(
|
||||
coinbase: ValuePerBlockCumulativeRolling::forced_import(
|
||||
db,
|
||||
"coinbase",
|
||||
version,
|
||||
indexes,
|
||||
cached_starts,
|
||||
)?,
|
||||
subsidy: AmountPerBlockCumulativeRolling::forced_import(
|
||||
subsidy: ValuePerBlockCumulativeRolling::forced_import(
|
||||
db,
|
||||
"subsidy",
|
||||
version,
|
||||
indexes,
|
||||
cached_starts,
|
||||
)?,
|
||||
fees: AmountPerBlockFull::forced_import(db, "fees", version, indexes, cached_starts)?,
|
||||
fees: ValuePerBlockFull::forced_import(db, "fees", version, indexes, cached_starts)?,
|
||||
output_volume: EagerVec::forced_import(db, "output_volume", version)?,
|
||||
unclaimed: AmountPerBlockCumulative::forced_import(
|
||||
unclaimed: ValuePerBlockCumulative::forced_import(
|
||||
db,
|
||||
"unclaimed_rewards",
|
||||
version,
|
||||
|
||||
@@ -3,17 +3,17 @@ use brk_types::{BasisPoints16, BasisPoints32, Height, Sats};
|
||||
use vecdb::{EagerVec, PcoVec, Rw, StorageMode};
|
||||
|
||||
use crate::internal::{
|
||||
AmountPerBlockCumulative, AmountPerBlockCumulativeRolling, AmountPerBlockFull,
|
||||
ValuePerBlockCumulative, ValuePerBlockCumulativeRolling, ValuePerBlockFull,
|
||||
LazyPercentCumulativeRolling, PercentCumulativeRolling, RatioRollingWindows,
|
||||
};
|
||||
|
||||
#[derive(Traversable)]
|
||||
pub struct Vecs<M: StorageMode = Rw> {
|
||||
pub coinbase: AmountPerBlockCumulativeRolling<M>,
|
||||
pub subsidy: AmountPerBlockCumulativeRolling<M>,
|
||||
pub fees: AmountPerBlockFull<M>,
|
||||
pub coinbase: ValuePerBlockCumulativeRolling<M>,
|
||||
pub subsidy: ValuePerBlockCumulativeRolling<M>,
|
||||
pub fees: ValuePerBlockFull<M>,
|
||||
pub output_volume: M::Stored<EagerVec<PcoVec<Height, Sats>>>,
|
||||
pub unclaimed: AmountPerBlockCumulative<M>,
|
||||
pub unclaimed: ValuePerBlockCumulative<M>,
|
||||
#[traversable(wrap = "fees", rename = "dominance")]
|
||||
pub fee_dominance: PercentCumulativeRolling<BasisPoints16, M>,
|
||||
#[traversable(wrap = "subsidy", rename = "dominance")]
|
||||
|
||||
Reference in New Issue
Block a user