-
Notifications
You must be signed in to change notification settings - Fork 36.7k
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
wallet: Introduce and use DummyDatabase instead of dummy BerkeleyDatabase #19102
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
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.
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 d93adba. 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
WalletDatabase
which does nothing and always returns true. This is currently implemented by creating aBerkeleyDatabase
in dummy mode. This PR instead adds aDummyDatabase
class which does nothing and never fails for use in the tests.CreateDummyWalletDatabase
is changed to return thisDummyDatabase
andBerkeleyDatabase
is cleaned up to remove all of the checks forIsDummy
.Based on
WalletDatabase
abstract class introduced in #19334