Rename ConfirmationTime to BlockTime

This commit is contained in:
Alekos Filini
2021-11-03 16:05:30 +00:00
parent 3e5bb077ac
commit 2c77329333
12 changed files with 51 additions and 44 deletions

View File

@@ -65,7 +65,7 @@ pub trait BatchOperations {
/// Store the last derivation index for a given keychain.
fn set_last_index(&mut self, keychain: KeychainKind, value: u32) -> Result<(), Error>;
/// Store the sync time in terms of block height and timestamp
fn set_last_sync_time(&mut self, last_sync_time: ConfirmationTime) -> Result<(), Error>;
fn set_last_sync_time(&mut self, last_sync_time: BlockTime) -> Result<(), Error>;
/// Delete a script_pubkey given the keychain and its child number.
fn del_script_pubkey_from_path(
@@ -94,7 +94,7 @@ pub trait BatchOperations {
/// Reset the last sync time to `None`
///
/// Returns the removed value
fn del_last_sync_time(&mut self) -> Result<Option<ConfirmationTime>, Error>;
fn del_last_sync_time(&mut self) -> Result<Option<BlockTime>, Error>;
}
/// Trait for reading data from a database
@@ -141,7 +141,7 @@ pub trait Database: BatchOperations {
/// Return the last defivation index for a keychain.
fn get_last_index(&self, keychain: KeychainKind) -> Result<Option<u32>, Error>;
/// Return the last sync time, if present
fn get_last_sync_time(&self) -> Result<Option<ConfirmationTime>, Error>;
fn get_last_sync_time(&self) -> Result<Option<BlockTime>, Error>;
/// Increment the last derivation index for a keychain and return it
///
@@ -333,7 +333,7 @@ pub mod test {
received: 1337,
sent: 420420,
fee: Some(140),
confirmation_time: Some(ConfirmationTime {
confirmation_time: Some(BlockTime {
timestamp: 123456,
height: 1000,
}),
@@ -388,7 +388,7 @@ pub mod test {
pub fn test_last_sync_time<D: Database>(mut tree: D) {
assert!(tree.get_last_sync_time().unwrap().is_none());
tree.set_last_sync_time(ConfirmationTime {
tree.set_last_sync_time(BlockTime {
height: 100,
timestamp: 1000,
})