From c6d3f3ab7b3c801f823633a80b5352d7fea02ec6 Mon Sep 17 00:00:00 2001 From: Magic Cat Date: Tue, 2 Jan 2024 11:45:29 +0700 Subject: [PATCH] fix juno import --- go.mod | 2 +- modules/messages/types.go | 6 +++--- modules/messages/utils.go | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/go.mod b/go.mod index 1e557206..ce437796 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/forbole/juno/v4 -go 1.18 +go 1.20 require ( github.com/cosmos/cosmos-sdk v0.45.8 diff --git a/modules/messages/types.go b/modules/messages/types.go index 72d988de..0b70a945 100644 --- a/modules/messages/types.go +++ b/modules/messages/types.go @@ -2,7 +2,7 @@ package messages import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/forbole/juno/v5/types" + "github.com/forbole/juno/v4/types" ) // MessageAddressesParser represents a function that extracts all the @@ -37,13 +37,13 @@ func parseAddressesFromEvents(tx *types.Tx) []string { for _, event := range tx.Events { for _, attribute := range event.Attributes { // Try parsing the address as a validator address - validatorAddress, _ := sdk.ValAddressFromBech32(attribute.Value) + validatorAddress, _ := sdk.ValAddressFromBech32(string(attribute.Value)) if validatorAddress != nil { addresses = append(addresses, validatorAddress.String()) } // Try parsing the address as an account address - accountAddress, err := sdk.AccAddressFromBech32(attribute.Value) + accountAddress, err := sdk.AccAddressFromBech32(string(attribute.Value)) if err != nil { // Skip if the address is not an account address continue diff --git a/modules/messages/utils.go b/modules/messages/utils.go index 5538657f..4f9d9561 100644 --- a/modules/messages/utils.go +++ b/modules/messages/utils.go @@ -3,7 +3,7 @@ package messages import ( "unicode/utf8" - "github.com/forbole/juno/v5/types" + "github.com/forbole/juno/v4/types" ) func TrimLastChar(s string) string {