Skip to content

Commit e92e5ef

Browse files
committed
refactor: use properly RPCHelpMan for governance RPC voteraw
1 parent 87b3011 commit e92e5ef

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/rpc/governance.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -887,9 +887,9 @@ static RPCHelpMan gobject()
887887
};
888888
}
889889

890-
static UniValue voteraw(const JSONRPCRequest& request)
890+
static RPCHelpMan voteraw()
891891
{
892-
RPCHelpMan{"voteraw",
892+
return RPCHelpMan{"voteraw",
893893
"Compile and relay a governance vote with provided external signature instead of signing vote internally\n",
894894
{
895895
{"mn-collateral-tx-hash", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, ""},
@@ -901,9 +901,9 @@ static UniValue voteraw(const JSONRPCRequest& request)
901901
{"vote-sig", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, ""},
902902
},
903903
RPCResults{},
904-
RPCExamples{""}
905-
}.Check(request);
906-
904+
RPCExamples{""},
905+
[&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue
906+
{
907907
uint256 hashMnCollateralTx(ParseHashV(request.params[0], "mn collateral tx hash"));
908908
int nMnCollateralTxIndex = request.params[1].get_int();
909909
COutPoint outpoint = COutPoint(hashMnCollateralTx, nMnCollateralTxIndex);
@@ -972,6 +972,8 @@ static UniValue voteraw(const JSONRPCRequest& request)
972972
} else {
973973
throw JSONRPCError(RPC_INTERNAL_ERROR, "Error voting : " + exception.GetMessage());
974974
}
975+
},
976+
};
975977
}
976978

977979
static RPCHelpMan getgovernanceinfo()

0 commit comments

Comments
 (0)