use massa_async_pool::AsyncPool;
use massa_db_exports::{DBBatch, ShareableMassaDBController};
use massa_deferred_calls::DeferredCallRegistry;
use massa_executed_ops::ExecutedDenunciations;
use massa_hash::Hash;
use massa_ledger_exports::LedgerController;
use massa_models::{operation::OperationId, slot::Slot};
use massa_pos_exports::PoSFinalState;
use massa_versioning::versioning::MipStore;
use crate::{FinalStateError, StateChanges};
#[cfg_attr(feature = "test-exports", mockall::automock)]
pub trait FinalStateController: Send + Sync {
fn get_fingerprint(&self) -> Hash;
fn get_slot(&self) -> Slot;
fn get_execution_trail_hash(&self) -> Hash;
fn reset(&mut self);
fn compute_initial_draws(&mut self) -> Result<(), FinalStateError>;
fn finalize(&mut self, slot: Slot, changes: StateChanges);
fn recompute_caches(&mut self);
fn is_db_valid(&self) -> bool;
fn init_execution_trail_hash_to_batch(&mut self, batch: &mut DBBatch);
#[allow(clippy::borrowed_box)]
fn get_ledger(&self) -> &Box<dyn LedgerController>;
fn get_ledger_mut(&mut self) -> &mut Box<dyn LedgerController>;
fn get_async_pool(&self) -> &AsyncPool;
fn get_pos_state(&self) -> &PoSFinalState;
fn get_pos_state_mut(&mut self) -> &mut PoSFinalState;
fn executed_ops_contains(&self, op_id: &OperationId) -> bool;
fn get_ops_exec_status(&self, batch: &[OperationId]) -> Vec<Option<bool>>;
fn get_executed_denunciations(&self) -> &ExecutedDenunciations;
fn get_database(&self) -> &ShareableMassaDBController;
fn get_last_start_period(&self) -> u64;
fn set_last_start_period(&mut self, last_start_period: u64);
fn get_last_slot_before_downtime(&self) -> &Option<Slot>;
fn set_last_slot_before_downtime(&mut self, last_slot_before_downtime: Option<Slot>);
fn get_mip_store(&self) -> &MipStore;
fn get_mip_store_mut(&mut self) -> &mut MipStore;
fn get_deferred_call_registry(&self) -> &DeferredCallRegistry;
}