Initialize private tx logger only if private tx functionality is enabled (#10758)

* Initialize private tx logger only if private tx functionality is enabled

* Fix configuration test

* Use default contructor for config
This commit is contained in:
Anton Gavrilov 2019-06-19 16:28:31 +02:00 committed by Niklas Adolfsson
parent 4ee217ba7c
commit e1333ea1e9

View File

@ -917,7 +917,10 @@ impl Configuration {
let provider_conf = ProviderConfig {
validator_accounts: to_addresses(&self.args.arg_private_validators)?,
signer_account: self.args.arg_private_signer.clone().and_then(|account| to_address(Some(account)).ok()),
logs_path: Some(dirs.base),
logs_path: match self.args.flag_private_enabled {
true => Some(dirs.base),
false => None,
}
};
let encryptor_conf = EncryptorConfig {
@ -1455,11 +1458,7 @@ mod tests {
net_settings: Default::default(),
ipfs_conf: Default::default(),
secretstore_conf: Default::default(),
private_provider_conf: ProviderConfig {
validator_accounts: Default::default(),
signer_account: Default::default(),
logs_path: Some(Directories::default().base),
},
private_provider_conf: Default::default(),
private_encryptor_conf: Default::default(),
private_tx_enabled: false,
name: "".into(),