cuprate_test_utils::rpc::data::json

Constant ADD_AUX_POW_RESPONSE

Source
pub const ADD_AUX_POW_RESPONSE: &str = r#"{
  "id": "0",
  "jsonrpc": "2.0",
  "result": {
    "aux_pow": [{
      "hash": "7b35762de164b20885e15dbe656b1138db06bb402fa1796f5765a23933d8859a",
      "id": "3200b4ea97c3b2081cd4190b58e49572b2319fed00d030ad51809dff06b5d8c8"
    }],
    "blockhashing_blob": "1010ee97e2a106e9f8ebe8887e5b609949ac8ea6143e560ed13552b110cb009b21f0cfca1eaccf00000000b2685c1283a646bc9020c758daa443be145b7370ce5a6efacb3e614117032e2c22",
    "blocktemplate_blob": "1010f4bae0b4069d648e741d85ca0e7acb4501f051b27e9b107d3cd7a3f03aa7f776089117c81a0000000002c681c30101ff8a81c3010180e0a596bb11033b7eedf47baf878f3490cb20b696079c34bd017fe59b0d070e74d73ffabc4bb0e05f011decb630f3148d0163b3bd39690dde4078e4cfb69fecf020d6278a27bad10c58023c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
    "merkle_root": "7b35762de164b20885e15dbe656b1138db06bb402fa1796f5765a23933d8859a",
    "merkle_tree_depth": 0,
    "status": "OK",
    "untrusted": false
  }
}"#;
Expand description

Documentation, request.

use cuprate_test_utils::rpc::data::json::*;
use serde_json::{to_value, Value};

let value = serde_json::from_str::<Value>(&ADD_AUX_POW_RESPONSE).unwrap();
let Value::Object(map) = value else {
    panic!();
};

assert_eq!(map.get("jsonrpc").unwrap(), "2.0");
map.get("id").unwrap();

if map.get("method").is_some() {
    return;
}

if map.get("result").is_none() {
    map.get("error").unwrap();
}