Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrik-Stas committed Jun 24, 2023
1 parent 0c3dbec commit 524f718
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 22 deletions.
10 changes: 0 additions & 10 deletions libvcx_core/src/api_vcx/api_global/profile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<dyn BaseWallet> {
// 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<dyn Profile> {
// Arc::new(VdrtoolsProfile::init(wallet_handle, pool_handle))
unimplemented!("indy_handles_to_profile")
}

impl ProfileV2 for MockProfile {
fn inject_indy_ledger_read(&self) -> LibvcxResult<Arc<dyn IndyLedgerRead>> {
Ok(Arc::new(MockLedger {}))
Expand Down
16 changes: 5 additions & 11 deletions libvcx_core/src/api_vcx/api_global/wallet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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,
Expand All @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion libvcx_core/src/api_vcx/api_handle/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 524f718

Please sign in to comment.