use brk_error::Result;
use brk_types::{Cents, Height, Indexes, StoredU64, Version};
use vecdb::{Exit, ReadableVec};
use crate::prices;
pub trait DynCohortVecs: Send + Sync {
fn min_stateful_len(&self) -> usize;
fn reset_state_starting_height(&mut self);
fn import_state(&mut self, starting_height: Height) -> Result<Height>;
fn validate_computed_versions(&mut self, base_version: Version) -> Result<()>;
fn push_state(&mut self, height: Height);
fn push_unrealized_state(&mut self, height_price: Cents);
fn compute_rest_part1(
&mut self,
prices: &prices::Vecs,
starting_indexes: &Indexes,
exit: &Exit,
) -> Result<()>;
fn write_state(&mut self, height: Height, cleanup: bool) -> Result<()>;
fn reset_cost_basis_data_if_needed(&mut self) -> Result<()>;
fn reset_single_iteration_values(&mut self);
}
pub trait CohortVecs: DynCohortVecs {
fn compute_from_stateful(
&mut self,
starting_indexes: &Indexes,
others: &[&Self],
exit: &Exit,
) -> Result<()>;
fn compute_rest_part2(
&mut self,
prices: &prices::Vecs,
starting_indexes: &Indexes,
all_utxo_count: &impl ReadableVec<Height, StoredU64>,
exit: &Exit,
) -> Result<()>;
}