Skip to content

Commit

Permalink
wip: add persisted ADR
Browse files Browse the repository at this point in the history
  • Loading branch information
ValuedMammal committed Sep 5, 2024
1 parent a18029b commit 96997d2
Showing 1 changed file with 69 additions and 0 deletions.
69 changes: 69 additions & 0 deletions docs/adr/0002_persisted.md
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 -->

0 comments on commit 96997d2

Please sign in to comment.