computer: snapshot

This commit is contained in:
nym21
2026-03-09 14:44:40 +01:00
parent cba3b7dc38
commit 362e8d1603
36 changed files with 213 additions and 213 deletions
@@ -17,5 +17,5 @@ pub struct PerResolution<M10, M30, H1, H4, H12, D1, D3, W1, Mo1, Mo3, Mo6, Y1, Y
pub year1: Y1,
pub year10: Y10,
pub halving: HE,
pub difficulty: DE,
pub epoch: DE,
}
@@ -2,7 +2,7 @@ use brk_error::Result;
use brk_traversable::Traversable;
use brk_types::{
Day1, Day3, DifficultyEpoch, HalvingEpoch, Height, Hour1, Hour4, Hour12, Indexes, Minute10,
Day1, Day3, Epoch, Halving, Height, Hour1, Hour4, Hour12, Indexes, Minute10,
Minute30, Month1, Month3, Month6, Version, Week1, Year1, Year10,
};
use derive_more::{Deref, DerefMut};
@@ -35,8 +35,8 @@ pub struct EagerIndexes<T, M: StorageMode = Rw>(
<M as StorageMode>::Stored<EagerVec<PcoVec<Month6, T>>>,
<M as StorageMode>::Stored<EagerVec<PcoVec<Year1, T>>>,
<M as StorageMode>::Stored<EagerVec<PcoVec<Year10, T>>>,
<M as StorageMode>::Stored<EagerVec<PcoVec<HalvingEpoch, T>>>,
<M as StorageMode>::Stored<EagerVec<PcoVec<DifficultyEpoch, T>>>,
<M as StorageMode>::Stored<EagerVec<PcoVec<Halving, T>>>,
<M as StorageMode>::Stored<EagerVec<PcoVec<Epoch, T>>>,
>,
)
where
@@ -68,7 +68,7 @@ where
year1: per_period!(),
year10: per_period!(),
halving: per_period!(),
difficulty: per_period!(),
epoch: per_period!(),
}))
}
@@ -110,7 +110,7 @@ where
period!(year1);
period!(year10);
period!(halving);
period!(difficulty);
period!(epoch);
Ok(())
}
@@ -157,7 +157,7 @@ where
period!(year1);
period!(year10);
period!(halving);
period!(difficulty);
period!(epoch);
Ok(())
}
@@ -204,7 +204,7 @@ where
period!(year1);
period!(year10);
period!(halving);
period!(difficulty);
period!(epoch);
Ok(())
}
@@ -1,6 +1,6 @@
use brk_traversable::Traversable;
use brk_types::{
Day1, Day3, DifficultyEpoch, HalvingEpoch, Hour1, Hour4, Hour12, Minute10, Minute30, Month1,
Day1, Day3, Epoch, Halving, Hour1, Hour4, Hour12, Minute10, Minute30, Month1,
Month3, Month6, Version, Week1, Year1, Year10,
};
use derive_more::{Deref, DerefMut};
@@ -27,8 +27,8 @@ pub struct LazyEagerIndexes<T, S>(
LazyVecFrom1<Month6, T, Month6, S>,
LazyVecFrom1<Year1, T, Year1, S>,
LazyVecFrom1<Year10, T, Year10, S>,
LazyVecFrom1<HalvingEpoch, T, HalvingEpoch, S>,
LazyVecFrom1<DifficultyEpoch, T, DifficultyEpoch, S>,
LazyVecFrom1<Halving, T, Halving, S>,
LazyVecFrom1<Epoch, T, Epoch, S>,
>,
)
where
@@ -70,7 +70,7 @@ where
year1: period!(year1),
year10: period!(year10),
halving: period!(halving),
difficulty: period!(difficulty),
epoch: period!(epoch),
})
}
}
@@ -1,6 +1,6 @@
use brk_traversable::Traversable;
use brk_types::{
Day1, Day3, DifficultyEpoch, HalvingEpoch, Height, Hour1, Hour4, Hour12, Minute10, Minute30,
Day1, Day3, Epoch, Halving, Height, Hour1, Hour4, Hour12, Minute10, Minute30,
Month1, Month3, Month6, Version, Week1, Year1, Year10,
};
use schemars::JsonSchema;
@@ -29,8 +29,8 @@ where
pub month6: LazyVecFrom1<Month6, T, Month6, Month6>,
pub year1: LazyVecFrom1<Year1, T, Year1, Year1>,
pub year10: LazyVecFrom1<Year10, T, Year10, Year10>,
pub halving: LazyVecFrom1<HalvingEpoch, T, HalvingEpoch, HalvingEpoch>,
pub difficulty: LazyVecFrom1<DifficultyEpoch, T, DifficultyEpoch, DifficultyEpoch>,
pub halving: LazyVecFrom1<Halving, T, Halving, Halving>,
pub epoch: LazyVecFrom1<Epoch, T, Epoch, Epoch>,
}
impl<T: VecValue + Formattable + Serialize + JsonSchema> ConstantVecs<T> {
@@ -50,8 +50,8 @@ impl<T: VecValue + Formattable + Serialize + JsonSchema> ConstantVecs<T> {
+ UnaryTransform<Month6, T>
+ UnaryTransform<Year1, T>
+ UnaryTransform<Year10, T>
+ UnaryTransform<HalvingEpoch, T>
+ UnaryTransform<DifficultyEpoch, T>,
+ UnaryTransform<Halving, T>
+ UnaryTransform<Epoch, T>,
{
macro_rules! period {
($idx:ident) => {
@@ -79,7 +79,7 @@ impl<T: VecValue + Formattable + Serialize + JsonSchema> ConstantVecs<T> {
year1: period!(year1),
year10: period!(year10),
halving: period!(halving),
difficulty: period!(difficulty),
epoch: period!(epoch),
}
}
}
@@ -1,6 +1,6 @@
use brk_traversable::Traversable;
use brk_types::{
Day1, Day3, DifficultyEpoch, FromCoarserIndex, HalvingEpoch, Height, Hour1, Hour4, Hour12,
Day1, Day3, Epoch, FromCoarserIndex, Halving, Height, Hour1, Hour4, Hour12,
Minute10, Minute30, Month1, Month3, Month6, Version, Week1, Year1, Year10,
};
use derive_more::{Deref, DerefMut};
@@ -32,8 +32,8 @@ pub struct Resolutions<T>(
LazyAggVec<Month6, Option<T>, Height, Height, T>,
LazyAggVec<Year1, Option<T>, Height, Height, T>,
LazyAggVec<Year10, Option<T>, Height, Height, T>,
LazyAggVec<HalvingEpoch, T, Height, HalvingEpoch>,
LazyAggVec<DifficultyEpoch, T, Height, DifficultyEpoch>,
LazyAggVec<Halving, T, Height, Halving>,
LazyAggVec<Epoch, T, Height, Epoch>,
>,
)
where
@@ -128,7 +128,7 @@ where
year1: period!(year1),
year10: period!(year10),
halving: epoch!(halving),
difficulty: epoch!(difficulty),
epoch: epoch!(epoch),
})
}
}
@@ -1,6 +1,6 @@
use brk_traversable::Traversable;
use brk_types::{
Day1, Day3, DifficultyEpoch, HalvingEpoch, Height, Hour1, Hour4, Hour12, Minute10, Minute30,
Day1, Day3, Epoch, Halving, Height, Hour1, Hour4, Hour12, Minute10, Minute30,
Month1, Month3, Month6, Version, Week1, Year1, Year10,
};
use derive_more::{Deref, DerefMut};
@@ -34,8 +34,8 @@ pub struct DerivedResolutions<T, S1T = T>(
LazyTransformLast<Month6, Option<T>, Option<S1T>>,
LazyTransformLast<Year1, Option<T>, Option<S1T>>,
LazyTransformLast<Year10, Option<T>, Option<S1T>>,
LazyTransformLast<HalvingEpoch, T, S1T>,
LazyTransformLast<DifficultyEpoch, T, S1T>,
LazyTransformLast<Halving, T, S1T>,
LazyTransformLast<Epoch, T, S1T>,
>,
)
where
@@ -110,7 +110,7 @@ where
year1: period!(year1),
year10: period!(year10),
halving: epoch!(halving),
difficulty: epoch!(difficulty),
epoch: epoch!(epoch),
})
}
@@ -154,7 +154,7 @@ where
year1: period!(year1),
year10: period!(year10),
halving: epoch!(halving),
difficulty: epoch!(difficulty),
epoch: epoch!(epoch),
})
}
}
@@ -1,5 +1,5 @@
use brk_types::{
Close, Day1, Day3, DifficultyEpoch, HalvingEpoch, Height, High, Hour1, Hour4, Hour12, Low,
Close, Day1, Day3, Epoch, Halving, Height, High, Hour1, Hour4, Hour12, Low,
Minute10, Minute30, Month1, Month3, Month6, OHLCCents, OHLCDollars, OHLCSats, Open, StoredU64,
Week1, Year1, Year10,
};
@@ -114,16 +114,16 @@ impl UnaryTransform<Year10, StoredU64> for BlockCountTarget {
}
}
impl UnaryTransform<HalvingEpoch, StoredU64> for BlockCountTarget {
impl UnaryTransform<Halving, StoredU64> for BlockCountTarget {
#[inline(always)]
fn apply(_: HalvingEpoch) -> StoredU64 {
fn apply(_: Halving) -> StoredU64 {
StoredU64::from(TARGET_BLOCKS_PER_HALVING)
}
}
impl UnaryTransform<DifficultyEpoch, StoredU64> for BlockCountTarget {
impl UnaryTransform<Epoch, StoredU64> for BlockCountTarget {
#[inline(always)]
fn apply(_: DifficultyEpoch) -> StoredU64 {
fn apply(_: Epoch) -> StoredU64 {
StoredU64::from(2016u64)
}
}