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

    <details><summary>Rendered diff</summary>

    diff --git a/decodepsbt b/decodepsbt
    index 3b78457..c223073 100644
    --- a/decodepsbt
    +++ b/decodepsbt
    @@ -28,7 +28,10 @@ Result:
         },
         ...
       ],
    -  "unknown" : {}                           (empty JSON object) The unknown global fields
    +  "unknown" : {                            (json object) The unknown global fields
    +    "key" : "hex",                         (string) (key-value pair) An unknown key-value pair
    +    ...
    +  },
       "inputs" : [                             (json array)
         {                                      (json object)
           "non_witness_utxo" : {               (json object, optional) Decoded network transaction for non-witness UTXOs
    @@ -43,7 +46,10 @@ Result:
               "address" : "str"                (string, optional) The Bitcoin address (only if a well-defined address exists)
             }
           },
    -      "partial_signatures" : {}            (empty JSON object, optional)
    +      "partial_signatures" : {             (json object, optional)
    +        "pubkey" : "str",                  (string) The public key and signature that corresponds to it.
    +        ...
    +      },
           "sighash" : "str",                   (string, optional) The sighash type to be used
           "redeem_script" : {                  (json object, optional)
             "asm" : "str",                     (string) The asm
    @@ -71,11 +77,26 @@ Result:
             "hex",                             (string) hex-encoded witness data (if any)
             ...
           ],
    -      "ripemd160_preimages" : {}           (empty JSON object, optional)
    -      "sha256_preimages" : {}              (empty JSON object, optional)
    -      "hash160_preimages" : {}             (empty JSON object, optional)
    -      "hash256_preimages" : {}             (empty JSON object, optional)
    -      "unknown" : {}                       (empty JSON object, optional) The unknown input fields
    +      "ripemd160_preimages" : {            (json object, optional)
    +        "hash" : "str",                    (string) The hash and preimage that corresponds to it.
    +        ...
    +      },
    +      "sha256_preimages" : {               (json object, optional)
    +        "hash" : "str",                    (string) The hash and preimage that corresponds to it.
    +        ...
    +      },
    +      "hash160_preimages" : {              (json object, optional)
    +        "hash" : "str",                    (string) The hash and preimage that corresponds to it.
    +        ...
    +      },
    +      "hash256_preimages" : {              (json object, optional)
    +        "hash" : "str",                    (string) The hash and preimage that corresponds to it.
    +        ...
    +      },
    +      "unknown" : {                        (json object, optional) The unknown input fields
    +        "key" : "hex",                     (string) (key-value pair) An unknown key-value pair
    +        ...
    +      },
           "proprietary" : [                    (json array, optional) The input proprietary map
             {                                  (json object)
               "identifier" : "hex",            (string) The hex string for the proprietary identifier
    @@ -108,7 +129,10 @@ Result:
             },
             ...
           ],
    -      "unknown" : {}                       (empty JSON object, optional) The unknown global fields
    +      "unknown" : {                        (json object, optional) The unknown global fields
    +        "key" : "hex",                     (string) (key-value pair) An unknown key-value pair
    +        ...
    +      },
           "proprietary" : [                    (json array, optional) The output proprietary map
             {                                  (json object)
               "identifier" : "hex",            (string) The hex string for the proprietary identifier
    diff --git a/getaddressesbylabel b/getaddressesbylabel
    index 93dfd40..89b4abb 100644
    --- a/getaddressesbylabel
    +++ b/getaddressesbylabel
    @@ -6,7 +6,12 @@ Arguments:
     1. label    (string, required) The label.
     
     Result:
    -{}    (empty JSON object) json object with addresses as keys
    +{                         (json object) json object with addresses as keys
    +  "address" : {           (json object) json object with information about address
    +    "purpose" : "str"     (string) Purpose of address ("send" for sending address, "receive" for receiving address)
    +  },
    +  ...
    +}
     
     Examples:
     > bitcoin-cli getaddressesbylabel "tabby"
    diff --git a/getblockchaininfo b/getblockchaininfo
    index 1ba5e17..8e54224 100644
    --- a/getblockchaininfo
    +++ b/getblockchaininfo
    @@ -19,7 +19,29 @@ Result:
       "pruneheight" : n,                      (numeric, optional) lowest-height complete block stored (only present if pruning is enabled)
       "automatic_pruning" : true|false,       (boolean, optional) whether automatic pruning is enabled (only present if pruning is enabled)
       "prune_target_size" : n,                (numeric, optional) the target size used by pruning (only present if automatic pruning is enabled)
    -  "softforks" : {}                        (empty JSON object) status of softforks
    +  "softforks" : {                         (json object) status of softforks
    +    "xxxx" : {                            (json object) name of the softfork
    +      "type" : "str",                     (string) one of "buried", "bip9"
    +      "bip9" : {                          (json object, optional) status of bip9 softforks (only for "bip9" type)
    +        "status" : "str",                 (string) one of "defined", "started", "locked_in", "active", "failed"
    +        "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)
    +        "start_time" : xxx,               (numeric) the minimum median time past of a block at which the bit gains its meaning
    +        "timeout" : xxx,                  (numeric) the median time past of a block at which the deployment is considered failed if not yet locked in
    +        "since" : n,                      (numeric) height of the first block to which the status applies
    +        "min_activation_height" : n,      (numeric) minimum height of blocks for which the rules may be enforced
    +        "statistics" : {                  (json object, optional) numeric statistics about signalling for a softfork (only for "started" and "locked_in" status)
    +          "period" : n,                   (numeric) the length in blocks of the signalling period
    +          "threshold" : n,                (numeric, optional) the number of blocks with the version bit set required to activate the feature (only for "started" status)
    +          "elapsed" : n,                  (numeric) the number of blocks elapsed since the beginning of the current period
    +          "count" : n,                    (numeric) the number of blocks with the version bit set in the current period
    +          "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)
    +        }
    +      },
    +      "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)
    +      "active" : true|false               (boolean) true if the rules are enforced for the mempool and the next block
    +    },
    +    ...
    +  },
       "warnings" : "str"                      (string) any network and blockchain warnings
     }
     
    diff --git a/getblocktemplate b/getblocktemplate
    index 28dfadf..ef9fa05 100644
    --- a/getblocktemplate
    +++ b/getblocktemplate
    @@ -36,7 +36,10 @@ Result (Otherwise):
         "str",                                 (string) name of a rule the client must understand to some extent; see BIP 9 for format
         ...
       ],
    -  "vbavailable" : {}                       (empty JSON object) set of pending, supported versionbit (BIP 9) softfork deployments
    +  "vbavailable" : {                        (json object) set of pending, supported versionbit (BIP 9) softfork deployments
    +    "rulename" : n,                        (numeric) identifies the bit number as indicating acceptance and readiness for the named softfork rule
    +    ...
    +  },
       "capabilities" : [ 
    

    </details>

  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
Contributors
Labels

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: 2026-04-30 06:14 UTC

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