Skip to content

Commit

Permalink
Merge branch 'main' into tbruyelle/fix-gov-cli-handlers
Browse files Browse the repository at this point in the history
  • Loading branch information
giunatale authored Jun 19, 2024
2 parents b9c5b1f + 11bc279 commit 5178a6d
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion proto/scripts/protocgen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions x/gov/types/codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions x/gov/types/msgs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}

Expand Down Expand Up @@ -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))
}

0 comments on commit 5178a6d

Please sign in to comment.