doc: Fix rpc docs #24155

pull MarcoFalke wants to merge 1 commits into bitcoin:master from MarcoFalke:2201-rpcDoc changing 3 files +22 −13
  1. MarcoFalke commented at 7:06 pm on January 25, 2022: member

    Broken in commit 39d9bbe4acd7441aa9a61c57b76d887c4225a0e2.

    The fix removes the “type” OBJ_EMPTY added in commit 8d1a3e6498de6087501969a9d243b0697ca3fe97, which isn’t really a separate type and instead runs a check on OBJ whether it is empty or not.

  2. doc: Fix rpc docs
    Broken in commit 39d9bbe4acd7441aa9a61c57b76d887c4225a0e2
    fac8caaa62
  3. MarcoFalke added the label Bug on Jan 25, 2022
  4. MarcoFalke added the label Docs on Jan 25, 2022
  5. MarcoFalke added this to the milestone 23.0 on Jan 25, 2022
  6. MarcoFalke commented at 7:25 pm on January 25, 2022: member
      0diff --git a/decodepsbt b/decodepsbt
      1index 3b78457..c223073 100644
      2--- a/decodepsbt
      3+++ b/decodepsbt
      4@@ -28,7 +28,10 @@ Result:
      5     },
      6     ...
      7   ],
      8-  "unknown" : {}                           (empty JSON object) The unknown global fields
      9+  "unknown" : {                            (json object) The unknown global fields
     10+    "key" : "hex",                         (string) (key-value pair) An unknown key-value pair
     11+    ...
     12+  },
     13   "inputs" : [                             (json array)
     14     {                                      (json object)
     15       "non_witness_utxo" : {               (json object, optional) Decoded network transaction for non-witness UTXOs
     16@@ -43,7 +46,10 @@ Result:
     17           "address" : "str"                (string, optional) The Bitcoin address (only if a well-defined address exists)
     18         }
     19       },
     20-      "partial_signatures" : {}            (empty JSON object, optional)
     21+      "partial_signatures" : {             (json object, optional)
     22+        "pubkey" : "str",                  (string) The public key and signature that corresponds to it.
     23+        ...
     24+      },
     25       "sighash" : "str",                   (string, optional) The sighash type to be used
     26       "redeem_script" : {                  (json object, optional)
     27         "asm" : "str",                     (string) The asm
     28@@ -71,11 +77,26 @@ Result:
     29         "hex",                             (string) hex-encoded witness data (if any)
     30         ...
     31       ],
     32-      "ripemd160_preimages" : {}           (empty JSON object, optional)
     33-      "sha256_preimages" : {}              (empty JSON object, optional)
     34-      "hash160_preimages" : {}             (empty JSON object, optional)
     35-      "hash256_preimages" : {}             (empty JSON object, optional)
     36-      "unknown" : {}                       (empty JSON object, optional) The unknown input fields
     37+      "ripemd160_preimages" : {            (json object, optional)
     38+        "hash" : "str",                    (string) The hash and preimage that corresponds to it.
     39+        ...
     40+      },
     41+      "sha256_preimages" : {               (json object, optional)
     42+        "hash" : "str",                    (string) The hash and preimage that corresponds to it.
     43+        ...
     44+      },
     45+      "hash160_preimages" : {              (json object, optional)
     46+        "hash" : "str",                    (string) The hash and preimage that corresponds to it.
     47+        ...
     48+      },
     49+      "hash256_preimages" : {              (json object, optional)
     50+        "hash" : "str",                    (string) The hash and preimage that corresponds to it.
     51+        ...
     52+      },
     53+      "unknown" : {                        (json object, optional) The unknown input fields
     54+        "key" : "hex",                     (string) (key-value pair) An unknown key-value pair
     55+        ...
     56+      },
     57       "proprietary" : [                    (json array, optional) The input proprietary map
     58         {                                  (json object)
     59           "identifier" : "hex",            (string) The hex string for the proprietary identifier
     60@@ -108,7 +129,10 @@ Result:
     61         },
     62         ...
     63       ],
     64-      "unknown" : {}                       (empty JSON object, optional) The unknown global fields
     65+      "unknown" : {                        (json object, optional) The unknown global fields
     66+        "key" : "hex",                     (string) (key-value pair) An unknown key-value pair
     67+        ...
     68+      },
     69       "proprietary" : [                    (json array, optional) The output proprietary map
     70         {                                  (json object)
     71           "identifier" : "hex",            (string) The hex string for the proprietary identifier
     72diff --git a/getaddressesbylabel b/getaddressesbylabel
     73index 93dfd40..89b4abb 100644
     74--- a/getaddressesbylabel
     75+++ b/getaddressesbylabel
     76@@ -6,7 +6,12 @@ Arguments:
     77 1. label    (string, required) The label.
     78 
     79 Result:
     80-{}    (empty JSON object) json object with addresses as keys
     81+{                         (json object) json object with addresses as keys
     82+  "address" : {           (json object) json object with information about address
     83+    "purpose" : "str"     (string) Purpose of address ("send" for sending address, "receive" for receiving address)
     84+  },
     85+  ...
     86+}
     87 
     88 Examples:
     89 > bitcoin-cli getaddressesbylabel "tabby"
     90diff --git a/getblockchaininfo b/getblockchaininfo
     91index 1ba5e17..8e54224 100644
     92--- a/getblockchaininfo
     93+++ b/getblockchaininfo
     94@@ -19,7 +19,29 @@ Result:
     95   "pruneheight" : n,                      (numeric, optional) lowest-height complete block stored (only present if pruning is enabled)
     96   "automatic_pruning" : true|false,       (boolean, optional) whether automatic pruning is enabled (only present if pruning is enabled)
     97   "prune_target_size" : n,                (numeric, optional) the target size used by pruning (only present if automatic pruning is enabled)
     98-  "softforks" : {}                        (empty JSON object) status of softforks
     99+  "softforks" : {                         (json object) status of softforks
    100+    "xxxx" : {                            (json object) name of the softfork
    101+      "type" : "str",                     (string) one of "buried", "bip9"
    102+      "bip9" : {                          (json object, optional) status of bip9 softforks (only for "bip9" type)
    103+        "status" : "str",                 (string) one of "defined", "started", "locked_in", "active", "failed"
    104+        "bit" : n,                        (numeric, optional) the bit (0-28) in the block version field used to signal this softfork (only for "started" and "locked_in" status)
    105+        "start_time" : xxx,               (numeric) the minimum median time past of a block at which the bit gains its meaning
    106+        "timeout" : xxx,                  (numeric) the median time past of a block at which the deployment is considered failed if not yet locked in
    107+        "since" : n,                      (numeric) height of the first block to which the status applies
    108+        "min_activation_height" : n,      (numeric) minimum height of blocks for which the rules may be enforced
    109+        "statistics" : {                  (json object, optional) numeric statistics about signalling for a softfork (only for "started" and "locked_in" status)
    110+          "period" : n,                   (numeric) the length in blocks of the signalling period
    111+          "threshold" : n,                (numeric, optional) the number of blocks with the version bit set required to activate the feature (only for "started" status)
    112+          "elapsed" : n,                  (numeric) the number of blocks elapsed since the beginning of the current period
    113+          "count" : n,                    (numeric) the number of blocks with the version bit set in the current period
    114+          "possible" : true|false         (boolean, optional) returns false if there are not enough blocks left in this period to pass activation threshold (only for "started" status)
    115+        }
    116+      },
    117+      "height" : n,                       (numeric, optional) height of the first block which the rules are or will be enforced (only for "buried" type, or "bip9" type with "active" status)
    118+      "active" : true|false               (boolean) true if the rules are enforced for the mempool and the next block
    119+    },
    120+    ...
    121+  },
    122   "warnings" : "str"                      (string) any network and blockchain warnings
    123 }
    124 
    125diff --git a/getblocktemplate b/getblocktemplate
    126index 28dfadf..ef9fa05 100644
    127--- a/getblocktemplate
    128+++ b/getblocktemplate
    129@@ -36,7 +36,10 @@ Result (Otherwise):
    130     "str",                                 (string) name of a rule the client must understand to some extent; see BIP 9 for format
    131     ...
    132   ],
    133-  "vbavailable" : {}                       (empty JSON object) set of pending, supported versionbit (BIP 9) softfork deployments
    134+  "vbavailable" : {                        (json object) set of pending, supported versionbit (BIP 9) softfork deployments
    135+    "rulename" : n,                        (numeric) identifies the bit number as indicating acceptance and readiness for the named softfork rule
    136+    ...
    137+  },
    138   "capabilities" : [ 
    
  7. in src/rpc/util.cpp:832 in fac8caaa62
    829@@ -830,16 +830,15 @@ void RPCResult::ToSections(Sections& sections, const OuterType outer_type, const
    830         return;
    831     }
    832     case Type::OBJ_DYN:
    


    Sjors commented at 8:07 pm on January 25, 2022:
    I guess the breakage was in OBJ_DYN falling through to OBJ_EMPTY instead of OBJ?

    MarcoFalke commented at 6:31 am on January 26, 2022:
    Yes
  8. Sjors commented at 1:01 pm on January 26, 2022: member
    tACK fac8caaa6252c6e18301a263d325d63197062639
  9. fanquake merged this on Jan 26, 2022
  10. fanquake closed this on Jan 26, 2022

  11. MarcoFalke deleted the branch on Jan 26, 2022
  12. sidhujag referenced this in commit 84ae761874 on Jan 28, 2022
  13. DrahtBot locked this on Jan 26, 2023


MarcoFalke Sjors

Labels
Bug Docs

Milestone
23.0


github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-12-18 21:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me