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
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

schancel created this revision.Nov 2 2018, 22:36
Herald added a reviewer: Restricted Project. · View Herald TranscriptNov 2 2018, 22:36
schancel updated this revision to Diff 5682.Nov 6 2018, 23:58

Rebase on IsDeprecatedRPCEnabled parameter update

schancel edited the summary of this revision. (Show Details)Nov 7 2018, 00:04
deadalnix commandeered this revision.Jan 4 2019, 14:31
deadalnix added a reviewer: schancel.
deadalnix updated this revision to Diff 6499.Jan 4 2019, 14:33

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
deadalnix updated this revision to Diff 8094.Apr 17 2019, 15:12

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
deadalnix updated this revision to Diff 8413.May 6 2019, 12:16

Update with whatever I have

deadalnix planned changes to this revision.May 6 2019, 12:16

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

deadalnix updated this revision to Diff 8414.May 6 2019, 13:15

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 ↗(On Diff #8414)

Nit: o => to, add some backquotes

src/rpc/misc.cpp
352 ↗(On Diff #8414)

unsigned int => size_t

src/wallet/rpcwallet.cpp
1413 ↗(On Diff #8414)

unsigned int => size_t

This revision now requires changes to proceed.May 6 2019, 13:53
deadalnix updated this revision to Diff 8422.May 6 2019, 20:43

Update as per request

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