From cbfb82442ae4fcf9868fba3443a373bce7f82f32 Mon Sep 17 00:00:00 2001 From: Nina Barbakadze Date: Mon, 18 Nov 2024 17:31:52 +0100 Subject: [PATCH] test: expand unit tests to test for the bug --- state/txindex/kv/kv_test.go | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/state/txindex/kv/kv_test.go b/state/txindex/kv/kv_test.go index e2e4eeecdb..d805cc3c8b 100644 --- a/state/txindex/kv/kv_test.go +++ b/state/txindex/kv/kv_test.go @@ -692,8 +692,18 @@ func TestTxSearchMultipleTxs(t *testing.T) { results, err := indexer.Search(ctx, query.MustParse("account.number >= 1")) assert.NoError(t, err) - require.Len(t, results, 3) + + // since two txs were added at height 1 and 2, we should have two unique transactions + // for both heights + results, err = indexer.Search(ctx, query.MustParse("tx.height=1")) + assert.NoError(t, err) + require.Len(t, results, 2) + + results, err = indexer.Search(ctx, query.MustParse("tx.height=2")) + assert.NoError(t, err) + require.Len(t, results, 2) + } func txResultWithEvents(events []abci.Event) *abci.TxResult {