HomePhabricator

[electrum] fix storage.requires_upgrade and test it

Description

[electrum] fix storage.requires_upgrade and test it

Summary:
WalletStorage.requires_upgrade always returned None, which is False. This is clearly a bug introduced when splitting the WalletStorage and JsonDB classes.

Fix it and test it.

This is currently used in the code to guard against loading (and potentially corrupting) old wallets that are not updated to the current format. But this should not happen except in the tests (when manual_upgrades=True is passed to the constructor), as the upgrade is done automatically when initializing a JsonDB class.

Test Plan:
ninja check-electrum

This fails with this test fix and without the code fix.

Reviewers: #bitcoin_abc, bytesofman

Reviewed By: #bitcoin_abc, bytesofman

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

Details

Provenance
PiRKAuthored on Jul 6 2023, 14:28
PiRKPushed on Jul 7 2023, 07:13
Reviewer
Restricted Project
Differential Revision
D14220: [electrum] fix storage.requires_upgrade and test it
Parents
rABC405daef21b36: [electrum] increase the max number of get_merkle requests in the network queue
Branches
Unknown
Tags
Unknown