indexer: allow indexing an event at runtime (#4466)

The PR added a new field `index` to event attribute, that will cause indexer service to index the event if set to true.
This commit is contained in:
Diep Pham
2020-04-22 17:07:03 +07:00
committed by GitHub
parent 0a159c2613
commit 843d63f935
14 changed files with 757 additions and 279 deletions

View File

@@ -493,6 +493,20 @@ func TestTxSearch(t *testing.T) {
t.Fatal("expected a lot of transactions")
}
// query using an index key
result, err = c.TxSearch("app.index_key='index is working'", false, 1, 30, "asc")
require.Nil(t, err)
if len(result.Txs) == 0 {
t.Fatal("expected a lot of transactions")
}
// query using an noindex key
result, err = c.TxSearch("app.noindex_key='index is working'", false, 1, 30, "asc")
require.Nil(t, err)
if len(result.Txs) != 0 {
t.Fatal("expected no transaction")
}
// query using a compositeKey (see kvstore application) and height
result, err = c.TxSearch("app.creator='Cosmoshi Netowoko' AND tx.height<10000", true, 1, 30, "asc")
require.Nil(t, err)