diff --git a/CHANGELOG.md b/CHANGELOG.md index ff5c4457..57d52c46 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,9 @@ ### BUG FIXES +* Fix duplicate amino path in gov module ([#44](https://github.com/atomone-hub/govgen/pull/44)) * Fix gov cli for params and upgrade proposals ([#42](https://github.com/atomone-hub/govgen/pull/42)) +* Ensure correct version of `protoc-gen-gocosmos` is installed ([#41](https://github.com/atomone-hub/govgen/pull/41)). ### DEPENDENCIES diff --git a/proto/scripts/protocgen.sh b/proto/scripts/protocgen.sh index 1e65487d..dbfcad09 100755 --- a/proto/scripts/protocgen.sh +++ b/proto/scripts/protocgen.sh @@ -8,7 +8,7 @@ protoc_gen_gocosmos() { return 1 fi - go get github.com/regen-network/cosmos-proto/protoc-gen-gocosmos@latest 2>/dev/null + go install github.com/regen-network/cosmos-proto/protoc-gen-gocosmos 2>/dev/null } protoc_gen_gocosmos diff --git a/x/gov/types/codec.go b/x/gov/types/codec.go index 00af4e6f..85bed6bd 100644 --- a/x/gov/types/codec.go +++ b/x/gov/types/codec.go @@ -14,11 +14,11 @@ import ( // governance module. func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { cdc.RegisterInterface((*Content)(nil), nil) - cdc.RegisterConcrete(&MsgSubmitProposal{}, "cosmos-sdk/MsgSubmitProposal", nil) - cdc.RegisterConcrete(&MsgDeposit{}, "cosmos-sdk/MsgDeposit", nil) - cdc.RegisterConcrete(&MsgVote{}, "cosmos-sdk/MsgVote", nil) - cdc.RegisterConcrete(&MsgVoteWeighted{}, "cosmos-sdk/MsgVoteWeighted", nil) - cdc.RegisterConcrete(&TextProposal{}, "cosmos-sdk/TextProposal", nil) + cdc.RegisterConcrete(&MsgSubmitProposal{}, "govgen/MsgSubmitProposal", nil) + cdc.RegisterConcrete(&MsgDeposit{}, "govgen/MsgDeposit", nil) + cdc.RegisterConcrete(&MsgVote{}, "govgen/MsgVote", nil) + cdc.RegisterConcrete(&MsgVoteWeighted{}, "govgen/MsgVoteWeighted", nil) + cdc.RegisterConcrete(&TextProposal{}, "govgen/TextProposal", nil) } func RegisterInterfaces(registry types.InterfaceRegistry) { diff --git a/x/gov/types/msgs_test.go b/x/gov/types/msgs_test.go index 2a8fd527..b87e160d 100644 --- a/x/gov/types/msgs_test.go +++ b/x/gov/types/msgs_test.go @@ -64,7 +64,7 @@ func TestMsgDepositGetSignBytes(t *testing.T) { msg := NewMsgDeposit(addr, 0, coinsPos) res := msg.GetSignBytes() - expected := `{"type":"cosmos-sdk/MsgDeposit","value":{"amount":[{"amount":"1000","denom":"stake"}],"depositor":"cosmos1v9jxgu33kfsgr5","proposal_id":"0"}}` + expected := `{"type":"govgen/MsgDeposit","value":{"amount":[{"amount":"1000","denom":"stake"}],"depositor":"cosmos1v9jxgu33kfsgr5","proposal_id":"0"}}` require.Equal(t, expected, string(res)) } @@ -171,6 +171,6 @@ func TestMsgSubmitProposal_GetSignBytes(t *testing.T) { bz = msg.GetSignBytes() }) require.Equal(t, - `{"type":"cosmos-sdk/MsgSubmitProposal","value":{"content":{"type":"cosmos-sdk/TextProposal","value":{"description":"abcd","title":"test"}},"initial_deposit":[]}}`, + `{"type":"govgen/MsgSubmitProposal","value":{"content":{"type":"govgen/TextProposal","value":{"description":"abcd","title":"test"}},"initial_deposit":[]}}`, string(bz)) }