Skip to content

Commit

Permalink
fix: allow re-creation agent wallet
Browse files Browse the repository at this point in the history
Signed-off-by: Pritam Singh <pkspritam16@gmail.com>
  • Loading branch information
Zzocker committed May 14, 2024
1 parent 05421cd commit c1311f8
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions aries/agents/aries-vcx-agent/src/agent/init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ use aries_vcx::{
use aries_vcx_anoncreds::{
self,
anoncreds::{base_anoncreds::BaseAnonCreds, credx_anoncreds::IndyCredxAnonCreds},
errors::error::VcxAnoncredsError,
};
use aries_vcx_ledger::ledger::indy_vdr_ledger::{
build_ledger_components, DefaultIndyLedgerRead, VcxPoolConfig,
Expand Down Expand Up @@ -64,10 +65,15 @@ pub async fn build_indy_wallet(
let config_issuer = wallet.configure_issuer(&isser_seed).await.unwrap();

let anoncreds = IndyCredxAnonCreds;
anoncreds
.prover_create_link_secret(&wallet, &DEFAULT_LINK_SECRET_ALIAS.to_string())
.await
.unwrap();

if let Err(err) = anoncreds
.prover_create_link_secret(&wallet, &DEFAULT_LINK_SECRET_ALIAS.to_string())
.await {
match err {
VcxAnoncredsError::DuplicationMasterSecret(_) => {}, // ignore
_ => panic!("{}",err)
};
}

(wallet, config_issuer)
}
Expand Down

0 comments on commit c1311f8

Please sign in to comment.