Browse Source

fmt

pull/8177/head
William Banfield 3 years ago
parent
commit
d5f4a19ddb
No known key found for this signature in database GPG Key ID: EFAD3442BF29E3AC
2 changed files with 25 additions and 25 deletions
  1. +15
    -15
      types/params.go
  2. +10
    -10
      types/params_test.go

+ 15
- 15
types/params.go View File

@ -88,11 +88,11 @@ type SynchronyParams struct {
// TimeoutParams configure the timings of the steps of the Tendermint consensus algorithm. // TimeoutParams configure the timings of the steps of the Tendermint consensus algorithm.
type TimeoutParams struct { type TimeoutParams struct {
Propose time.Duration `json:"propose,string"`
ProposeDelta time.Duration `json:"propose_delta,string"`
Vote time.Duration `json:"vote,string"`
VoteDelta time.Duration `json:"vote_delta,string"`
Commit time.Duration `json:"commit,string"`
Propose time.Duration `json:"propose,string"`
ProposeDelta time.Duration `json:"propose_delta,string"`
Vote time.Duration `json:"vote,string"`
VoteDelta time.Duration `json:"vote_delta,string"`
Commit time.Duration `json:"commit,string"`
BypassCommitTimeout bool `json:"bypass_commit_timeout"` BypassCommitTimeout bool `json:"bypass_commit_timeout"`
} }
@ -152,11 +152,11 @@ func DefaultSynchronyParams() SynchronyParams {
func DefaultTimeoutParams() TimeoutParams { func DefaultTimeoutParams() TimeoutParams {
return TimeoutParams{ return TimeoutParams{
Propose: 3000 * time.Millisecond,
ProposeDelta: 500 * time.Millisecond,
Vote: 1000 * time.Millisecond,
VoteDelta: 500 * time.Millisecond,
Commit: 1000 * time.Millisecond,
Propose: 3000 * time.Millisecond,
ProposeDelta: 500 * time.Millisecond,
Vote: 1000 * time.Millisecond,
VoteDelta: 500 * time.Millisecond,
Commit: 1000 * time.Millisecond,
BypassCommitTimeout: false, BypassCommitTimeout: false,
} }
} }
@ -373,11 +373,11 @@ func (params *ConsensusParams) ToProto() tmproto.ConsensusParams {
Precision: &params.Synchrony.Precision, Precision: &params.Synchrony.Precision,
}, },
Timeout: &tmproto.TimeoutParams{ Timeout: &tmproto.TimeoutParams{
Propose: &params.Timeout.Propose,
ProposeDelta: &params.Timeout.ProposeDelta,
Vote: &params.Timeout.Vote,
VoteDelta: &params.Timeout.VoteDelta,
Commit: &params.Timeout.Commit,
Propose: &params.Timeout.Propose,
ProposeDelta: &params.Timeout.ProposeDelta,
Vote: &params.Timeout.Vote,
VoteDelta: &params.Timeout.VoteDelta,
Commit: &params.Timeout.Commit,
BypassCommitTimeout: params.Timeout.BypassCommitTimeout, BypassCommitTimeout: params.Timeout.BypassCommitTimeout,
}, },
} }


+ 10
- 10
types/params_test.go View File

@ -205,11 +205,11 @@ func makeParams(args makeParamsArgs) ConsensusParams {
MessageDelay: args.messageDelay, MessageDelay: args.messageDelay,
}, },
Timeout: TimeoutParams{ Timeout: TimeoutParams{
Propose: args.propose,
ProposeDelta: args.proposeDelta,
Vote: args.vote,
VoteDelta: args.voteDelta,
Commit: args.commit,
Propose: args.propose,
ProposeDelta: args.proposeDelta,
Vote: args.vote,
VoteDelta: args.voteDelta,
Commit: args.commit,
BypassCommitTimeout: args.enableCommitTimeoutBypass, BypassCommitTimeout: args.enableCommitTimeoutBypass,
}, },
} }
@ -277,11 +277,11 @@ func TestConsensusParamsUpdate(t *testing.T) {
}), }),
updates: &tmproto.ConsensusParams{ updates: &tmproto.ConsensusParams{
Timeout: &tmproto.TimeoutParams{ Timeout: &tmproto.TimeoutParams{
Propose: durationPtr(2 * time.Second),
ProposeDelta: durationPtr(400 * time.Millisecond),
Vote: durationPtr(5 * time.Second),
VoteDelta: durationPtr(400 * time.Millisecond),
Commit: durationPtr(time.Minute),
Propose: durationPtr(2 * time.Second),
ProposeDelta: durationPtr(400 * time.Millisecond),
Vote: durationPtr(5 * time.Second),
VoteDelta: durationPtr(400 * time.Millisecond),
Commit: durationPtr(time.Minute),
BypassCommitTimeout: true, BypassCommitTimeout: true,
}, },
}, },


Loading…
Cancel
Save