Backport kvindexer fix

This commit is contained in:
Jasmina Malicevic
2022-12-14 13:31:06 +01:00
parent b6d99beae6
commit 6fe2b13283
2 changed files with 19 additions and 19 deletions

View File

@@ -156,13 +156,13 @@ func TestBlockIndexerMulti(t *testing.T) {
Type: "end_event",
Attributes: []abci.EventAttribute{
{
Key: []byte("foo"),
Value: []byte("100"),
Key: "foo",
Value: "100",
Index: true,
},
{
Key: []byte("bar"),
Value: []byte("200"),
Key: "bar",
Value: "200",
Index: true,
},
},
@@ -171,13 +171,13 @@ func TestBlockIndexerMulti(t *testing.T) {
Type: "end_event",
Attributes: []abci.EventAttribute{
{
Key: []byte("foo"),
Value: []byte("300"),
Key: "foo",
Value: "300",
Index: true,
},
{
Key: []byte("bar"),
Value: []byte("400"),
Key: "bar",
Value: "400",
Index: true,
},
},
@@ -197,13 +197,13 @@ func TestBlockIndexerMulti(t *testing.T) {
Type: "end_event",
Attributes: []abci.EventAttribute{
{
Key: []byte("foo"),
Value: []byte("100"),
Key: "foo",
Value: "100",
Index: true,
},
{
Key: []byte("bar"),
Value: []byte("200"),
Key: "bar",
Value: "200",
Index: true,
},
},
@@ -212,13 +212,13 @@ func TestBlockIndexerMulti(t *testing.T) {
Type: "end_event",
Attributes: []abci.EventAttribute{
{
Key: []byte("foo"),
Value: []byte("300"),
Key: "foo",
Value: "300",
Index: true,
},
{
Key: []byte("bar"),
Value: []byte("400"),
Key: "bar",
Value: "400",
Index: true,
},
},

View File

@@ -144,9 +144,9 @@ func TestTxSearchEventMatch(t *testing.T) {
indexer := NewTxIndex(db.NewMemDB())
txResult := txResultWithEvents([]abci.Event{
{Type: "account", Attributes: []abci.EventAttribute{{Key: []byte("number"), Value: []byte("1"), Index: true}, {Key: []byte("owner"), Value: []byte("Ana"), Index: true}}},
{Type: "account", Attributes: []abci.EventAttribute{{Key: []byte("number"), Value: []byte("2"), Index: true}, {Key: []byte("owner"), Value: []byte("Ivan"), Index: true}}},
{Type: "", Attributes: []abci.EventAttribute{{Key: []byte("not_allowed"), Value: []byte("Vlad"), Index: true}}},
{Type: "account", Attributes: []abci.EventAttribute{{Key: "number", Value: "1", Index: true}, {Key: "owner", Value: "Ana", Index: true}}},
{Type: "account", Attributes: []abci.EventAttribute{{Key: "number", Value: "2", Index: true}, {Key: "owner", Value: "Ivan", Index: true}}},
{Type: "", Attributes: []abci.EventAttribute{{Key: "not_allowed", Value: "Vlad", Index: true}}},
})
err := indexer.Index(txResult)