use the tag interface for pubsub. (#1438)

* use the tag interface for pubsub.

* update tmlibs.

* Fix unresolved conflict.
This commit is contained in:
Thomas Corbière 2018-04-10 16:03:03 +02:00 committed by Anton Kaliaev
parent d93e177a69
commit 6a48bd0c88
3 changed files with 7 additions and 6 deletions

6
Gopkg.lock generated
View File

@ -270,6 +270,7 @@
version = "v0.7.3"
[[projects]]
branch = "develop"
name = "github.com/tendermint/tmlibs"
packages = [
"autofile",
@ -285,8 +286,7 @@
"pubsub/query",
"test"
]
revision = "2e24b64fc121dcdf1cabceab8dc2f7257675483c"
version = "v0.8.1"
revision = "357648b8d63732df77fb1dd0f5ad813800912854"
[[projects]]
branch = "master"
@ -383,6 +383,6 @@
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
inputs-digest = "9b49dde42e615372db85e13d7952cb547b8b1833458a4906f908af988cf0bd4f"
inputs-digest = "794125e6cc5926371340043eed0ce8731a2212367cc6d4b845e4618ef2dd1996"
solver-name = "gps-cdcl"
solver-version = 1

View File

@ -84,7 +84,8 @@
[[override]]
# [[constraint]]
name = "github.com/tendermint/tmlibs"
version = "~0.8.1"
# version = "~0.8.1"
branch = "develop"
[[constraint]]
name = "google.golang.org/grpc"

View File

@ -67,7 +67,7 @@ func (b *EventBus) UnsubscribeAll(ctx context.Context, subscriber string) error
func (b *EventBus) Publish(eventType string, eventData TMEventData) error {
// no explicit deadline for publishing events
ctx := context.Background()
b.pubsub.PublishWithTags(ctx, eventData, map[string]interface{}{EventTypeKey: eventType})
b.pubsub.PublishWithTags(ctx, eventData, tmpubsub.NewTagMap(map[string]interface{}{EventTypeKey: eventType}))
return nil
}
@ -114,7 +114,7 @@ func (b *EventBus) PublishEventTx(event EventDataTx) error {
logIfTagExists(TxHeightKey, tags, b.Logger)
tags[TxHeightKey] = event.Height
b.pubsub.PublishWithTags(ctx, event, tags)
b.pubsub.PublishWithTags(ctx, event, tmpubsub.NewTagMap(tags))
return nil
}