global: fmt

This commit is contained in:
nym21
2026-03-28 11:56:51 +01:00
parent b6e56c4e9f
commit 24d2b7b142
213 changed files with 6888 additions and 2527 deletions
@@ -14,23 +14,23 @@ impl Vecs {
starting_indexes: &Indexes,
exit: &Exit,
) -> Result<()> {
self.total.compute_with(
starting_indexes.height,
prices,
exit,
|sats| {
self.total
.compute_with(starting_indexes.height, prices, exit, |sats| {
Ok(sats.compute_transform2(
starting_indexes.height,
&scripts.value.op_return.block.sats,
&mining.rewards.unclaimed.block.sats,
|(h, op_return, unclaimed, ..)| {
let genesis = if h.to_usize() == 0 { Sats::FIFTY_BTC } else { Sats::ZERO };
let genesis = if h.to_usize() == 0 {
Sats::FIFTY_BTC
} else {
Sats::ZERO
};
(h, genesis + op_return + unclaimed)
},
exit,
)?)
},
)?;
})?;
Ok(())
}
+2 -7
View File
@@ -24,13 +24,8 @@ impl Vecs {
self.db.sync_bg_tasks()?;
// 1. Compute burned/unspendable supply
self.burned.compute(
scripts,
mining,
prices,
starting_indexes,
exit,
)?;
self.burned
.compute(scripts, mining, prices, starting_indexes, exit)?;
// 2. Compute inflation rate: (supply[h] / supply[1y_ago]) - 1
// Skip when lookback supply <= first block (50 BTC = 5B sats),
+9 -10
View File
@@ -6,8 +6,8 @@ use brk_types::Version;
use crate::{
cointime, distribution, indexes,
internal::{
CachedWindowStarts, LazyAmountPerBlock, LazyFiatPerBlock,
LazyRollingDeltasFiatFromHeight, PercentPerBlock, RollingWindows,
CachedWindowStarts, LazyAmountPerBlock, LazyFiatPerBlock, LazyRollingDeltasFiatFromHeight,
PercentPerBlock, RollingWindows,
db_utils::{finalize_db, open_db},
},
supply::burned,
@@ -37,12 +37,8 @@ impl Vecs {
let burned = burned::Vecs::forced_import(&db, version, indexes)?;
// Inflation rate
let inflation_rate = PercentPerBlock::forced_import(
&db,
"inflation_rate",
version + Version::ONE,
indexes,
)?;
let inflation_rate =
PercentPerBlock::forced_import(&db, "inflation_rate", version + Version::ONE, indexes)?;
// Velocity
let velocity = super::velocity::Vecs::forced_import(&db, version, indexes)?;
@@ -67,8 +63,11 @@ impl Vecs {
indexes,
)?;
let hodled_or_lost =
LazyAmountPerBlock::identity("hodled_or_lost_supply", &cointime.supply.vaulted, version);
let hodled_or_lost = LazyAmountPerBlock::identity(
"hodled_or_lost_supply",
&cointime.supply.vaulted,
version,
);
let this = Self {
db,
+2 -2
View File
@@ -4,8 +4,8 @@ use vecdb::{Database, Rw, StorageMode};
use super::{burned, velocity};
use crate::internal::{
LazyFiatPerBlock, LazyAmountPerBlock, LazyRollingDeltasFiatFromHeight,
PercentPerBlock, RollingWindows,
LazyAmountPerBlock, LazyFiatPerBlock, LazyRollingDeltasFiatFromHeight, PercentPerBlock,
RollingWindows,
};
#[derive(Traversable)]