Remove database initialization calls from common API.
This commit is contained in:
parent
903ef58ec6
commit
c60b9d3ece
|
@ -29,22 +29,6 @@ pub trait DBOps {
|
||||||
type TxRef: Copy;
|
type TxRef: Copy;
|
||||||
type UpdateOps: DBUpdate<Error = Self::Error, NoteRef = Self::NoteRef, TxRef = Self::TxRef>;
|
type UpdateOps: DBUpdate<Error = Self::Error, NoteRef = Self::NoteRef, TxRef = Self::TxRef>;
|
||||||
|
|
||||||
fn init_db(&self) -> Result<(), Self::Error>;
|
|
||||||
|
|
||||||
fn init_account_storage<P: consensus::Parameters>(
|
|
||||||
&self,
|
|
||||||
params: &P,
|
|
||||||
extfvks: &[ExtendedFullViewingKey],
|
|
||||||
) -> Result<(), Self::Error>;
|
|
||||||
|
|
||||||
fn init_block_storage(
|
|
||||||
&self,
|
|
||||||
height: BlockHeight,
|
|
||||||
hash: BlockHash,
|
|
||||||
time: u32, //TODO: Newtype!
|
|
||||||
sapling_tree: &[u8], //TODO: Newtype!
|
|
||||||
) -> Result<(), Self::Error>;
|
|
||||||
|
|
||||||
fn block_height_extrema(&self) -> Result<Option<(BlockHeight, BlockHeight)>, Self::Error>;
|
fn block_height_extrema(&self) -> Result<Option<(BlockHeight, BlockHeight)>, Self::Error>;
|
||||||
|
|
||||||
fn get_target_and_anchor_heights(
|
fn get_target_and_anchor_heights(
|
||||||
|
|
|
@ -80,28 +80,6 @@ impl<'a> DBOps for &'a DataConnection {
|
||||||
type TxRef = i64;
|
type TxRef = i64;
|
||||||
type UpdateOps = DataConnStmtCache<'a>;
|
type UpdateOps = DataConnStmtCache<'a>;
|
||||||
|
|
||||||
fn init_db(&self) -> Result<(), Self::Error> {
|
|
||||||
wallet::init::init_data_database(self).map_err(SqliteClientError::from)
|
|
||||||
}
|
|
||||||
|
|
||||||
fn init_account_storage<P: consensus::Parameters>(
|
|
||||||
&self,
|
|
||||||
params: &P,
|
|
||||||
extfvks: &[ExtendedFullViewingKey],
|
|
||||||
) -> Result<(), Self::Error> {
|
|
||||||
wallet::init::init_accounts_table(self, params, extfvks)
|
|
||||||
}
|
|
||||||
|
|
||||||
fn init_block_storage(
|
|
||||||
&self,
|
|
||||||
height: BlockHeight,
|
|
||||||
hash: BlockHash,
|
|
||||||
time: u32,
|
|
||||||
sapling_tree: &[u8],
|
|
||||||
) -> Result<(), Self::Error> {
|
|
||||||
wallet::init::init_blocks_table(self, height, hash, time, sapling_tree)
|
|
||||||
}
|
|
||||||
|
|
||||||
fn block_height_extrema(&self) -> Result<Option<(BlockHeight, BlockHeight)>, Self::Error> {
|
fn block_height_extrema(&self) -> Result<Option<(BlockHeight, BlockHeight)>, Self::Error> {
|
||||||
wallet::block_height_extrema(self).map_err(SqliteClientError::from)
|
wallet::block_height_extrema(self).map_err(SqliteClientError::from)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue