use async_trait::async_trait;
use bitcoin::BlockHash;
#[async_trait]
pub trait Store: Send + Sync {
async fn load_cf_tip(&self) -> anyhow::Result<Option<(u32, BlockHash)>>;
async fn save_cf_tip(&self, height: u32, cfheader: BlockHash) -> anyhow::Result<()>;
async fn get_last_scanned(&self) -> anyhow::Result<u32>;
async fn set_last_scanned(&self, height: u32) -> anyhow::Result<()>;
async fn get_birth_height(&self) -> anyhow::Result<Option<u32>> {
Ok(None)
}
async fn set_birth_height(&self, _h: u32) -> anyhow::Result<()> {
Ok(())
}
}
pub mod sqlite_store;
pub use sqlite_store::SqliteStore;