Skip to content

Commit

Permalink
fix(group)!: Register types with Amino (cosmos#13592)
Browse files Browse the repository at this point in the history
* fix!(group): Register types with Amino

* Chagenlog
  • Loading branch information
amaury1093 authored and ryanchristo committed Dec 14, 2022
1 parent 5d80b6c commit 6c653d9
Showing 1 changed file with 4 additions and 13 deletions.
17 changes: 4 additions & 13 deletions x/group/msgs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@ import (
"testing"
"time"

"github.com/stretchr/testify/require"

sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module/testutil"
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
"github.com/cosmos/cosmos-sdk/x/group"
"github.com/cosmos/cosmos-sdk/x/group/module"
"github.com/stretchr/testify/require"
)

var (
Expand Down Expand Up @@ -972,7 +973,8 @@ func TestMsgSubmitProposalGetSignBytes(t *testing.T) {
expSignBz string
}{
{
"MsgSend", []sdk.Msg{banktypes.NewMsgSend(member1, member1, sdk.NewCoins())},
"MsgSend",
[]sdk.Msg{banktypes.NewMsgSend(member1, member1, sdk.NewCoins())},
fmt.Sprintf(`{"type":"cosmos-sdk/group/MsgSubmitProposal","value":{"messages":[{"type":"cosmos-sdk/MsgSend","value":{"amount":[],"from_address":"%s","to_address":"%s"}}],"proposers":[""]}}`, member1, member1),
},
}
Expand Down Expand Up @@ -1193,14 +1195,3 @@ func TestMsgLeaveGroup(t *testing.T) {
})
}
}

func TestAmino(t *testing.T) {
cdc := testutil.MakeTestEncodingConfig(module.AppModuleBasic{})

out, err := cdc.Amino.MarshalJSON(group.MsgSubmitProposal{Proposers: []string{member1.String()}})
require.NoError(t, err)
require.Equal(t,
`{"type":"cosmos-sdk/group/MsgSubmitProposal","value":{"proposers":["cosmos1d4jk6cn9wgcsj540xq"]}}`,
string(out),
)
}

0 comments on commit 6c653d9

Please sign in to comment.