Page MenuHomePhabricator

rpc: Use RPCHelpMan for check-rpc-mappings linter
ClosedPublic

Authored by PiRK on Jan 4 2022, 14:15.

Details

Reviewers
Fabien
Group Reviewers
Restricted Project
Commits
rABC25e918ce936c: rpc: Use RPCHelpMan for check-rpc-mappings linter
Summary
Test Plan

Update linters:
sudo arc liberate

Add errors in RPCHelpMan and make sure they are detected:

diff --git a/src/rpc/client.cpp b/src/rpc/client.cpp
index 8bb08769ec..770e8272e9 100644
--- a/src/rpc/client.cpp
+++ b/src/rpc/client.cpp
@@ -170,6 +170,7 @@ static const CRPCConvertParam vRPCConvertParams[] = {
     {"buildavalancheproof", 0, "sequence"},
     {"buildavalancheproof", 1, "expiration"},
     {"buildavalancheproof", 3, "stakes"},
+    {"buildavalancheproof", 4, "staks"},
 };

 class CRPCConvertTable {
diff --git a/src/rpc/client.cpp b/src/rpc/client.cpp
index 8bb08769ec..f883869060 100644
--- a/src/rpc/client.cpp
+++ b/src/rpc/client.cpp
@@ -168,7 +168,7 @@ static const CRPCConvertParam vRPCConvertParams[] = {
     // Avalanche
     {"addavalanchenode", 0, "nodeid"},
     {"buildavalancheproof", 0, "sequence"},
-    {"buildavalancheproof", 1, "expiration"},
+    {"buildavalancheproof", 8, "expiration"},
     {"buildavalancheproof", 3, "stakes"},
 };

ninja && test/functional/test_runner.py rpc_help

Diff Detail

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

Event Timeline

PiRK requested review of this revision.Jan 4 2022, 14:15
Fabien added inline comments.
src/rpc/server.cpp
547 ↗(On Diff #31624)

Note that there is #21035 as a follow up

This revision is now accepted and ready to land.Jan 4 2022, 16:01
src/rpc/server.cpp
547 ↗(On Diff #31624)

Thank you, I would have missed it. I will land both PR at the same time to minimize the risk of intermittent CI failure.

You can land it now, it shouldn't be a problem