HomePhabricator

Do not import private keys to wallets with private keys disabled

Description

Do not import private keys to wallets with private keys disabled

Summary:

  • tests: unify RPC argument to cli argument conversion and handle dicts and lists

When running tests with --usecli, unify the conversion from argument objects to
strings using a new function arg_to_cli(). This fixes boolean arguments when
using named arguments.

Also use json.dumps() to get the string values for arguments that are dicts and
lists so that bitcoind's JSON parser does not become confused.

  • Refactor importwallet to extract data from the file and then import

Instead of importing keys and scripts as each line in the file is
read, first extract the data then import them.

  • Do not import private keys to wallets with private keys disabled

This is a backport of Core PR15235

Test Plan:

make check
./test/functional/test_runner.py

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Subscribers: Fabien

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

Details

Provenance
Andrew Chow <achow101-github@achow101.com>Authored on Jan 23 2019, 20:51
deadalnixCommitted on Jan 9 2020, 11:15
deadalnixPushed on Jan 9 2020, 11:15
Reviewer
Restricted Project
Differential Revision
D4843: Do not import private keys to wallets with private keys disabled
Parents
rABC45303b515401: Add pippenger_wnaf for multi-multiplication
Branches
Unknown
Tags
Unknown