Skip to content

Commit

Permalink
extract variable
Browse files Browse the repository at this point in the history
  • Loading branch information
dvush committed Jun 23, 2020
1 parent 7788f1c commit 32af2ea
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions core/models/src/config_options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,14 @@ impl ConfigurationOptions {
pub fn from_env() -> Self {
let mut available_block_chunk_sizes = block_chunk_sizes().to_vec();
available_block_chunk_sizes.sort();

let max_miniblock_iterations_withdraw_block =
if env::var("WITHDRAW_BLOCK_MINIBLOCKS_ITERATIONS").is_ok() {
parse_env("WITHDRAW_BLOCK_MINIBLOCKS_ITERATIONS")
} else {
parse_env("MINIBLOCKS_ITERATIONS")
};

Self {
rest_api_server_address: parse_env("REST_API_BIND"),
json_rpc_http_server_address: parse_env("HTTP_RPC_API_BIND"),
Expand Down Expand Up @@ -168,15 +176,7 @@ impl ConfigurationOptions {
ticker_url: parse_env("TICKER_URL"),
idle_provers: parse_env("IDLE_PROVERS"),
max_miniblock_iterations: parse_env("MINIBLOCKS_ITERATIONS"),
max_miniblock_iterations_withdraw_block: if env::var(
"WITHDRAW_BLOCK_MINIBLOCKS_ITERATIONS",
)
.is_ok()
{
parse_env("WITHDRAW_BLOCK_MINIBLOCKS_ITERATIONS")
} else {
parse_env("MINIBLOCKS_ITERATIONS")
},
max_miniblock_iterations_withdraw_block,
}
}
}
Expand Down

0 comments on commit 32af2ea

Please sign in to comment.