Browse Source

rename function

pull/8080/head
tycho garen 3 years ago
parent
commit
8c37df54bf
3 changed files with 8 additions and 8 deletions
  1. +6
    -6
      internal/evidence/pool_test.go
  2. +1
    -1
      internal/evidence/reactor_test.go
  3. +1
    -1
      internal/evidence/verify_test.go

+ 6
- 6
internal/evidence/pool_test.go View File

@ -34,7 +34,7 @@ var (
defaultEvidenceMaxBytes int64 = 1000
)
func bootstrapPool(t *testing.T, pool *evidence.Pool, store sm.Store) {
func startPool(t *testing.T, pool *evidence.Pool, store sm.Store) {
t.Helper()
state, err := store.Load()
if err != nil {
@ -68,7 +68,7 @@ func TestEvidencePoolBasic(t *testing.T) {
require.NoError(t, eventBus.Start(ctx))
pool := evidence.NewPool(logger, evidenceDB, stateStore, blockStore, evidence.NopMetrics(), eventBus)
bootstrapPool(t, pool, stateStore)
startPool(t, pool, stateStore)
// evidence not seen yet:
evs, size := pool.PendingEvidence(defaultEvidenceMaxBytes)
@ -136,7 +136,7 @@ func TestAddExpiredEvidence(t *testing.T) {
require.NoError(t, eventBus.Start(ctx))
pool := evidence.NewPool(logger, evidenceDB, stateStore, blockStore, evidence.NopMetrics(), eventBus)
bootstrapPool(t, pool, stateStore)
startPool(t, pool, stateStore)
testCases := []struct {
evHeight int64
@ -464,7 +464,7 @@ func TestRecoverPendingEvidence(t *testing.T) {
// create previous pool and populate it
pool := evidence.NewPool(logger, evidenceDB, stateStore, blockStore, evidence.NopMetrics(), eventBus)
bootstrapPool(t, pool, stateStore)
startPool(t, pool, stateStore)
goodEvidence, err := types.NewMockDuplicateVoteEvidenceWithValidator(
ctx,
@ -507,7 +507,7 @@ func TestRecoverPendingEvidence(t *testing.T) {
}, nil)
newPool := evidence.NewPool(logger, evidenceDB, newStateStore, blockStore, evidence.NopMetrics(), nil)
bootstrapPool(t, newPool, newStateStore)
startPool(t, newPool, newStateStore)
evList, _ := newPool.PendingEvidence(defaultEvidenceMaxBytes)
require.Equal(t, 1, len(evList))
@ -617,7 +617,7 @@ func defaultTestPool(ctx context.Context, t *testing.T, height int64) (*evidence
require.NoError(t, eventBus.Start(ctx))
pool := evidence.NewPool(logger, evidenceDB, stateStore, blockStore, evidence.NopMetrics(), eventBus)
bootstrapPool(t, pool, stateStore)
startPool(t, pool, stateStore)
return pool, val, eventBus
}


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

@ -87,7 +87,7 @@ func setup(ctx context.Context, t *testing.T, stateStores []sm.Store, chBuf uint
require.NoError(t, err)
rts.pools[nodeID] = evidence.NewPool(logger, evidenceDB, stateStores[idx], blockStore, evidence.NopMetrics(), eventBus)
bootstrapPool(t, rts.pools[nodeID], stateStores[idx])
startPool(t, rts.pools[nodeID], stateStores[idx])
require.NoError(t, err)


+ 1
- 1
internal/evidence/verify_test.go View File

@ -489,7 +489,7 @@ func TestVerifyDuplicateVoteEvidence(t *testing.T) {
require.NoError(t, eventBus.Start(ctx))
pool := evidence.NewPool(logger, dbm.NewMemDB(), stateStore, blockStore, evidence.NopMetrics(), eventBus)
bootstrapPool(t, pool, stateStore)
startPool(t, pool, stateStore)
evList := types.EvidenceList{goodEv}
err = pool.CheckEvidence(ctx, evList)


Loading…
Cancel
Save