mirror of
https://github.com/tendermint/tendermint.git
synced 2026-09-19 14:34:17 +00:00
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:
@@ -11,7 +11,6 @@ import (
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
abci "github.com/tendermint/tendermint/abci/types"
|
||||
"github.com/tendermint/tendermint/libs/kv"
|
||||
tmpubsub "github.com/tendermint/tendermint/libs/pubsub"
|
||||
tmquery "github.com/tendermint/tendermint/libs/pubsub/query"
|
||||
tmrand "github.com/tendermint/tendermint/libs/rand"
|
||||
@@ -27,7 +26,7 @@ func TestEventBusPublishEventTx(t *testing.T) {
|
||||
result := abci.ResponseDeliverTx{
|
||||
Data: []byte("bar"),
|
||||
Events: []abci.Event{
|
||||
{Type: "testType", Attributes: []kv.Pair{{Key: []byte("baz"), Value: []byte("1")}}},
|
||||
{Type: "testType", Attributes: []abci.EventAttribute{{Key: []byte("baz"), Value: []byte("1")}}},
|
||||
},
|
||||
}
|
||||
|
||||
@@ -71,12 +70,12 @@ func TestEventBusPublishEventNewBlock(t *testing.T) {
|
||||
block := MakeBlock(0, []Tx{}, nil, []Evidence{})
|
||||
resultBeginBlock := abci.ResponseBeginBlock{
|
||||
Events: []abci.Event{
|
||||
{Type: "testType", Attributes: []kv.Pair{{Key: []byte("baz"), Value: []byte("1")}}},
|
||||
{Type: "testType", Attributes: []abci.EventAttribute{{Key: []byte("baz"), Value: []byte("1")}}},
|
||||
},
|
||||
}
|
||||
resultEndBlock := abci.ResponseEndBlock{
|
||||
Events: []abci.Event{
|
||||
{Type: "testType", Attributes: []kv.Pair{{Key: []byte("foz"), Value: []byte("2")}}},
|
||||
{Type: "testType", Attributes: []abci.EventAttribute{{Key: []byte("foz"), Value: []byte("2")}}},
|
||||
},
|
||||
}
|
||||
|
||||
@@ -121,7 +120,7 @@ func TestEventBusPublishEventTxDuplicateKeys(t *testing.T) {
|
||||
Events: []abci.Event{
|
||||
{
|
||||
Type: "transfer",
|
||||
Attributes: []kv.Pair{
|
||||
Attributes: []abci.EventAttribute{
|
||||
{Key: []byte("sender"), Value: []byte("foo")},
|
||||
{Key: []byte("recipient"), Value: []byte("bar")},
|
||||
{Key: []byte("amount"), Value: []byte("5")},
|
||||
@@ -129,7 +128,7 @@ func TestEventBusPublishEventTxDuplicateKeys(t *testing.T) {
|
||||
},
|
||||
{
|
||||
Type: "transfer",
|
||||
Attributes: []kv.Pair{
|
||||
Attributes: []abci.EventAttribute{
|
||||
{Key: []byte("sender"), Value: []byte("baz")},
|
||||
{Key: []byte("recipient"), Value: []byte("cat")},
|
||||
{Key: []byte("amount"), Value: []byte("13")},
|
||||
@@ -137,7 +136,7 @@ func TestEventBusPublishEventTxDuplicateKeys(t *testing.T) {
|
||||
},
|
||||
{
|
||||
Type: "withdraw.rewards",
|
||||
Attributes: []kv.Pair{
|
||||
Attributes: []abci.EventAttribute{
|
||||
{Key: []byte("address"), Value: []byte("bar")},
|
||||
{Key: []byte("source"), Value: []byte("iceman")},
|
||||
{Key: []byte("amount"), Value: []byte("33")},
|
||||
@@ -218,12 +217,12 @@ func TestEventBusPublishEventNewBlockHeader(t *testing.T) {
|
||||
block := MakeBlock(0, []Tx{}, nil, []Evidence{})
|
||||
resultBeginBlock := abci.ResponseBeginBlock{
|
||||
Events: []abci.Event{
|
||||
{Type: "testType", Attributes: []kv.Pair{{Key: []byte("baz"), Value: []byte("1")}}},
|
||||
{Type: "testType", Attributes: []abci.EventAttribute{{Key: []byte("baz"), Value: []byte("1")}}},
|
||||
},
|
||||
}
|
||||
resultEndBlock := abci.ResponseEndBlock{
|
||||
Events: []abci.Event{
|
||||
{Type: "testType", Attributes: []kv.Pair{{Key: []byte("foz"), Value: []byte("2")}}},
|
||||
{Type: "testType", Attributes: []abci.EventAttribute{{Key: []byte("foz"), Value: []byte("2")}}},
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user