Skip to content

Commit

Permalink
Merge pull request #4 from initia-labs/fix-typo
Browse files Browse the repository at this point in the history
remove unnecessary comma
  • Loading branch information
beer-1 authored Oct 31, 2023
2 parents 72af8a0 + a2f5022 commit d027a7a
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions x/gov/keeper/proposal.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package keeper
import (
goerrors "errors"
"fmt"
"strings"

"cosmossdk.io/errors"
"github.com/cosmos/cosmos-sdk/client"
Expand Down Expand Up @@ -30,13 +31,13 @@ func (keeper Keeper) SubmitProposal(ctx sdk.Context, messages []sdk.Msg, metadat
return v1.Proposal{}, err
}

// Will hold a comma-separated string of all Msg type URLs.
msgsStr := ""
// Will hold a string slice of all Msg type URLs.
msgs := []string{}

// Loop through all messages and confirm that each has a handler and the gov module account
// as the only signer
for _, msg := range messages {
msgsStr += fmt.Sprintf(",%s", sdk.MsgTypeURL(msg))
msgs = append(msgs, sdk.MsgTypeURL(msg))

// perform a basic validation of the message
if err := msg.ValidateBasic(); err != nil {
Expand Down Expand Up @@ -99,7 +100,7 @@ func (keeper Keeper) SubmitProposal(ctx sdk.Context, messages []sdk.Msg, metadat
sdk.NewEvent(
types.EventTypeSubmitProposal,
sdk.NewAttribute(types.AttributeKeyProposalID, fmt.Sprintf("%d", proposalID)),
sdk.NewAttribute(types.AttributeKeyProposalMessages, msgsStr),
sdk.NewAttribute(types.AttributeKeyProposalMessages, strings.Join(msgs, ",")),
),
)

Expand Down

0 comments on commit d027a7a

Please sign in to comment.