From 8cef5177885a94d044734a09352708b91ed3cca1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Drwi=C4=99ga?= Date: Thu, 27 Oct 2016 16:56:18 +0200 Subject: [PATCH] Fixing config values for pruning_history (#2918) --- parity/cli/mod.rs | 14 ++++++++++++++ parity/cli/usage.txt | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/parity/cli/mod.rs b/parity/cli/mod.rs index 27e0cb4dc..9290ab0f9 100644 --- a/parity/cli/mod.rs +++ b/parity/cli/mod.rs @@ -445,6 +445,20 @@ mod tests { assert_eq!(args.flag_chain, "xyz".to_owned()); } + #[test] + fn should_use_config_if_cli_is_missing() { + let mut config = Config::default(); + let mut footprint = Footprint::default(); + footprint.pruning_history = Some(128); + config.footprint = Some(footprint); + + // when + let args = Args::parse_with_config(&["parity"], config).unwrap(); + + // then + assert_eq!(args.flag_pruning_history, 128); + } + #[test] fn should_parse_full_config() { // given diff --git a/parity/cli/usage.txt b/parity/cli/usage.txt index af8e83f0e..bebdafd97 100644 --- a/parity/cli/usage.txt +++ b/parity/cli/usage.txt @@ -225,7 +225,7 @@ Footprint Options: auto - use the method most recently synced or default to fast if none synced (default: {flag_pruning}). --pruning-history NUM Set a number of recent states to keep when pruning - is active. [default: {flag_pruning_history}]. + is active. (default: {flag_pruning_history}). --cache-size-db MB Override database cache size (default: {flag_cache_size_db}). --cache-size-blocks MB Specify the prefered size of the blockchain cache in megabytes (default: {flag_cache_size_blocks}).