bdk icon indicating copy to clipboard operation
bdk copied to clipboard

Delegate rustqlite connection persister to transaction persister

Open casey opened this issue 9 months ago • 2 comments

This is a small refactor that hopefully improves readability slightly.

Currently, the rusqlite connection persister and transaction persister are entirely different implementations, even though the connection persister just creates a new transaction, does what the transaction persister does, and then commits.

This makes the relationship a little clearly by explicitly delegating the connection persister implementation to the transaction persister implementation, so the reader doesn't need to manually compare the two implementations to see how they're related.

casey avatar Mar 01 '25 19:03 casey

Thanks for the PR! I would argue that the original was clearer because it more directly expressed what was happening, instead of having the reader go through one more layer of methods.

evanlinjin avatar Mar 02 '25 20:03 evanlinjin

I can see that. It's a trade off: Either you see what it's doing, or you see that it's the same as the other persister. In my opinion, knowing that it's the same as the other persister is more valuable.

casey avatar Mar 02 '25 23:03 casey

Closing as it is now stale.

I opened bitcoindevkit/bdk_wallet#279.

ValuedMammal avatar Jul 14 '25 19:07 ValuedMammal