Skip to content

Commit

Permalink
fix: Better error handling for web client sync state
Browse files Browse the repository at this point in the history
  • Loading branch information
julian-demox committed Oct 22, 2024
1 parent 224cd03 commit a842134
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## 0.6.0 (TBD)

* Added better error handling for WASM sync state
* Added WASM Input note tests + updated input note models (#554)
* Added new variants for the `NoteFilter` struct (#538).
* [BREAKING] Added note tags for future notes in `TransactionRequest` (#538).
Expand Down
2 changes: 1 addition & 1 deletion crates/web-client/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@demox-labs/miden-sdk",
"version": "0.0.14",
"version": "0.0.15",
"description": "Polygon Miden Wasm SDK",
"collaborators": [
"Polygon Miden",
Expand Down
5 changes: 4 additions & 1 deletion crates/web-client/src/sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ use crate::{models::sync_summary::SyncSummary, WebClient};
impl WebClient {
pub async fn sync_state(&mut self) -> Result<SyncSummary, JsValue> {
if let Some(client) = self.get_mut_inner() {
let sync_summary = client.sync_state().await.unwrap();
let sync_summary = client
.sync_state()
.await
.map_err(|err| JsValue::from_str(&format!("Failed to sync state: {}", err)))?;

Ok(sync_summary.into())
} else {
Expand Down

0 comments on commit a842134

Please sign in to comment.