Skip to content

Commit

Permalink
Put the wallet_handle Profile method behind the migration feature flag
Browse files Browse the repository at this point in the history
Signed-off-by: Bogdan Mircea <[email protected]>
  • Loading branch information
bobozaur committed Jun 22, 2023
1 parent beb2c77 commit d3b9a4e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
10 changes: 7 additions & 3 deletions aries_vcx/src/core/profile/profile.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
use std::sync::{Arc, RwLock};
use std::sync::Arc;

use crate::errors::error::VcxResult;
use aries_vcx_core::ledger::base_ledger::{TaaConfigurator, TxnAuthrAgrmtOptions};
use aries_vcx_core::ledger::base_ledger::TxnAuthrAgrmtOptions;
use aries_vcx_core::{
anoncreds::base_anoncreds::BaseAnonCreds,
ledger::base_ledger::{AnoncredsLedgerRead, AnoncredsLedgerWrite, IndyLedgerRead, IndyLedgerWrite},
wallet::base_wallet::BaseWallet,
WalletHandle,
};

use async_trait::async_trait;

#[cfg(feature = "migration")]
use aries_vcx_core::WalletHandle;

#[async_trait]
pub trait Profile: std::fmt::Debug + Send + Sync {
fn inject_indy_ledger_read(&self) -> Arc<dyn IndyLedgerRead>;
Expand All @@ -24,6 +27,7 @@ pub trait Profile: std::fmt::Debug + Send + Sync {

fn inject_wallet(&self) -> Arc<dyn BaseWallet>;

#[cfg(feature = "migration")]
fn wallet_handle(&self) -> Option<WalletHandle> {
None
}
Expand Down
3 changes: 2 additions & 1 deletion aries_vcx/src/core/profile/vdrtools_profile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use std::sync::Arc;

use super::profile::Profile;
use crate::errors::error::{AriesVcxError, AriesVcxErrorKind, VcxResult};
use aries_vcx_core::ledger::base_ledger::{TaaConfigurator, TxnAuthrAgrmtOptions};
use aries_vcx_core::ledger::base_ledger::TxnAuthrAgrmtOptions;
use aries_vcx_core::{
anoncreds::{base_anoncreds::BaseAnonCreds, indy_anoncreds::IndySdkAnonCreds},
ledger::{
Expand Down Expand Up @@ -67,6 +67,7 @@ impl Profile for VdrtoolsProfile {
self.wallet.clone()
}

#[cfg(feature = "migration")]
fn wallet_handle(&self) -> Option<WalletHandle> {
Some(self.wallet.wallet_handle)
}
Expand Down

0 comments on commit d3b9a4e

Please sign in to comment.