Skip to content

Commit

Permalink
Remove 'propose_timeout' from the config
Browse files Browse the repository at this point in the history
  • Loading branch information
stanislav-tkach committed Jul 18, 2017
1 parent 8f50089 commit ed46892
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 15 deletions.
3 changes: 0 additions & 3 deletions exonum/src/blockchain/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@ pub struct ConsensusConfig {
pub status_timeout: Milliseconds,
/// Peer exchange timeout.
pub peers_timeout: Milliseconds,
/// Proposal timeout after committing a block.
pub propose_timeout: Milliseconds,
/// Maximum number of transactions per block.
pub txs_block_limit: u32,
/// `TimeoutAdjuster` configuration.
Expand All @@ -72,7 +70,6 @@ impl Default for ConsensusConfig {
fn default() -> Self {
ConsensusConfig {
round_timeout: 3000,
propose_timeout: 500,
status_timeout: 5000,
peers_timeout: 10000,
txs_block_limit: 1000,
Expand Down
1 change: 0 additions & 1 deletion exonum/src/helpers/fabric/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ impl NodeBuilder {
T: Into<OsString> + Clone,
{
ClapBackend::execute_cmd_string(self.commands.as_slice(), cmd_line) != Feedback::None

}

/// Parse cmd args, return `Node`, if run command found
Expand Down
3 changes: 1 addition & 2 deletions exonum/src/helpers/fabric/details.rs
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,6 @@ impl Command for GenerateNodeConfig {
"expected secret config path",
);


let addr = Self::addr(&context);
let common: CommonConfigTemplate =
ConfigFile::load(&common_config_path).expect("Could not load common config");
Expand Down Expand Up @@ -289,7 +288,7 @@ impl Command for GenerateNodeConfig {
node: node_pub_config,
common: common,
};
// save public config seperately
// Save public config separately.
ConfigFile::save(&shared_config, &pub_config_path).expect(
"Could not write public config file.",
);
Expand Down
5 changes: 0 additions & 5 deletions exonum/src/node/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -292,11 +292,6 @@ where
&self.api_state
}

/// Returns value of the `propose_timeout` field from the current `ConsensusConfig`.
pub fn propose_timeout(&self) -> Milliseconds {
self.state().consensus_config().propose_timeout
}

/// Returns value of the `round_timeout` field from the current `ConsensusConfig`.
pub fn round_timeout(&self) -> Milliseconds {
self.state().consensus_config().round_timeout
Expand Down
2 changes: 1 addition & 1 deletion exonum/src/node/timeout_adjuster.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ pub trait TimeoutAdjuster: Send + Debug {
fn adjust_timeout(&mut self, view: &Snapshot) -> Milliseconds;
}

/// `Adjuster` implementation that returns value of `propose_timeout` field from `ConsensusConfig`.
/// `Adjuster` implementation that always returns the same value.
#[derive(Debug)]
pub struct Constant {
timeout: Milliseconds,
Expand Down
2 changes: 0 additions & 2 deletions exonum/tests/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@ fn run_node(config: &str, folder: &str) {
]));
}


#[test]
fn test_generate_template() {
let command = "generate-template";
Expand Down Expand Up @@ -161,7 +160,6 @@ fn test_generate_config() {
}
}


#[test]
#[cfg_attr(feature = "cargo-clippy", allow(needless_range_loop))]
fn test_generate_full_config_run() {
Expand Down
5 changes: 4 additions & 1 deletion exonum/tests/testdata/config/template.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
[consensus_config]
peers_timeout = 10000
propose_timeout = 500
round_timeout = 3000
status_timeout = 5000
txs_block_limit = 1000

[consensus_config.timeout_adjuster]
type = "Constant"
timeout = 500

[services_config]

0 comments on commit ed46892

Please sign in to comment.