Skip to content

Commit

Permalink
updated gov messages parser
Browse files Browse the repository at this point in the history
  • Loading branch information
MonikaCat committed Jun 20, 2023
1 parent efaece3 commit 3466fc3
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions modules/messages/account_parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ import (
crisistypes "github.com/cosmos/cosmos-sdk/x/crisis/types"
distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types"
evidencetypes "github.com/cosmos/cosmos-sdk/x/evidence/types"
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1"
govtypesv1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1"
govtypesv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1"
slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
ibctransfertypes "github.com/cosmos/ibc-go/v5/modules/apps/transfer/types"
Expand Down Expand Up @@ -141,10 +142,10 @@ func EvidenceMessagesParser(_ codec.Codec, cosmosMsg sdk.Msg) ([]string, error)
func GovMessagesParser(cdc codec.Codec, cosmosMsg sdk.Msg) ([]string, error) {
switch msg := cosmosMsg.(type) {

case *govtypes.MsgSubmitProposal:
case *govtypesv1beta1.MsgSubmitProposal:
addresses := []string{msg.Proposer}

var content govtypes.Content
var content govtypesv1beta1.Content
err := cdc.UnpackAny(msg.Content, &content)
if err != nil {
return nil, err
Expand All @@ -158,10 +159,10 @@ func GovMessagesParser(cdc codec.Codec, cosmosMsg sdk.Msg) ([]string, error) {

return addresses, nil

case *govtypes.MsgDeposit:
case *govtypesv1.MsgDeposit:
return []string{msg.Depositor}, nil

case *govtypes.MsgVote:
case *govtypesv1.MsgVote:
return []string{msg.Voter}, nil

}
Expand Down

0 comments on commit 3466fc3

Please sign in to comment.