From 524f718deabeaa2d951f166f5d425484fbcec7a2 Mon Sep 17 00:00:00 2001 From: Patrik Stas Date: Sat, 24 Jun 2023 17:46:49 +0200 Subject: [PATCH] wip --- libvcx_core/src/api_vcx/api_global/profile.rs | 10 ---------- libvcx_core/src/api_vcx/api_global/wallet.rs | 16 +++++----------- libvcx_core/src/api_vcx/api_handle/schema.rs | 2 +- 3 files changed, 6 insertions(+), 22 deletions(-) diff --git a/libvcx_core/src/api_vcx/api_global/profile.rs b/libvcx_core/src/api_vcx/api_global/profile.rs index bc34bb31f5..ec1d6c3230 100644 --- a/libvcx_core/src/api_vcx/api_global/profile.rs +++ b/libvcx_core/src/api_vcx/api_global/profile.rs @@ -124,16 +124,6 @@ lazy_static! { use super::{pool::get_main_pool_handle, wallet::get_main_wallet_handle}; -pub fn indy_wallet_handle_to_wallet(wallet_handle: WalletHandle) -> Arc { - // Arc::new(IndySdkWallet::new(wallet_handle)) - unimplemented!("indy_wallet_handle_to_wallet") -} - -pub fn indy_handles_to_profile(wallet_handle: WalletHandle, pool_handle: i32) -> Arc { - // Arc::new(VdrtoolsProfile::init(wallet_handle, pool_handle)) - unimplemented!("indy_handles_to_profile") -} - impl ProfileV2 for MockProfile { fn inject_indy_ledger_read(&self) -> LibvcxResult> { Ok(Arc::new(MockLedger {})) diff --git a/libvcx_core/src/api_vcx/api_global/wallet.rs b/libvcx_core/src/api_vcx/api_global/wallet.rs index aac1e94780..8c22ab7cec 100644 --- a/libvcx_core/src/api_vcx/api_global/wallet.rs +++ b/libvcx_core/src/api_vcx/api_global/wallet.rs @@ -8,9 +8,7 @@ use aries_vcx::common::signing::unpack_message_to_string; use aries_vcx::global::settings::DEFAULT_LINK_SECRET_ALIAS; use aries_vcx::protocols::mediated_connection::pairwise_info::PairwiseInfo; -use crate::api_vcx::api_global::profile::{ - get_main_indy_ledger_write, get_main_profile, get_main_wallet, indy_handles_to_profile, -}; +use crate::api_vcx::api_global::profile::{get_main_anoncreds, get_main_indy_ledger_write, get_main_profile, get_main_wallet}; use crate::errors::error::LibvcxResult; use crate::errors::mapping_from_ariesvcx::map_ariesvcx_result; use crate::errors::mapping_from_ariesvcxcore::map_ariesvcx_core_result; @@ -92,11 +90,8 @@ pub async fn create_main_wallet(config: &WalletConfig) -> LibvcxResult<()> { let wallet_handle = create_and_open_as_main_wallet(config).await?; trace!("Created wallet with handle {:?}", wallet_handle); - let profile = indy_handles_to_profile(wallet_handle, -1); - // If MS is already in wallet then just continue - profile - .inject_anoncreds() + get_main_anoncreds()? .prover_create_link_secret(DEFAULT_LINK_SECRET_ALIAS) .await .ok(); @@ -218,8 +213,8 @@ pub mod test_utils { use aries_vcx::aries_vcx_core::indy::wallet::WalletConfig; use aries_vcx::global::settings::{CONFIG_WALLET_BACKUP_KEY, DEFAULT_WALLET_KEY, WALLET_KDF_RAW}; use aries_vcx::utils::devsetup::TempFile; + use crate::api_vcx::api_global::profile::get_main_wallet; - use crate::api_vcx::api_global::profile::indy_wallet_handle_to_wallet; use crate::api_vcx::api_global::settings::get_config_value; use crate::api_vcx::api_global::wallet::{ close_main_wallet, create_and_open_as_main_wallet, create_main_wallet, export_main_wallet, open_as_main_wallet, @@ -245,9 +240,8 @@ pub mod test_utils { rekey: None, rekey_derivation_method: None, }; - let wallet_handle = create_and_open_as_main_wallet(&wallet_config).await.unwrap(); - let wallet = indy_wallet_handle_to_wallet(wallet_handle); - wallet.create_and_store_my_did(None, None).await.unwrap(); + create_and_open_as_main_wallet(&wallet_config).await.unwrap(); + get_main_wallet().create_and_store_my_did(None, None).await.unwrap(); let backup_key = get_config_value(CONFIG_WALLET_BACKUP_KEY).unwrap(); let (type_, id, value) = _record(); wallet.add_wallet_record(type_, id, value, None).await.unwrap(); diff --git a/libvcx_core/src/api_vcx/api_handle/schema.rs b/libvcx_core/src/api_vcx/api_handle/schema.rs index f05d38383b..7484630710 100644 --- a/libvcx_core/src/api_vcx/api_handle/schema.rs +++ b/libvcx_core/src/api_vcx/api_handle/schema.rs @@ -8,7 +8,7 @@ use aries_vcx::global::settings::CONFIG_INSTITUTION_DID; use crate::api_vcx::api_global::pool::get_main_pool_handle; use crate::api_vcx::api_global::profile::{ get_main_anoncreds, get_main_anoncreds_ledger_read, get_main_anoncreds_ledger_write, get_main_indy_ledger_read, - get_main_profile, indy_handles_to_profile, + get_main_profile }; use crate::api_vcx::api_global::settings::get_config_value; use crate::api_vcx::api_handle::object_cache::ObjectCache;