Page MenuHomePhabricator

[avalanche] Add an RPC to build a delegation
ClosedPublic

Authored by Fabien on Mar 26 2021, 15:22.

Details

Reviewers
PiRK
Mengerian
Group Reviewers
Restricted Project
Commits
rABC2d08db5fe0ac: [avalanche] Add an RPC to build a delegation
Summary

This RPC makes it possible to build a delegation for a proof and stack
up delegation levels.

Test Plan
./test/functional/test_runner.py abc_rpc_avalancheproof

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Fabien requested review of this revision.Mar 26 2021, 15:22

Add missing argument names in the RPC binding table

PiRK added a subscriber: PiRK.

Code LGTM. I added an inline comment regarding the RPCHelp, but as I'm not 100% sure about my english I'm not blocking on it.

src/rpc/avalanche.cpp
221 ↗(On Diff #28035)

I would change this to "The public key to delegate the proof to."

Or "The public key to which to delegate the proof."

This revision is now accepted and ready to land.Mar 29 2021, 10:49

Just some minor comments.

src/rpc/avalanche.cpp
224 ↗(On Diff #28043)

I find this a bit confusing to read, since the output is also a delegation....
Maybe some words to distinguish it like "delegation on level up" or "parent delegation" or similar.

275 ↗(On Diff #28043)

Can this error have a different message than the previous one?

src/rpc/avalanche.cpp
275 ↗(On Diff #28043)

Sure, but please not that the error is unreachable for now (the previous checks would have fail already).

Update the doc, fix the example, use a different error message

Looks pretty good, I added some more minor wording nits though.

src/rpc/avalanche.cpp
219 ↗(On Diff #28052)

Maybe something like this:

"The private key in base58-encoding. This private key must match If a parent delegation (if supplied), or the proof master public key."

226 ↗(On Diff #28052)

Minor nit: I'd put the comment about the private key with the private key item, rather than here, since it can also apply to the Proof master public key.

This revision was automatically updated to reflect the committed changes.