config: Add ValidateBasic (#2485)

* add missing options to config.toml template and docs
Refs #2232
* config#ValidateBasic
Refs #2232
* [config] timeouts as time.Duration, not ints
Why:
- native type provides better guarantees than ", in ms" comment (harder
to shoot yourself in the leg)
- flexibility: you can change units
This commit is contained in:
Anton Kaliaev
2018-09-26 14:04:44 +04:00
committed by Alexander Simmerl
parent df329e8f27
commit 4c4a95ca53
10 changed files with 210 additions and 110 deletions

View File

@ -21,8 +21,8 @@ func init() {
config = ResetConfig("consensus_state_test")
}
func ensureProposeTimeout(timeoutPropose int) time.Duration {
return time.Duration(timeoutPropose*2) * time.Millisecond
func ensureProposeTimeout(timeoutPropose time.Duration) time.Duration {
return time.Duration(timeoutPropose.Nanoseconds()*2) * time.Nanosecond
}
/*