From 16cf7a5e0a47ecead703f8159e6ed6fc028672df Mon Sep 17 00:00:00 2001 From: Anton Kaliaev Date: Fri, 24 Nov 2017 18:23:17 -0600 Subject: [PATCH] use a switch when validating tags --- types/event_bus.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/types/event_bus.go b/types/event_bus.go index a4daaa3c..2e31489c 100644 --- a/types/event_bus.go +++ b/types/event_bus.go @@ -4,6 +4,7 @@ import ( "context" "fmt" + abci "github.com/tendermint/abci/types" cmn "github.com/tendermint/tmlibs/common" "github.com/tendermint/tmlibs/log" tmpubsub "github.com/tendermint/tmlibs/pubsub" @@ -96,9 +97,10 @@ func (b *EventBus) PublishEventTx(event EventDataTx) error { continue } - if tag.ValueString != "" { + switch tag.ValueType { + case abci.KVPair_STRING: tags[tag.Key] = tag.ValueString - } else { + case abci.KVPair_INT: tags[tag.Key] = tag.ValueInt } }