Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify wallet persistence #1547

Merged

Commits on Aug 15, 2024

  1. feat(wallet)!: introduce WalletPersister

    This replaces `bdk_chain::PersistWith` which wanted to persist anything
    (not only `Wallet`), hence, requiring a whole bunch of generic
    parameters.
    
    Having `WalletPersister` dedicated to persisting `Wallet` simplifies the
    trait by a lot.
    
    In addition, `AsyncWalletPersister` has proper lifetime bounds whereas
    `bdk_chain::PersistAsyncWith` did not.
    evanlinjin committed Aug 15, 2024
    Configuration menu
    Copy the full SHA
    039622f View commit details
    Browse the repository at this point in the history
  2. feat(chain,wallet)!: publicize .init_sqlite_tables changeset methods

    Changeset methods `.persist_to_sqlite` and `from_sqlite` no longer
    internally call `.init_sqlite_tables`. Instead, it is up to the caller
    to call `.init_sqlite_tables` beforehand.
    
    This allows us to utilize `WalletPersister::initialize`, instead of
    calling `.init_sqlite_tables` every time we persist/load.
    evanlinjin committed Aug 15, 2024
    Configuration menu
    Copy the full SHA
    06a9d6c View commit details
    Browse the repository at this point in the history
  3. feat(wallet)!: remove dependency on bdk_chain::Staged

    Introduce `Wallet::staged_mut` method.
    evanlinjin committed Aug 15, 2024
    Configuration menu
    Copy the full SHA
    a9c5f76 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    0616057 View commit details
    Browse the repository at this point in the history
  5. feat(wallet)!: add persister (P) type param to PersistedWallet<P>

    This forces the caller to use the same persister type that they used for
    loading/creating when calling `.persist` on `PersistedWallet`.
    
    This is not totally fool-proof since we can have multiple instances of
    the same persister type persisting to different databases. However, it
    does further enforce some level of safety.
    evanlinjin committed Aug 15, 2024
    Configuration menu
    Copy the full SHA
    9600293 View commit details
    Browse the repository at this point in the history

Commits on Aug 19, 2024

  1. Configuration menu
    Copy the full SHA
    340808e View commit details
    Browse the repository at this point in the history