Skip to content

Commit

Permalink
replace v1beta1 proposal in test since legacy server is disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
alexgao001 committed Feb 20, 2023
1 parent 63c2075 commit f1a033d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion x/feegrant/client/testutil/suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -820,7 +820,7 @@ func (s *IntegrationTestSuite) TestFilteredFeeAllowance() {
}
spendLimit := sdk.NewCoin("stake", sdk.NewInt(1000))

allowMsgs := strings.Join([]string{sdk.MsgTypeURL(&govv1beta1.MsgSubmitProposal{}), sdk.MsgTypeURL(&govv1.MsgVoteWeighted{})}, ",")
allowMsgs := strings.Join([]string{sdk.MsgTypeURL(&govv1.MsgSubmitProposal{}), sdk.MsgTypeURL(&govv1.MsgVoteWeighted{})}, ",")

testCases := []struct {
name string
Expand Down
10 changes: 8 additions & 2 deletions x/gov/client/cli/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import (
"strconv"
"strings"

authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"

"github.com/spf13/cobra"

"github.com/cosmos/cosmos-sdk/client"
Expand Down Expand Up @@ -186,11 +188,15 @@ $ %s tx gov submit-legacy-proposal --title="Test Proposal" --description="My awe
return fmt.Errorf("failed to create proposal content: unknown proposal type %s", proposal.Type)
}

msg, err := v1beta1.NewMsgSubmitProposal(content, amount, clientCtx.GetFromAddress())
govAcctAddress := authtypes.NewModuleAddress(types.ModuleName).String()
contentMsg, err := v1.NewLegacyContent(content, govAcctAddress)
if err != nil {
return err
}
msg, err := v1.NewMsgSubmitProposal([]sdk.Msg{contentMsg}, amount, clientCtx.GetFromAddress().String(), "")
if err != nil {
return fmt.Errorf("invalid message: %w", err)
}

return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg)
},
}
Expand Down
4 changes: 2 additions & 2 deletions x/params/keeper/sync_params.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ func (k Keeper) SyncParams(ctx sdk.Context, p *types.ParameterChangeProposal) er

for i, c := range p.Changes {
values = append(values, []byte(c.Value)...)
adr, err := sdk.AccAddressFromHexUnsafe(p.Addresses[i])
addr, err := sdk.AccAddressFromHexUnsafe(p.Addresses[i])
if err != nil {
return sdkerrors.Wrapf(types.ErrAddressNotValid, "smart contract address is not valid %s", p.Addresses[i])
}
addresses = append(addresses, adr.Bytes()...)
addresses = append(addresses, addr.Bytes()...)
}

pack := types.SyncParamsPackage{
Expand Down

0 comments on commit f1a033d

Please sign in to comment.