Skip to content

Commit

Permalink
Fix errors in build
Browse files Browse the repository at this point in the history
  • Loading branch information
Dennis Garcia committed Feb 28, 2025
1 parent 422e340 commit 2ddb374
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
1 change: 0 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion crates/web-client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ miden-lib = { workspace = true }
miden-objects = { workspace = true }
miden-tx = { workspace = true }
rand = { workspace = true }
serde = { workspace = true }
serde-wasm-bindgen = { version = "0.6" }
wasm-bindgen = { version = "0.2", features = ["serde-serialize"] }
wasm-bindgen-futures = { version = "0.4" }
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.6.1-next.6",
"version": "0.7.1-next.0",
"description": "Polygon Miden Wasm SDK",
"collaborators": [
"Polygon Miden",
Expand Down
1 change: 1 addition & 0 deletions crates/web-client/src/export.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ impl WebClient {
/// Retrieves the entire underlying web store and returns it as a JsValue
///
/// Meant to be used in conjunction with the force_import_store method
#[wasm_bindgen(js_name = "exportStore")]
pub async fn export_store(&mut self) -> Result<JsValue, JsValue> {
let store = self.store.as_ref().ok_or(JsValue::from_str("Store not initialized"))?;
let export =
Expand Down
1 change: 1 addition & 0 deletions crates/web-client/src/import.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ impl WebClient {
// Destructive operation, will fully overwrite the current web store
//
// The input to this function should be the result of a call to `export_store`
#[wasm_bindgen(js_name = "forceImportStore")]
pub async fn force_import_store(&mut self, store_dump: JsValue) -> Result<JsValue, JsValue> {
let store = self.store.as_ref().ok_or(JsValue::from_str("Store not initialized"))?;
store
Expand Down
12 changes: 6 additions & 6 deletions crates/web-client/test/import_export.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { clearStore, setupWalletAndFaucet } from "./webClientTestUtils";
const exportDb = async () => {
return await testingPage.evaluate(async () => {
const client = window.client;
const db = await client.export_store();
const db = await client.exportStore();
const serialized = JSON.stringify(db);
return serialized;
});
Expand All @@ -16,18 +16,18 @@ const exportDb = async () => {
const importDb = async (db: any) => {
return await testingPage.evaluate(async (_db) => {
const client = window.client;
await client.force_import_store(_db);
await client.forceImportStore(_db);
}, db);
};

const getAccount = async (accountId: string) => {
return await testingPage.evaluate(async (_accountId) => {
const client = window.client;
const accountId = window.AccountId.from_hex(_accountId);
const account = await client.get_account(accountId);
const accountId = window.AccountId.fromHex(_accountId);
const account = await client.getAccount(accountId);
return {
accountId: account?.id().to_string(),
accountHash: account?.hash().to_hex(),
accountId: account?.id().toString(),
accountHash: account?.hash().toHex(),
};
}, accountId);
};
Expand Down

0 comments on commit 2ddb374

Please sign in to comment.