From 6a48bd0c88e7a858d6ec44ea68e953bf41913433 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Corbi=C3=A8re?= Date: Tue, 10 Apr 2018 16:03:03 +0200 Subject: [PATCH] use the tag interface for pubsub. (#1438) * use the tag interface for pubsub. * update tmlibs. * Fix unresolved conflict. --- Gopkg.lock | 6 +++--- Gopkg.toml | 3 ++- types/event_bus.go | 4 ++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Gopkg.lock b/Gopkg.lock index a634a1ad3..c4d798709 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -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 diff --git a/Gopkg.toml b/Gopkg.toml index 47b6460f5..4bbcefa20 100644 --- a/Gopkg.toml +++ b/Gopkg.toml @@ -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" diff --git a/types/event_bus.go b/types/event_bus.go index 7c82d7e45..460a3e294 100644 --- a/types/event_bus.go +++ b/types/event_bus.go @@ -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 }