Skip to content

Commit d99ecc9

Browse files
committed
Merge #1568: rpc: fix fields type in man
8165ec8 rpc: fix fields type in man (Ruslan Kasheparov) Pull request description: ACKs for top commit: tomt1664: ACK e559b1c tested locally Tree-SHA512: 3d28967258450fedca14bd609b04a58f8288b6aeb4b40e92779217dc9f6aa5e9d5ac2345a1024b38d007fa96f5da103e12c7cd1207e32eb2933bbb6723248ea4
2 parents d2ce7b7 + e559b1c commit d99ecc9

7 files changed

Lines changed: 164 additions & 129 deletions

File tree

src/rpc/blockchain.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1454,14 +1454,14 @@ RPCHelpMan getblockchaininfo()
14541454
{RPCResult::Type::NUM, "blocks", "the height of the most-work fully-validated chain. The genesis block has height 0"},
14551455
{RPCResult::Type::NUM, "headers", "the current number of headers we have validated"},
14561456
{RPCResult::Type::STR, "bestblockhash", "the hash of the currently best block"},
1457-
/* ELEMENTS: not present {RPCResult::Type::NUM, "difficulty", "the current difficulty"}, */
1458-
{RPCResult::Type::STR_HEX, "bits", "nBits: compact representation of the block difficulty target"},
1459-
{RPCResult::Type::STR_HEX, "target", "The difficulty target"},
1457+
{RPCResult::Type::STR_HEX, "bits", /*optional=*/true, "nBits: compact representation of the block difficulty target"},
1458+
{RPCResult::Type::STR_HEX, "target", /*optional=*/true, "The difficulty target"},
1459+
{RPCResult::Type::NUM, "difficulty", /*optional=*/true, "the current difficulty"},
14601460
{RPCResult::Type::NUM_TIME, "time", "The block time expressed in " + UNIX_EPOCH_TIME},
14611461
{RPCResult::Type::NUM_TIME, "mediantime", "The median block time expressed in " + UNIX_EPOCH_TIME},
14621462
{RPCResult::Type::NUM, "verificationprogress", "estimate of verification progress [0..1]"},
14631463
{RPCResult::Type::BOOL, "initialblockdownload", "(debug information) estimate of whether this node is in Initial Block Download mode"},
1464-
/* ELEMENTS: not present {RPCResult::Type::STR_HEX, "chainwork", "total amount of work in active chain, in hexadecimal"}, */
1464+
{RPCResult::Type::STR_HEX, "chainwork", /*optional=*/true, "total amount of work in active chain, in hexadecimal"},
14651465
{RPCResult::Type::NUM, "size_on_disk", "the estimated size of the block and undo files on disk"},
14661466
{RPCResult::Type::BOOL, "pruned", "if the blocks are subject to pruning"},
14671467
{RPCResult::Type::BOOL, "trim_headers", "whether header trimming is enabled (-trim-headers)"},

src/rpc/node.cpp

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,8 @@ static RPCHelpMan tweakfedpegscript()
422422
RPCResult::Type::OBJ, "", "",
423423
{
424424
{RPCResult::Type::STR_HEX, "script", "The fedpegscript tweaked with claim_script"},
425-
{RPCResult::Type::STR, "address", "The address corresponding to the tweaked fedpegscript"},
425+
{RPCResult::Type::STR, "p2wsh", "The native segwit address for the tweaked fedpegscript"},
426+
{RPCResult::Type::STR, "p2shwsh", "The P2SH-wrapped segwit address for the tweaked fedpegscript"},
426427
}
427428
},
428429
RPCExamples{""},
@@ -492,7 +493,11 @@ static RPCHelpMan getpakinfo()
492493
{
493494
{RPCResult::Type::OBJ, "block_paklist", "The PAK list loaded from latest epoch",
494495
{
495-
{RPCResult::Type::ELISION, "", ""}
496+
{RPCResult::Type::ARR, "online", "Online PAK pubkeys in hex",
497+
{{RPCResult::Type::STR_HEX, "", "online pubkey"}}},
498+
{RPCResult::Type::ARR, "offline", "Offline PAK pubkeys in hex",
499+
{{RPCResult::Type::STR_HEX, "", "offline pubkey"}}},
500+
{RPCResult::Type::BOOL, "reject", "Whether peg-outs are rejected (no offline keys)"},
496501
}},
497502
}
498503
},
@@ -516,9 +521,9 @@ static RPCHelpMan calcfastmerkleroot()
516521
return RPCHelpMan{"calcfastmerkleroot",
517522
"\nhidden utility RPC for computing sha2 midstates\n",
518523
{
519-
{"leaves", RPCArg::Type::ARR, RPCArg::Optional::NO, "array of data to compute the fast merkle root of.",
524+
{"leaves", RPCArg::Type::ARR, RPCArg::Optional::NO, "Array of 32-byte hashes to compute the fast merkle root of.",
520525
{
521-
{"data", RPCArg::Type::STR_HEX, RPCArg::Optional::OMITTED, "hex-encoded data"},
526+
{"hash", RPCArg::Type::STR_HEX, RPCArg::Optional::OMITTED, "32-byte hex-encoded hash"},
522527
}},
523528
},
524529
RPCResult{
@@ -548,12 +553,12 @@ static RPCHelpMan calcfastmerkleroot()
548553
static RPCHelpMan dumpassetlabels()
549554
{
550555
return RPCHelpMan{"dumpassetlabels",
551-
"\nLists all known asset id/label pairs in this wallet. This list can be modified with `-assetdir` configuration argument.\n",
556+
"\nLists all known asset label/id pairs known to this node. This list can be modified with the `-assetdir` configuration argument.\n",
552557
{},
553558
RPCResult{
554559
RPCResult::Type::OBJ, "labels", "",
555560
{
556-
{RPCResult::Type::ELISION, "", "the label for each asset id"},
561+
{RPCResult::Type::ELISION, "", "the asset id (hex) for each label"},
557562
},
558563
},
559564
RPCExamples{
@@ -623,7 +628,7 @@ static RPCHelpMan createblindedaddress()
623628
{"blinding_key", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "The blinding public key. This can be obtained for a given address using `getaddressinfo` (`confidential_key` field)."},
624629
},
625630
RPCResult{
626-
RPCResult::Type::STR, "blinded_address", "The blinded address"
631+
RPCResult::Type::STR, "", "The blinded address"
627632
},
628633
RPCExamples{
629634
"\nCreate a blinded address\n"

0 commit comments

Comments
 (0)