From 285c703a7d6e1a8de3c1c7dfba05bcde1e6faa41 Mon Sep 17 00:00:00 2001 From: S3bb1 <763247+S3bb1@users.noreply.github.com> Date: Mon, 27 Nov 2023 06:58:28 +0100 Subject: [PATCH] return resolved nquads instead of empty string --- src/c_lib.rs | 5 ++--- src/main.rs | 3 +-- src/wasm_lib.rs | 5 ++--- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/c_lib.rs b/src/c_lib.rs index a5037fa..19128df 100644 --- a/src/c_lib.rs +++ b/src/c_lib.rs @@ -803,13 +803,12 @@ pub extern "C" fn execute_vade( request_function_callback, ) .map_err(stringify_generic_error)?; - vade_evan + Ok(vade_evan .helper_convert_credential_to_nquads( arguments_vec.get(0).unwrap_or_else(|| &no_args), ) .await - .map_err(stringify_vade_evan_error)?; - Ok("".to_string()) + .map_err(stringify_vade_evan_error)?) } }), #[cfg(any(feature = "vc-zkp-bbs"))] diff --git a/src/main.rs b/src/main.rs index 1ccc80a..192a4a0 100644 --- a/src/main.rs +++ b/src/main.rs @@ -261,8 +261,7 @@ async fn main() -> Result<()> { "credential", None, )) - .await?; - "".to_string() + .await? } #[cfg(all(feature = "vc-zkp-bbs", feature = "did-sidetree"))] ("create_self_issued_credential", Some(sub_m)) => { diff --git a/src/wasm_lib.rs b/src/wasm_lib.rs index f84dfe0..1e573d6 100644 --- a/src/wasm_lib.rs +++ b/src/wasm_lib.rs @@ -452,12 +452,11 @@ cfg_if::cfg_if! { credential: String, ) -> Result { let mut vade_evan = get_vade_evan(None).map_err(jsify_generic_error)?; - vade_evan + Ok(vade_evan .helper_convert_credential_to_nquads( &credential, ).await - .map_err(jsify_vade_evan_error)?; - Ok("".to_string()) + .map_err(jsify_vade_evan_error)?) } #[cfg(all(feature = "vc-zkp-bbs", feature = "did-sidetree"))]