refactor: use properly RPCHelpMan for governance RPC getgovernanceinfo

This commit is contained in:
Konstantin Akimov 2024-06-22 02:46:33 +07:00
parent b316be7680
commit 42e0b37cb2
No known key found for this signature in database
GPG Key ID: 2176C4A5D01EA524

View File

@ -1062,9 +1062,9 @@ static UniValue voteraw(const JSONRPCRequest& request)
}
}
static UniValue getgovernanceinfo(const JSONRPCRequest& request)
static RPCHelpMan getgovernanceinfo()
{
RPCHelpMan{"getgovernanceinfo",
return RPCHelpMan{"getgovernanceinfo",
"Returns an object containing governance parameters.\n",
{},
RPCResult{
@ -1083,8 +1083,8 @@ static UniValue getgovernanceinfo(const JSONRPCRequest& request)
HelpExampleCli("getgovernanceinfo", "")
+ HelpExampleRpc("getgovernanceinfo", "")
},
}.Check(request);
[&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue
{
int nLastSuperblock = 0, nNextSuperblock = 0;
@ -1108,6 +1108,8 @@ static UniValue getgovernanceinfo(const JSONRPCRequest& request)
obj.pushKV("governancebudget", ValueFromAmount(CSuperblock::GetPaymentsLimit(chainman.ActiveChain(), nNextSuperblock)));
return obj;
},
};
}
static UniValue getsuperblockbudget(const JSONRPCRequest& request)