From dd91c52840229286c9ee4b79ea36184dd9da85bf Mon Sep 17 00:00:00 2001 From: Magic Cat Date: Thu, 4 Jan 2024 16:24:13 +0700 Subject: [PATCH] updated attr key to string --- database/postgresql/postgresql.go | 2 +- types/utils.go | 2 +- types/utils/utils.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/database/postgresql/postgresql.go b/database/postgresql/postgresql.go index 5bb44989..fd06c85a 100644 --- a/database/postgresql/postgresql.go +++ b/database/postgresql/postgresql.go @@ -46,7 +46,7 @@ func Builder(ctx *database.Context) (database.Database, error) { postgresDb.SetMaxIdleConns(ctx.Cfg.MaxIdleConnections) return &Database{ - Cdc: ctx.EncodingConfig.Codec, + Cdc: ctx.EncodingConfig.Marshaler, Amino: ctx.EncodingConfig.Amino, SQL: postgresDb, diff --git a/types/utils.go b/types/utils.go index d326f14c..a3559088 100644 --- a/types/utils.go +++ b/types/utils.go @@ -44,7 +44,7 @@ func FindEventsByType(events []abci.Event, eventType string) []abci.Event { func FindAttributeByKey(event abci.Event, attrKey string) (abci.EventAttribute, error) { for _, attr := range event.Attributes { - if attr.Key == attrKey { + if string(attr.Key) == attrKey { return attr, nil } } diff --git a/types/utils/utils.go b/types/utils/utils.go index 1d0b3c22..835a9174 100644 --- a/types/utils/utils.go +++ b/types/utils/utils.go @@ -44,7 +44,7 @@ func FindEventsByType(events []abci.Event, eventType string) []abci.Event { func FindAttributeByKey(event abci.Event, attrKey string) (abci.EventAttribute, error) { for _, attr := range event.Attributes { - if attr.Key == attrKey { + if string(attr.Key) == attrKey { return attr, nil } }