Skip to content

Commit

Permalink
fix(autonomi): fix archive borrow in WASM
Browse files Browse the repository at this point in the history
  • Loading branch information
b-zee committed Dec 16, 2024
1 parent 02f20ab commit 366d8c0
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions autonomi/src/client/wasm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -263,10 +263,7 @@ mod archive {
archive: &JsArchive,
wallet: &JsWallet,
) -> Result<String, JsError> {
let addr = self
.0
.archive_put_public(archive.0.clone(), &wallet.0)
.await?;
let addr = self.0.archive_put_public(&archive.0, &wallet.0).await?;

Ok(addr_to_str(addr))
}
Expand Down Expand Up @@ -348,10 +345,7 @@ mod archive_private {
archive: &JsPrivateArchive,
wallet: &JsWallet,
) -> Result<JsValue, JsError> {
let private_archive_access = self
.0
.archive_put(archive.0.clone(), (&wallet.0).into())
.await?;
let private_archive_access = self.0.archive_put(&archive.0, (&wallet.0).into()).await?;

let js_value = serde_wasm_bindgen::to_value(&private_archive_access)?;

Expand All @@ -370,10 +364,7 @@ mod archive_private {
) -> Result<JsValue, JsError> {
let receipt: Receipt = serde_wasm_bindgen::from_value(receipt)?;

let private_archive_access = self
.0
.archive_put(archive.0.clone(), receipt.into())
.await?;
let private_archive_access = self.0.archive_put(&archive.0, receipt.into()).await?;

let js_value = serde_wasm_bindgen::to_value(&private_archive_access)?;

Expand Down

0 comments on commit 366d8c0

Please sign in to comment.