From 0cfe95114c7a2aa3c20a40a3981d9185df87c97c Mon Sep 17 00:00:00 2001 From: William Banfield Date: Tue, 2 Nov 2021 16:16:39 +0100 Subject: [PATCH] wip --- types/params.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/types/params.go b/types/params.go index c4ec94680..e979622d5 100644 --- a/types/params.go +++ b/types/params.go @@ -76,6 +76,7 @@ type VersionParams struct { } // TimestampParams influence the validity of block timestamps. +// TODO (@wbanfield): add link to proposer-based timestamp spec when completed. type TimestampParams struct { Precision time.Duration `json:"precision"` Accuracy time.Duration `json:"accuracy"` @@ -89,11 +90,11 @@ func DefaultConsensusParams() *ConsensusParams { Evidence: DefaultEvidenceParams(), Validator: DefaultValidatorParams(), Version: DefaultVersionParams(), + Timestamp: DefaultTimestampParams(), } } // DefaultBlockParams returns a default BlockParams. -// TODO (@wbanfield): add link to proposer-based timestamp spec when completed. func DefaultBlockParams() BlockParams { return BlockParams{ MaxBytes: 22020096, // 21MB @@ -124,6 +125,14 @@ func DefaultVersionParams() VersionParams { } } +func DefaultTimestampParams() TimestampParams { + return TimestampParams{ + Precision: 0, + Accuracy: 0, + MsgDelay: 0, + } +} + func (val *ValidatorParams) IsValidPubkeyType(pubkeyType string) bool { for i := 0; i < len(val.PubKeyTypes); i++ { if val.PubKeyTypes[i] == pubkeyType {