Skip to content

Commit

Permalink
Fix compile error
Browse files Browse the repository at this point in the history
Signed-off-by: Patrik Stas <patrik.stas@absa.africa>
  • Loading branch information
Patrik-Stas committed Jul 19, 2022
1 parent b0ac25d commit e8c4519
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion aries_vcx/src/init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ pub fn create_agency_client_for_main_wallet(config: &AgencyClientConfig) -> VcxR
}

pub fn init_issuer_config(config: &IssuerConfig) -> VcxResult<()> {
settings::set_config_value(settings::CONFIG_INSTITUTION_DID, &config.institution_did);
settings::set_config_value(settings::CONFIG_INSTITUTION_DID, &config.institution_did)?;
Ok(())
}

Expand Down
14 changes: 8 additions & 6 deletions aries_vcx/src/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,14 +94,14 @@ pub fn set_testing_defaults() -> u32 {
error::SUCCESS.code_num
}

pub fn enable_indy_mocks() {
pub fn enable_indy_mocks() -> VcxResult<()> {
warn!("enable_indy_mocks >>>");
set_config_value(CONFIG_ENABLE_TEST_MODE, "true");
set_config_value(CONFIG_ENABLE_TEST_MODE, "true")
}

pub fn disable_indy_mocks() {
pub fn disable_indy_mocks() -> VcxResult<()> {
warn!("disable_indy_mocks >>>");
set_config_value(CONFIG_ENABLE_TEST_MODE, "false");
set_config_value(CONFIG_ENABLE_TEST_MODE, "false")
}

pub fn indy_mocks_enabled() -> bool {
Expand All @@ -127,11 +127,13 @@ pub fn get_config_value(key: &str) -> VcxResult<String> {
.ok_or(VcxError::from_msg(VcxErrorKind::InvalidConfiguration, format!("Cannot read \"{}\" from settings", key)))
}

pub fn set_config_value(key: &str, value: &str) {
pub fn set_config_value(key: &str, value: &str) -> VcxResult<()> {
trace!("set_config_value >>> key: {}, value: {}", key, value);
SETTINGS
.write().unwrap()
.write()
.or(Err(VcxError::from_msg(VcxErrorKind::UnknownError, "Cannot write settings")))?
.insert(key.to_string(), value.to_string());
Ok(())
}

pub fn get_protocol_version() -> usize {
Expand Down
2 changes: 1 addition & 1 deletion libvcx/src/api_lib/api_c/vcx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use libc::c_char;
use aries_vcx::agency_client::configuration::AgencyClientConfig;
use aries_vcx::error::{VcxError, VcxErrorKind};
use aries_vcx::indy::CommandHandle;
use aries_vcx::init::{create_agency_client_for_main_wallet, enable_agency_mocks, enable_vcx_mocks, init_issuer_config, open_main_pool, PoolConfig};
use aries_vcx::init::{create_agency_client_for_main_wallet, enable_agency_mocks, init_issuer_config, open_main_pool, PoolConfig};
use aries_vcx::libindy::utils::{ledger, pool, wallet};
use aries_vcx::libindy::utils::pool::is_pool_open;
use aries_vcx::libindy::utils::wallet::{close_main_wallet, IssuerConfig, WalletConfig};
Expand Down

0 comments on commit e8c4519

Please sign in to comment.