mirror of
https://github.com/tendermint/tendermint.git
synced 2026-02-04 11:02:06 +00:00
* Rebased and git-squashed the commits in PR #6546 migrate abci to finalizeBlock work on abci, proxy and mempool abciresponse, blok events, indexer, some tests fix some tests fix errors fix errors in abci fix tests amd errors * Fixes after rebasing PR#6546 * Restored height to RequestFinalizeBlock & other * Fixed more UTs * Fixed kvstore * More UT fixes * last TC fixed * make format * Update internal/consensus/mempool_test.go Co-authored-by: William Banfield <4561443+williambanfield@users.noreply.github.com> * Addressed @williambanfield's comments * Fixed UTs * Addressed last comments from @williambanfield * make format Co-authored-by: marbar3778 <marbar3778@yahoo.com> Co-authored-by: William Banfield <4561443+williambanfield@users.noreply.github.com>
44 lines
1.0 KiB
Go
44 lines
1.0 KiB
Go
package null
|
|
|
|
import (
|
|
"context"
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
|
|
"github.com/tendermint/tendermint/internal/state/indexer"
|
|
"github.com/tendermint/tendermint/types"
|
|
)
|
|
|
|
func TestNullEventSink(t *testing.T) {
|
|
ctx, cancel := context.WithCancel(context.Background())
|
|
defer cancel()
|
|
|
|
nullIndexer := NewEventSink()
|
|
|
|
assert.Nil(t, nullIndexer.IndexTxEvents(nil))
|
|
assert.Nil(t, nullIndexer.IndexBlockEvents(types.EventDataNewBlockHeader{}))
|
|
val1, err1 := nullIndexer.SearchBlockEvents(ctx, nil)
|
|
assert.Nil(t, val1)
|
|
assert.NoError(t, err1)
|
|
val2, err2 := nullIndexer.SearchTxEvents(ctx, nil)
|
|
assert.Nil(t, val2)
|
|
assert.NoError(t, err2)
|
|
val3, err3 := nullIndexer.GetTxByHash(nil)
|
|
assert.Nil(t, val3)
|
|
assert.NoError(t, err3)
|
|
val4, err4 := nullIndexer.HasBlock(0)
|
|
assert.False(t, val4)
|
|
assert.NoError(t, err4)
|
|
}
|
|
|
|
func TestType(t *testing.T) {
|
|
nullIndexer := NewEventSink()
|
|
assert.Equal(t, indexer.NULL, nullIndexer.Type())
|
|
}
|
|
|
|
func TestStop(t *testing.T) {
|
|
nullIndexer := NewEventSink()
|
|
assert.Nil(t, nullIndexer.Stop())
|
|
}
|