Page MenuHomePhabricator

Disallow using addresses in createmultisig
ClosedPublic

Authored by deadalnix on Nov 2 2018, 22:36.

Details

Summary

Make createmultisig only accept public keys with the old functionality
marked as deprecated.

Splits _createmultisig_redeemscript into two functions, one for
getting public keys from UniValue and one for getting addresses
from UniValue and then their respective public keys. The one for
retrieving address's public keys is located in rpcwallet.cpp

Adds a test to deprecated_rpc.py for testing the deprecation.

Update the tests to give only public keys to createmultisig.

Depends on D1967 and D2001

Backport of Core PR11415

Test Plan
make VERBOSE=1 check && ./test/functional/test_runner.py

Diff Detail

Repository
rABC Bitcoin ABC
Branch
D2002
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 5696
Build 9454: Bitcoin ABC Buildbot (legacy)
Build 9453: arc lint + arc unit

Event Timeline

Rebase on IsDeprecatedRPCEnabled parameter update

deadalnix added a reviewer: schancel.

Rebase, fix build, fix tests

Fabien requested changes to this revision.Jan 9 2019, 16:55
Fabien added a subscriber: Fabien.

Update version in the comments:

  • Deprecate from v0.19
  • Remove from v0.20

Also add an entry in the release note

This revision now requires changes to proceed.Jan 9 2019, 16:55

Put that diff back in shape

Fabien requested changes to this revision.Apr 17 2019, 18:18

Can you rename deprecated_rpc.py to rpc_deprecated.py to follow the new naming convention ?

doc/release-notes.md
12 ↗(On Diff #8094)

Nit: Using addresses in createmultisig is now deprectated. Use -deprecatedrpc=createmultisig to get the old behavior.

src/rpc/misc.cpp
18 ↗(On Diff #8094)

Can you use rpc/util.h here to avoid confusion ?

311 ↗(On Diff #8094)

The removal of the addresses mention in the help is missing from the PR

358 ↗(On Diff #8094)

Should braces be added for the else above in this case ?

src/util.cpp
13 ↗(On Diff #8094)

This seems unrelated ?

src/wallet/rpcwallet.cpp
1397 ↗(On Diff #8094)

v0.16 => v0.19
Also missing an entry in the release notes for this deprecation, and maybe a test case in rpc_deprecated.py.

This revision now requires changes to proceed.Apr 17 2019, 18:18

Update with whatever I have

This was in pretty bad shape, I'll run a round of review myself before asking other to do so.

Update version numbers as expected and address other comments.

Fabien requested changes to this revision.May 6 2019, 13:53

The original PR contains tabs alignment fixes on the rpc helps which are not ported here, I'm not sure if this is deliberate or not. I leave this up to you.

doc/release-notes.md
6

Nit: o => to, add some backquotes

src/rpc/misc.cpp
352

unsigned int => size_t

src/wallet/rpcwallet.cpp
1413

unsigned int => size_t

This revision now requires changes to proceed.May 6 2019, 13:53
This revision is now accepted and ready to land.May 6 2019, 21:05
This revision was automatically updated to reflect the committed changes.