-
Notifications
You must be signed in to change notification settings - Fork 38.7k
wallet: Introduce and use DummyDatabase instead of dummy BerkeleyDatabase #19102
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
Conversation
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsReviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
|
Concept ACK Inspired by |
|
Concept ACK, |
|
Do we lose testing of bdb this way? |
No. |
|
Could consider moving new classes to src/wallet/test/ since they are only used to speed up unit tests and it would be confusing if they were ever used in real code |
SalvageWallet uses DummyDatabase for a dummy wallet. |
b6b5a2f to
fa1a8e6
Compare
ryanofsky
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code review ACK 1937a88a76548979da8559fd3e959fda7a569901 last 3 commits. Easy review and nice cleanup
- 23f633c19c65957f0233ec2b2c1a5555006abe37 Introduce DummyDatabase and use it in the tests (5/7)
- 53c1f553a13077782a6bdf28d186467d320af74f Remove BDB dummy databases (6/7)
- 1937a88a76548979da8559fd3e959fda7a569901 walletdb: Ensure that having no database handle is a failure (7/7)
ryanofsky
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code review ACK d93adba3f9d3fde4c0a79a62b13e7759fb892466. No changes since last review other than rebase.
Previously having no database handle could still be considered a success when BerkeleyDatabase and BerkeleyBatch were used for dummy database things. With dedicated DummyDatabase and DummyBatch classes now, these should fail.
|
utACK 0fcff54 |
|
crACK 0fcff54 🚈 Show signature and timestampSignature: Timestamp of file with hash |
Summary: Note: the `#include <util/memory.h>` is unnecessary because we use `std::make_unique` rather than `MakeUnique`. This is a backport of [[bitcoin/bitcoin#19102 | core#19102]] [1/3] bitcoin/bitcoin@0103d64 Depends on D10038 Test Plan: `ninja all check-all` Reviewers: #bitcoin_abc, majcosta Reviewed By: #bitcoin_abc, majcosta Differential Revision: https://reviews.bitcoinabc.org/D10048
Summary: This is a backport of [[bitcoin/bitcoin#19102 | core#19102]] [2/3] bitcoin/bitcoin@da039d2 Depends on D10048 Test Plan: `ninja all check-all` Reviewers: #bitcoin_abc, majcosta Reviewed By: #bitcoin_abc, majcosta Differential Revision: https://reviews.bitcoinabc.org/D10049
Summary: Previously having no database handle could still be considered a success when BerkeleyDatabase and BerkeleyBatch were used for dummy database things. With dedicated DummyDatabase and DummyBatch classes now, these should fail. This is a backport of [[bitcoin/bitcoin#19102 | core#19102]] [3/3] bitcoin/bitcoin@0fcff54 Depends on D10049 Test Plan: `ninja all check-all` Reviewers: #bitcoin_abc, majcosta Reviewed By: #bitcoin_abc, majcosta Differential Revision: https://reviews.bitcoinabc.org/D10050
In the unit tests, we use a dummy
WalletDatabasewhich does nothing and always returns true. This is currently implemented by creating aBerkeleyDatabasein dummy mode. This PR instead adds aDummyDatabaseclass which does nothing and never fails for use in the tests.CreateDummyWalletDatabaseis changed to return thisDummyDatabaseandBerkeleyDatabaseis cleaned up to remove all of the checks forIsDummy.Based on
WalletDatabaseabstract class introduced in #19334