Browse Source

fix lint

pull/8091/head
tycho garen 3 years ago
parent
commit
209bf76169
5 changed files with 9 additions and 8 deletions
  1. +1
    -1
      internal/consensus/byzantine_test.go
  2. +5
    -3
      internal/consensus/common_test.go
  3. +1
    -1
      internal/consensus/reactor_test.go
  4. +0
    -1
      internal/consensus/state.go
  5. +2
    -2
      internal/p2p/conn/connection.go

+ 1
- 1
internal/consensus/byzantine_test.go View File

@ -100,7 +100,7 @@ func TestByzantinePrevoteEquivocation(t *testing.T) {
cs.SetPrivValidator(ctx, pv)
cs.SetTimeoutTicker(tickerFunc())
cs.Start(ctx)
require.NoError(t, cs.Start(ctx))
states[i] = cs
}()


+ 5
- 3
internal/consensus/common_test.go View File

@ -500,7 +500,9 @@ func newStateWithConfigAndBlockStore(
t.Fatal(err)
}
cs.SetPrivValidator(ctx, pv)
cs.Start(ctx)
if err := cs.Start(ctx); err != nil {
t.Fatal(err)
}
return cs
}
@ -819,7 +821,7 @@ func makeConsensusState(
l := logger.With("validator", i, "module", "consensus")
css[i] = newStateWithConfigAndBlockStore(ctx, t, l, thisConfig, state, privVals[i], app, blockStore)
css[i].SetTimeoutTicker(tickerFunc())
css[i].Start(ctx)
require.NoError(t, css[i].Start(ctx))
}
return css, func() {
@ -888,7 +890,7 @@ func randConsensusNetWithPeers(
css[i] = newStateWithConfig(ctx, t, logger.With("validator", i, "module", "consensus"), thisConfig, state, privVal, app)
css[i].SetTimeoutTicker(tickerFunc())
css[i].Start(ctx)
require.NoError(t, css[i].Start(ctx))
}
return css, genDoc, peer0Config, func() {
for _, dir := range configRootDirs {


+ 1
- 1
internal/consensus/reactor_test.go View File

@ -517,7 +517,7 @@ func TestReactorWithEvidence(t *testing.T) {
cs.SetPrivValidator(ctx, pv)
cs.SetTimeoutTicker(tickerFunc())
cs.Start(ctx)
require.NoError(t, cs.Start(ctx))
states[i] = cs
}


+ 0
- 1
internal/consensus/state.go View File

@ -482,7 +482,6 @@ func (cs *State) OnStart(ctx context.Context) error {
//
// this is only used in tests.
func (cs *State) startRoutines(ctx context.Context, maxSteps int) {
return
err := cs.timeoutTicker.Start(ctx)
if err != nil {
cs.logger.Error("failed to start timeout ticker", "err", err)


+ 2
- 2
internal/p2p/conn/connection.go View File

@ -45,8 +45,8 @@ const (
defaultSendRate = int64(512000) // 500KB/s
defaultRecvRate = int64(512000) // 500KB/s
defaultSendTimeout = 10 * time.Second
defaultPingInterval = 60 * time.Second
defaultPongTimeout = 90 * time.Second
defaultPingInterval = 30 * time.Second
defaultPongTimeout = 5 * time.Minute
)
type receiveCbFunc func(ctx context.Context, chID ChannelID, msgBytes []byte)


Loading…
Cancel
Save