MCPcopy Create free account
hub / github.com/bitcoindevkit/bdk-cli / get_value

Function get_value

tests/integration.rs:79–89  ·  view source on GitHub ↗
(json: &Value, key: &str)

Source from the content-addressed store, hash-verified

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

Callers 2

newMethod · 0.85
basic_wallet_opsFunction · 0.85

Calls 1

value_to_stringFunction · 0.85

Tested by

no test coverage detected