Skip to content

Commit f23bc09

Browse files
committed
change ProverResult.to_json() to return string instead of JsValue;
1 parent f9cf584 commit f23bc09

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

bindings/ergo-lib-wasm/src/prover_result.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,9 @@ impl ProverResult {
2323
self.0.extension.clone().into()
2424
}
2525

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)))
26+
/// JSON representation as text (compatible with Ergo Node/Explorer API, numbers are encoded as numbers)
27+
pub fn to_json(&self) -> Result<String, JsValue> {
28+
serde_json::to_string_pretty(&self.0.clone())
29+
.map_err(|e| JsValue::from_str(&format!("{}", e)))
2930
}
3031
}

0 commit comments

Comments
 (0)