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

Function value_to_string

tests/integration.rs:62–74  ·  view source on GitHub ↗
(value: &Value)

Source from the content-addressed store, hash-verified

60 // Transforms a json value to string
61 #[allow(dead_code)]
62 fn value_to_string(value: &Value) -> Result<String, IntTestError> {
63 match value {
64 Value::Bool(bool) => match bool {
65 true => Ok("true".to_string()),
66 false => Ok("false".to_string()),
67 },
68 Value::Number(n) => Ok(n.to_string()),
69 Value::String(s) => Ok(s.to_string()),
70 _ => Err(IntTestError::JsonData(
71 "Value parsing not implemented for this type".to_string(),
72 )),
73 }
74 }
75
76 // Helper Function
77 // Extracts value from a given json object and key

Callers 1

get_valueFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected