[database] Wrap BlockTime in another struct to allow adding more

fields in the future
This commit is contained in:
Alekos Filini
2021-11-04 15:38:38 +00:00
parent 2c77329333
commit 5830226216
6 changed files with 103 additions and 88 deletions

View File

@@ -144,8 +144,8 @@ impl BatchOperations for AnyDatabase {
fn set_last_index(&mut self, keychain: KeychainKind, value: u32) -> Result<(), Error> {
impl_inner_method!(AnyDatabase, self, set_last_index, keychain, value)
}
fn set_last_sync_time(&mut self, last_sync_time: BlockTime) -> Result<(), Error> {
impl_inner_method!(AnyDatabase, self, set_last_sync_time, last_sync_time)
fn set_sync_time(&mut self, sync_time: SyncTime) -> Result<(), Error> {
impl_inner_method!(AnyDatabase, self, set_sync_time, sync_time)
}
fn del_script_pubkey_from_path(
@@ -183,8 +183,8 @@ impl BatchOperations for AnyDatabase {
fn del_last_index(&mut self, keychain: KeychainKind) -> Result<Option<u32>, Error> {
impl_inner_method!(AnyDatabase, self, del_last_index, keychain)
}
fn del_last_sync_time(&mut self) -> Result<Option<BlockTime>, Error> {
impl_inner_method!(AnyDatabase, self, del_last_sync_time)
fn del_sync_time(&mut self) -> Result<Option<SyncTime>, Error> {
impl_inner_method!(AnyDatabase, self, del_sync_time)
}
}
@@ -247,8 +247,8 @@ impl Database for AnyDatabase {
fn get_last_index(&self, keychain: KeychainKind) -> Result<Option<u32>, Error> {
impl_inner_method!(AnyDatabase, self, get_last_index, keychain)
}
fn get_last_sync_time(&self) -> Result<Option<BlockTime>, Error> {
impl_inner_method!(AnyDatabase, self, get_last_sync_time)
fn get_sync_time(&self) -> Result<Option<SyncTime>, Error> {
impl_inner_method!(AnyDatabase, self, get_sync_time)
}
fn increment_last_index(&mut self, keychain: KeychainKind) -> Result<u32, Error> {
@@ -281,8 +281,8 @@ impl BatchOperations for AnyBatch {
fn set_last_index(&mut self, keychain: KeychainKind, value: u32) -> Result<(), Error> {
impl_inner_method!(AnyBatch, self, set_last_index, keychain, value)
}
fn set_last_sync_time(&mut self, last_sync_time: BlockTime) -> Result<(), Error> {
impl_inner_method!(AnyBatch, self, set_last_sync_time, last_sync_time)
fn set_sync_time(&mut self, sync_time: SyncTime) -> Result<(), Error> {
impl_inner_method!(AnyBatch, self, set_sync_time, sync_time)
}
fn del_script_pubkey_from_path(
@@ -314,8 +314,8 @@ impl BatchOperations for AnyBatch {
fn del_last_index(&mut self, keychain: KeychainKind) -> Result<Option<u32>, Error> {
impl_inner_method!(AnyBatch, self, del_last_index, keychain)
}
fn del_last_sync_time(&mut self) -> Result<Option<BlockTime>, Error> {
impl_inner_method!(AnyBatch, self, del_last_sync_time)
fn del_sync_time(&mut self) -> Result<Option<SyncTime>, Error> {
impl_inner_method!(AnyBatch, self, del_sync_time)
}
}