]> Untitled Git - bdk/commitdiff
Deprecate Database::flush() function
authorSteve Myers <steve@notmandatory.org>
Sat, 2 Apr 2022 16:52:44 +0000 (09:52 -0700)
committerSteve Myers <steve@notmandatory.org>
Tue, 12 Apr 2022 21:16:09 +0000 (14:16 -0700)
The Database::flush() function is only needed for the sled database on mobile, instead for mobile use the sqlite database.

CHANGELOG.md
src/database/any.rs
src/database/mod.rs

index 642bcbd0371ca4557290551c0a5a6c0dd7a994a7..3b43faf361d2d58bcd3fda75085dee233f1c8485 100644 (file)
@@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
 
 - Add `sqlite-bundled` feature for deployments that need a bundled version of sqlite, ie. for mobile platforms.
 - Added `Wallet::get_signers()`, `Wallet::descriptor_checksum()` and `Wallet::get_address_validators()`, exposed the `AsDerived` trait.
+- Deprecate `database::Database::flush()`, the function is only needed for the sled database on mobile, instead for mobile use the sqlite database.
 
 ## [v0.17.0] - [v0.16.1]
 
index c4c74dc70c32186ba12e770ed29888697c9fa0e1..b370ded99bcd88a3c7acd498cc0e02e6dde7c0d0 100644 (file)
@@ -61,6 +61,7 @@ macro_rules! impl_from {
 
 macro_rules! impl_inner_method {
     ( $enum_name:ident, $self:expr, $name:ident $(, $args:expr)* ) => {
+        #[allow(deprecated)]
         match $self {
             $enum_name::Memory(inner) => inner.$name( $($args, )* ),
             #[cfg(feature = "key-value-db")]
index ab2fa9b24c2d5dfeb0df7f594ee24da34f2fdbbe..8141ede4fcd404e8cfdc34103a529066ef7cbecd 100644 (file)
@@ -159,6 +159,10 @@ 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>;
 }