ValidateBasic performs basic validation (checking param bounds, etc.) and returns an error if any check fails.
()
| 1231 | // ValidateBasic performs basic validation (checking param bounds, etc.) and |
| 1232 | // returns an error if any check fails. |
| 1233 | func (cfg *ConsensusConfig) ValidateBasic() error { |
| 1234 | if cfg.TimeoutPropose < 0 { |
| 1235 | return errors.New("timeout-propose can't be negative") |
| 1236 | } |
| 1237 | if cfg.TimeoutProposeDelta < 0 { |
| 1238 | return errors.New("timeout-propose-delta can't be negative") |
| 1239 | } |
| 1240 | if cfg.TimeoutPrevote < 0 { |
| 1241 | return errors.New("timeout-prevote can't be negative") |
| 1242 | } |
| 1243 | if cfg.TimeoutPrevoteDelta < 0 { |
| 1244 | return errors.New("timeout-prevote-delta can't be negative") |
| 1245 | } |
| 1246 | if cfg.TimeoutPrecommit < 0 { |
| 1247 | return errors.New("timeout-precommit can't be negative") |
| 1248 | } |
| 1249 | if cfg.TimeoutPrecommitDelta < 0 { |
| 1250 | return errors.New("timeout-precommit-delta can't be negative") |
| 1251 | } |
| 1252 | if cfg.TimeoutCommit < 0 { |
| 1253 | return errors.New("timeout-commit can't be negative") |
| 1254 | } |
| 1255 | if cfg.CreateEmptyBlocksInterval < 0 { |
| 1256 | return errors.New("create-empty-blocks-interval can't be negative") |
| 1257 | } |
| 1258 | if cfg.PeerGossipSleepDuration < 0 { |
| 1259 | return errors.New("peer-gossip-sleep-duration can't be negative") |
| 1260 | } |
| 1261 | if cfg.PeerQueryMaj23SleepDuration < 0 { |
| 1262 | return errors.New("peer-query-maj23-sleep-duration can't be negative") |
| 1263 | } |
| 1264 | if cfg.DoubleSignCheckHeight < 0 { |
| 1265 | return errors.New("double-sign-check-height can't be negative") |
| 1266 | } |
| 1267 | return nil |
| 1268 | } |
| 1269 | |
| 1270 | //----------------------------------------------------------------------------- |
| 1271 | // TxIndexConfig |
nothing calls this directly
no outgoing calls
no test coverage detected