-
Notifications
You must be signed in to change notification settings - Fork 329
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a18029b
commit 96997d2
Showing
1 changed file
with
69 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
# Introduce `PersistedWallet` | ||
|
||
* Status: accepted | ||
* Deciders: [list everyone involved in the decision] | ||
* Date: 2024-08-19 | ||
|
||
Technical Story: PR [#1547](https://github.com/bitcoindevkit/bdk/pull/1547), [ADR-0001](./0001_persist.md) | ||
|
||
## Context and Problem | ||
|
||
We would like persistence operations to be both safe and ergonomic. It would cumbersome and error prone if users were expected to ask the wallet for a changeset at the correct time and persist it on their own. Considering that the wallet no longer drives its own database, an ideal interface is to have a method on `Wallet` such as `persist` that the user will call and everything will "just work." | ||
|
||
## Decision Drivers | ||
|
||
* [driver 1, e.g., a force, facing concern, …] | ||
* [driver 2, e.g., a force, facing concern, …] | ||
* … <!-- numbers of drivers can vary --> | ||
|
||
## Considered Options | ||
|
||
* [option 1] | ||
* [option 2] | ||
* [option 3] | ||
* … <!-- numbers of options can vary --> | ||
|
||
## Decision Outcome | ||
|
||
Chosen option: Introduce a new type `PersistedWallet` that wraps a BDK `Wallet` and provides a convenient interface for executing persistence operations aided by a `WalletPersister`. | ||
|
||
### Positive Consequences <!-- optional --> | ||
|
||
* [e.g., improvement of quality attribute satisfaction, follow-up decisions required, …] | ||
* … | ||
|
||
### Negative Consequences <!-- optional --> | ||
|
||
* [e.g., compromising quality attribute, follow-up decisions required, …] | ||
* … | ||
|
||
## Pros and Cons of the Options <!-- optional --> | ||
|
||
### [option 1] | ||
|
||
Open questions | ||
|
||
* How does a user know when and how often to call `persist`? (Short answer: whenever we mutate the wallet) | ||
|
||
### [option 2] | ||
|
||
[example | description | pointer to more information | …] <!-- optional --> | ||
|
||
* Good, because [argument a] | ||
* Good, because [argument b] | ||
* Bad, because [argument c] | ||
* … <!-- numbers of pros and cons can vary --> | ||
|
||
### [option 3] | ||
|
||
[example | description | pointer to more information | …] <!-- optional --> | ||
|
||
* Good, because [argument a] | ||
* Good, because [argument b] | ||
* Bad, because [argument c] | ||
* … <!-- numbers of pros and cons can vary --> | ||
|
||
## Links <!-- optional --> | ||
|
||
* [Link type] [Link to ADR] <!-- example: Refined by [ADR-0005](0005-example.md) --> | ||
* … <!-- numbers of links can vary --> |