1. 30 Jul, 2021 1 commit
  2. 29 Jul, 2021 1 commit
  3. 28 Jul, 2021 7 commits
  4. 22 Jul, 2021 2 commits
  5. 21 Jul, 2021 6 commits
  6. 20 Jul, 2021 4 commits
  7. 19 Jul, 2021 12 commits
  8. 18 Jul, 2021 1 commit
    • Jeremy Cooper's avatar
      Clean up JSON/RPC API for proper use of errors and data types. · 8ec1050a
      Jeremy Cooper authored
      Clean up the JSON/RPC API results so that conditional states, missing data
      and errors are all easier to detect programmatically. General principles:
      
      * When there is an error, make sure to consistenly use the ?jsonrpc_error()
        macro.
      
      * If a value is semantically boolean, make it so in the result set. Don't
        return a string.
      
      * If there's no particular error in a query, but there's no data for an item
        then try to use `null` instead of a specialized strings such as "undefined".
      
      * If a query only returns data if the validator/miner is in a specific mode,
        try to ensure that there is a consistently available attribute that
        can be checked _first_ in the result set. Don't make clients try to guess
        the state by checking for the existence of other items, or even worse,
        by checking the returned datatype.
      
        Example: `dkg_queue`. Before this change, `dkg_queue` either returned
      
            `{ "error" : "not running" }` (return type is dictionary)
        or
            `[ {"name":...,"address":...}, ... ]` (return type is array)
      
        Now returns either
      
            `{ "running": false }`
        or
            `{ "running": true, "consensus_members" : [ ... ] }`
      8ec1050a
  9. 17 Jul, 2021 3 commits
  10. 16 Jul, 2021 3 commits