Page MenuHomePhabricator

Add loadwallet and createwallet RPC load_on_startup options
ClosedPublic

Authored by PiRK on Sep 22 2021, 14:36.

Details

Summary

This maintains a persistent list of wallets stored in settings that will
automatically be loaded on startup. Being able to load a wallet automatically
on startup will be more useful in the GUI when the option to create wallets is
added in #15006, but it's reasonable to expose this feature by RPC as well.

This is a backport of core#15937

I had to include the RPCOverloadWrapper.createwallet method that should normally be added in D8671 in test_node.py. D8671 is going to take a bit longer to be backported, and the inclusion of CreateWallet here does not break anything or change any behavior, as descriptors will remain False for now.
See D9101 for why if load_on_startup is None: load_on_startup = 'null' is necessary.

Test Plan

ninja all check-all

To be sure the change in test_node.py didn't break any test:
ninja check-functional-extended

Event Timeline

PiRK requested review of this revision.Sep 22 2021, 14:36
Fabien requested changes to this revision.Sep 22 2021, 16:00
Fabien added a subscriber: Fabien.
Fabien added inline comments.
doc/release-notes.md
23

newline

This revision now requires changes to proceed.Sep 22 2021, 16:00

rebase onto master, fix conflict in release-notes and add missing newline

Tail of the build log:

rpc_preciousblock.py                    | ✓ Passed  | 1 s
rpc_psbt.py                             | ✓ Passed  | 32 s
rpc_rawtransaction.py                   | ✓ Passed  | 12 s
rpc_scantxoutset.py                     | ✓ Passed  | 3 s
rpc_setban.py                           | ✓ Passed  | 2 s
rpc_signmessage.py                      | ✓ Passed  | 1 s
rpc_signrawtransaction.py               | ✓ Passed  | 1 s
rpc_txoutproof.py                       | ✓ Passed  | 2 s
rpc_uptime.py                           | ✓ Passed  | 1 s
rpc_users.py                            | ✓ Passed  | 5 s
rpc_whitelist.py                        | ✓ Passed  | 1 s
tool_wallet.py                          | ✓ Passed  | 4 s
wallet_abandonconflict.py               | ✓ Passed  | 9 s
wallet_address_types.py                 | ✓ Passed  | 13 s
wallet_avoidreuse.py                    | ✓ Passed  | 4 s
wallet_backup.py                        | ✓ Passed  | 25 s
wallet_balance.py                       | ✓ Passed  | 19 s
wallet_basic.py                         | ✓ Passed  | 18 s
wallet_coinbase_category.py             | ✓ Passed  | 1 s
wallet_create_tx.py                     | ✓ Passed  | 5 s
wallet_createwallet.py                  | ✓ Passed  | 2 s
wallet_createwallet.py --usecli         | ✓ Passed  | 3 s
wallet_descriptor.py                    | ✓ Passed  | 6 s
wallet_disable.py                       | ✓ Passed  | 1 s
wallet_dump.py                          | ✓ Passed  | 4 s
wallet_encryption.py                    | ✓ Passed  | 5 s
wallet_hd.py                            | ✓ Passed  | 6 s
wallet_import_rescan.py                 | ✓ Passed  | 4 s
wallet_import_with_label.py             | ✓ Passed  | 1 s
wallet_importdescriptors.py             | ✓ Passed  | 5 s
wallet_importmulti.py                   | ✓ Passed  | 3 s
wallet_importprunedfunds.py             | ✓ Passed  | 2 s
wallet_keypool.py                       | ✓ Passed  | 3 s
wallet_keypool_topup.py                 | ✓ Passed  | 2 s
wallet_labels.py                        | ✓ Passed  | 1 s
wallet_listreceivedby.py                | ✓ Passed  | 14 s
wallet_listsinceblock.py                | ✓ Passed  | 3 s
wallet_listtransactions.py              | ✓ Passed  | 13 s
wallet_multiwallet.py                   | ✓ Passed  | 40 s
wallet_multiwallet.py --usecli          | ✓ Passed  | 12 s
wallet_reorgsrestore.py                 | ✓ Passed  | 3 s
wallet_resendwallettransactions.py      | ✓ Passed  | 17 s
wallet_startup.py                       | ✓ Passed  | 2 s
wallet_txn_clone.py                     | ✓ Passed  | 2 s
wallet_txn_clone.py --mineblock         | ✓ Passed  | 3 s
wallet_txn_doublespend.py               | ✓ Passed  | 1 s
wallet_txn_doublespend.py --mineblock   | ✓ Passed  | 3 s
wallet_watchonly.py                     | ✓ Passed  | 1 s
wallet_watchonly.py --usecli            | ✓ Passed  | 1 s

ALL                                     | ✓ Passed  | 983 s (accumulated) 
Runtime: 198 s

----------------------------------------------------------------------
Ran 8 tests in 0.009s

OK

ninja: build stopped: cannot make progress due to previous errors.
Build build-diff failed with exit code 1

rebase and fix another conflict in release notes.

Fabien requested changes to this revision.Sep 27 2021, 07:27
Fabien added inline comments.
doc/release-notes.md
10 ↗(On Diff #30136)

Keep the line breaks consistent

This revision now requires changes to proceed.Sep 27 2021, 07:27

fix newline consistency in release-notes.md

This revision is now accepted and ready to land.Sep 27 2021, 12:06