We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
ProverResult.to_json()
1 parent f9cf584 commit f23bc09Copy full SHA for f23bc09
bindings/ergo-lib-wasm/src/prover_result.rs
@@ -23,8 +23,9 @@ impl ProverResult {
23
self.0.extension.clone().into()
24
}
25
26
- /// JSON representation
27
- pub fn to_json(&self) -> Result<JsValue, JsValue> {
28
- JsValue::from_serde(&self.0.clone()).map_err(|e| JsValue::from_str(&format!("{}", e)))
+ /// JSON representation as text (compatible with Ergo Node/Explorer API, numbers are encoded as numbers)
+ pub fn to_json(&self) -> Result<String, JsValue> {
+ serde_json::to_string_pretty(&self.0.clone())
29
+ .map_err(|e| JsValue::from_str(&format!("{}", e)))
30
31
0 commit comments