Skip to content

Commit

Permalink
updated attr key to string
Browse files Browse the repository at this point in the history
  • Loading branch information
MonikaCat committed Jan 5, 2024
1 parent c4a6ac0 commit fdb10db
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 12 deletions.
2 changes: 1 addition & 1 deletion database/postgresql/postgresql.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
11 changes: 2 additions & 9 deletions modules/messages/account_parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -279,15 +279,8 @@ func AuthzMessageParser(c codec.Codec, cosmosMsg sdk.Msg) ([]string, error) {
}
addresses = append(addresses, msg.Grantee)
return addresses, nil
case strings.Contains(index.TypeUrl, "gov.v1beta1"):
addresses, err := GovV1Beta1MessagesParser(c, executedMsg)
if err != nil {
return nil, MessageNotSupported(executedMsg)
}
addresses = append(addresses, msg.Grantee)
return addresses, nil
case strings.Contains(index.TypeUrl, "gov.v1."):
addresses, err := GovV1MessageParser(c, executedMsg)
case strings.Contains(index.TypeUrl, "gov"):
addresses, err := GovMessagesParser(c, executedMsg)
if err != nil {
return nil, MessageNotSupported(executedMsg)
}
Expand Down
2 changes: 1 addition & 1 deletion types/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Expand Down
2 changes: 1 addition & 1 deletion types/utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Expand Down

0 comments on commit fdb10db

Please sign in to comment.