]> Untitled Git - bdk/commitdiff
remove Database::flush
authorKaFai Choi <kafai@river.com>
Wed, 23 Mar 2022 03:58:05 +0000 (10:58 +0700)
committerKaFai Choi <kafaicoder@gmail.com>
Wed, 29 Jun 2022 05:39:49 +0000 (12:39 +0700)
CHANGELOG.md
src/database/any.rs
src/database/keyvalue.rs
src/database/memory.rs
src/database/mod.rs
src/database/sqlite.rs

index 7eaf9bffd19bf5398afe75c08b029e6b50f13dca..97fac2669483da52bb5e31489f548ca2b5ec5fb5 100644 (file)
@@ -52,6 +52,7 @@ To decouple the `Wallet` from the `Blockchain` we've made major changes:
 - Stop making a request for the block height when calling `Wallet:new`.
 - Added `SyncOptions` to capture extra (future) arguments to `Wallet::sync`.
 - Removed `max_addresses` sync parameter which determined how many addresses to cache before syncing since this can just be done with `ensure_addresses_cached`.
+- remove `flush` method from the `Database` trait.
 
 ## [v0.16.1] - [v0.16.0]
 
index b370ded99bcd88a3c7acd498cc0e02e6dde7c0d0..bbd9d41a50342e56736d6b8cc9e81be70a431205 100644 (file)
@@ -255,10 +255,6 @@ impl Database for AnyDatabase {
     fn increment_last_index(&mut self, keychain: KeychainKind) -> Result<u32, Error> {
         impl_inner_method!(AnyDatabase, self, increment_last_index, keychain)
     }
-
-    fn flush(&mut self) -> Result<(), Error> {
-        impl_inner_method!(AnyDatabase, self, flush)
-    }
 }
 
 impl BatchOperations for AnyBatch {
index 5baa6c86ad84c958386de55683fb476dad231ba2..c298be36b024a4ec7d5555e4d357e528d4dc4867 100644 (file)
@@ -402,10 +402,6 @@ impl Database for Tree {
             Ok(val)
         })
     }
-
-    fn flush(&mut self) -> Result<(), Error> {
-        Ok(Tree::flush(self).map(|_| ())?)
-    }
 }
 
 impl BatchDatabase for Tree {
index 1c8d1ccace532e4822a01f7dda2ef1e04f793912..4256d2171938fee6cb3065e8c2f0770135b2b707 100644 (file)
@@ -449,10 +449,6 @@ impl Database for MemoryDatabase {
 
         Ok(*value)
     }
-
-    fn flush(&mut self) -> Result<(), Error> {
-        Ok(())
-    }
 }
 
 impl BatchDatabase for MemoryDatabase {
index 80e5a2a58963309ebd709a520815de472dc19224..c7ff17951fcdb1ef40be60aa6f8fbdb846d42880 100644 (file)
@@ -158,13 +158,6 @@ pub trait Database: BatchOperations {
     ///
     /// It should insert and return `0` if not present in the database
     fn increment_last_index(&mut self, keychain: KeychainKind) -> Result<u32, Error>;
-
-    #[deprecated(
-        since = "0.18.0",
-        note = "The flush function is only needed for the sled database on mobile, instead for mobile use the sqlite database."
-    )]
-    /// Force changes to be written to disk
-    fn flush(&mut self) -> Result<(), Error>;
 }
 
 /// Trait for a database that supports batch operations
index fbdf1ad6d223d2d5147d8537cb209a2a508468d8..06ed7e43c05e66da74bd6e017c5920955b79bb90 100644 (file)
@@ -891,10 +891,6 @@ impl Database for SqliteDatabase {
             }
         }
     }
-
-    fn flush(&mut self) -> Result<(), Error> {
-        Ok(())
-    }
 }
 
 impl BatchDatabase for SqliteDatabase {