Skip to content

Commit 5e3e83b

Browse files
committed
RPC/Mining: Document template_request better for getblocktemplate
1 parent de319c6 commit 5e3e83b

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/rpc/mining.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,7 @@ static RPCHelpMan getblocktemplate()
554554
" https://github.com/bitcoin/bips/blob/master/bip-0009.mediawiki#getblocktemplate_changes\n"
555555
" https://github.com/bitcoin/bips/blob/master/bip-0145.mediawiki\n",
556556
{
557-
{"template_request", RPCArg::Type::OBJ, RPCArg::Default{UniValue::VOBJ}, "Format of the template",
557+
{"template_request", RPCArg::Type::OBJ, RPCArg::Optional::NO, "Format of the template",
558558
{
559559
{"mode", RPCArg::Type::STR, /* treat as named arg */ RPCArg::Optional::OMITTED, "This must be set to \"template\", \"proposal\" (see BIP 23), or omitted"},
560560
{"capabilities", RPCArg::Type::ARR, /* treat as named arg */ RPCArg::Optional::OMITTED, "A list of strings",
@@ -569,7 +569,7 @@ static RPCHelpMan getblocktemplate()
569569
{"longpollid", RPCArg::Type::STR, RPCArg::Optional::OMITTED, "delay processing request until the result would vary significantly from the \"longpollid\" of a prior template"},
570570
{"data", RPCArg::Type::STR_HEX, RPCArg::Optional::OMITTED, "proposed block data to check, encoded in hexadecimal; valid only for mode=\"proposal\""},
571571
},
572-
RPCArgOptions{.oneline_description="template_request"}},
572+
},
573573
},
574574
{
575575
RPCResult{"If the proposal was accepted with mode=='proposal'", RPCResult::Type::NONE, "", ""},

test/functional/mining_basic.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ def assert_submitblock(block, result_str_1, result_str_2=None):
172172
block.vtx = [coinbase_tx]
173173

174174
self.log.info("getblocktemplate: segwit rule must be set")
175-
assert_raises_rpc_error(-8, "getblocktemplate must be called with the segwit rule set", node.getblocktemplate)
175+
assert_raises_rpc_error(-8, "getblocktemplate must be called with the segwit rule set", node.getblocktemplate, {})
176176

177177
self.log.info("getblocktemplate: Test valid block")
178178
assert_template(node, block, None)

0 commit comments

Comments
 (0)