Page MenuHomePhabricator

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

Authored by deadalnix on Jan 7 2020, 15:37.

Details

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

Diff Detail

Repository
rABC Bitcoin ABC
Branch
pr15235
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 8763
Build 15508: Default Diff Build & Tests
Build 15507: arc lint + arc unit

Event Timeline

Fabien requested changes to this revision.Jan 8 2020, 08:19
Fabien added a subscriber: Fabien.
Fabien added inline comments.
src/wallet/rpcdump.cpp
117

Good catch !

727

Nit: comment on it's own line

732

Nit: use c++ constructor

738

Dito

761

Braces

769

Nit: c++ constructor

This revision now requires changes to proceed.Jan 8 2020, 08:19
Fabien added inline comments.
src/wallet/rpcdump.cpp
677 ↗(On Diff #15244)

Slightly out of scope, but while you're at it there these casts can also be constructors

This revision is now accepted and ready to land.Jan 9 2020, 09:11