HomePhabricator

[backport#18727] test: Add CreateWalletFromFile test

Description

[backport#18727] test: Add CreateWalletFromFile test

Summary:
7918c1b019a36a8f9aa55daae422c6b6723b2a39 test: Add CreateWalletFromFile test (Russell Yanofsky)

Pull request description:

Add unit test calling CreateWalletFromFile, which isn't currently called from other unit tests, with some basic checks to make sure it rescans and registers for notifications correctly.

Motivation for this change was to try to write a test that would fail without the early `handleNotifications` call in ef8c6ca60767cac589d98ca57ee33179608ccda8 from https://github.com/bitcoin/bitcoin/pull/16426, but succeed with it:

https://github.com/bitcoin/bitcoin/blob/ef8c6ca60767cac589d98ca57ee33179608ccda8/src/wallet/wallet.cpp#L3978-L3986

However, writing a full test for the race condition that call prevents isn't possible without the locking changes from #16426. So this PR just adds as much test coverage as is possible now.

This new test is also useful for https://github.com/bitcoin/bitcoin/pull/15719, since it detects the stale notifications.transactionAddedToMempool notifications that PR eliminates.

Backport of Core PR18727

Test Plan:

ninja all check check-functional

Reviewers: #bitcoin_abc, PiRK

Reviewed By: #bitcoin_abc, PiRK

Differential Revision: https://reviews.bitcoinabc.org/D9066

Details

Provenance
MarcoFalke <falke.marco@gmail.com>Authored on Apr 29 2020, 19:23
majcostaCommitted on Feb 9 2021, 16:41
majcostaPushed on Feb 9 2021, 16:41
Reviewer
Restricted Project
Differential Revision
D9066: [backport#18727] test: Add CreateWalletFromFile test
Parents
rABCde9e50126c34: [backport#19164] ci: tsan with wallet
Branches
Unknown
Tags
Unknown