(json: &Value, key: &str)
| 77 | // Extracts value from a given json object and key |
| 78 | #[allow(dead_code)] |
| 79 | fn get_value(json: &Value, key: &str) -> Result<String, IntTestError> { |
| 80 | let map = json |
| 81 | .as_object() |
| 82 | .ok_or(IntTestError::JsonData("Json is not an object".to_string()))?; |
| 83 | let value = map |
| 84 | .get(key) |
| 85 | .ok_or(IntTestError::JsonData("Invalid key".to_string()))? |
| 86 | .to_owned(); |
| 87 | let string_value = value_to_string(&value)?; |
| 88 | Ok(string_value) |
| 89 | } |
| 90 | |
| 91 | /// The bdk-cli command struct |
| 92 | /// Use it to perform all bdk-cli operations |
no test coverage detected