Skip to content

Commit

Permalink
Fix compilation errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
m-renaud committed Apr 30, 2021
1 parent c2c74e5 commit 281635d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion bindings/wasm/src/wasm_document.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ impl WasmDocument {
}

#[wasm_bindgen(js_name = removeService)]
pub fn remove_service(&mut self, did: &DID) -> Result<(), JsValue> {
pub fn remove_service(&mut self, did: &WasmDID) -> Result<(), JsValue> {
self.0.remove_service(&did.0).map_err(err)
}

Expand Down
8 changes: 5 additions & 3 deletions bindings/wasm/src/wasm_verification_method.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,15 @@ impl WasmVerificationMethod {
/// Creates a new `WasmVerificationMethod` object from the given `key`.
#[wasm_bindgen(constructor)]
pub fn new(key: &KeyPair, tag: Option<String>) -> Result<WasmVerificationMethod, JsValue> {
Method_::from_keypair(&key.0, tag.as_deref()).map_err(err).map(Self)
IotaVerificationMethod::from_keypair(&key.0, tag.as_deref())
.map_err(err)
.map(Self)
}

/// Creates a new `WasmVerificationMethod` object from the given `did` and `key`.
#[wasm_bindgen(js_name = fromDID)]
pub fn from_did(did: &WasmDID, key: &KeyPair, tag: Option<String>) -> Result<WasmVerificationMethod, JsValue> {
Method_::from_did(did.0.clone(), &key.0, tag.as_deref())
IotaVerificationMethod::from_did(did.0.clone(), &key.0, tag.as_deref())
.map_err(err)
.map(Self)
}
Expand All @@ -40,7 +42,7 @@ impl WasmVerificationMethod {
tag: Option<String>,
) -> Result<WasmVerificationMethod, JsValue> {
match digest {
Digest::Sha256 => Method_::create_merkle_key::<Sha256, _>(did.0.clone(), &keys.0, tag.as_deref())
Digest::Sha256 => IotaVerificationMethod::create_merkle_key::<Sha256, _>(did.0.clone(), &keys.0, tag.as_deref())
.map_err(err)
.map(Self),
}
Expand Down

0 comments on commit 281635d

Please sign in to comment.