Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add metadata field to Vote in x/gov #11308

Merged
merged 9 commits into from
Mar 3, 2022
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ Ref: https://keepachangelog.com/en/1.0.0/

### Features

* [\#11308](https://github.com/cosmos/cosmos-sdk/pull/11308) Added a mandatory metadata field to Vote in x/gov v1beta2.
* [\#10977](https://github.com/cosmos/cosmos-sdk/pull/10977) Now every cosmos message protobuf definition must be extended with a ``cosmos.msg.v1.signer`` option to signal the signer fields in a language agnostic way.
* [\#10710](https://github.com/cosmos/cosmos-sdk/pull/10710) Chain-id shouldn't be required for creating a transaction with both --generate-only and --offline flags.
* [\#10703](https://github.com/cosmos/cosmos-sdk/pull/10703) Create a new grantee account, if the grantee of an authorization does not exist.
Expand Down
217 changes: 146 additions & 71 deletions api/cosmos/gov/v1beta2/gov.pulsar.go

Large diffs are not rendered by default.

294 changes: 221 additions & 73 deletions api/cosmos/gov/v1beta2/tx.pulsar.go

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions proto/cosmos/gov/v1beta2/gov.proto
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ message Vote {
string voter = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
reserved 3;
repeated WeightedVoteOption options = 4;

// metadata is any arbitrary metadata to attached to the vote.
string metadata = 5;
}

// DepositParams defines the params for deposits on governance proposals.
Expand Down
2 changes: 2 additions & 0 deletions proto/cosmos/gov/v1beta2/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ message MsgVote {
uint64 proposal_id = 1 [(gogoproto.jsontag) = "proposal_id"];
string voter = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
VoteOption option = 3;
string metadata = 4;
}

// MsgVoteResponse defines the Msg/Vote response type.
Expand All @@ -80,6 +81,7 @@ message MsgVoteWeighted {
uint64 proposal_id = 1 [(gogoproto.jsontag) = "proposal_id"];
string voter = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
repeated WeightedVoteOption options = 3;
string metadata = 4;
}

// MsgVoteWeightedResponse defines the Msg/VoteWeighted response type.
Expand Down
2 changes: 1 addition & 1 deletion x/auth/middleware/tips_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ func (s *MWTestSuite) TestTips() {
ctx, accts := s.setupAcctsForTips(ctx)
tipper, feePayer := accts[0], accts[1]

msg = govtypes.NewMsgVote(tipper.acc.GetAddress(), 1, govtypes.OptionYes)
msg = govtypes.NewMsgVote(tipper.acc.GetAddress(), 1, govtypes.OptionYes, "")

auxSignerData := s.mkTipperAuxSignerData(tipper.priv, msg, tc.tip, signing.SignMode_SIGN_MODE_DIRECT_AUX, tipper.accNum, 0, ctx.ChainID())
feePayerTxBuilder := s.mkFeePayerTxBuilder(s.clientCtx, auxSignerData, feePayer.priv, signing.SignMode_SIGN_MODE_DIRECT, tx.Fee{Amount: tc.fee, GasLimit: tc.gasLimit}, feePayer.accNum, 0, ctx.ChainID())
Expand Down
4 changes: 2 additions & 2 deletions x/gov/abci_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ func TestProposalPassedEndblocker(t *testing.T) {
deposits := initialModuleAccCoins.Add(proposal.TotalDeposit...).Add(proposalCoins...)
require.True(t, moduleAccCoins.IsEqual(deposits))

err = app.GovKeeper.AddVote(ctx, proposal.Id, addrs[0], v1beta2.NewNonSplitVoteOption(v1beta2.OptionYes))
err = app.GovKeeper.AddVote(ctx, proposal.Id, addrs[0], v1beta2.NewNonSplitVoteOption(v1beta2.OptionYes), "")
require.NoError(t, err)

newHeader := ctx.BlockHeader()
Expand Down Expand Up @@ -354,7 +354,7 @@ func TestEndBlockerProposalHandlerFailed(t *testing.T) {
require.NoError(t, err)
require.NotNil(t, res)

err = app.GovKeeper.AddVote(ctx, proposal.Id, addrs[0], v1beta2.NewNonSplitVoteOption(v1beta2.OptionYes))
err = app.GovKeeper.AddVote(ctx, proposal.Id, addrs[0], v1beta2.NewNonSplitVoteOption(v1beta2.OptionYes), "")
require.NoError(t, err)

newHeader := ctx.BlockHeader()
Expand Down
30 changes: 28 additions & 2 deletions x/gov/client/cli/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ const (
flagVoter = "voter"
flagDepositor = "depositor"
flagStatus = "status"
flagMetadata = "metadata"
// Deprecated: only used for v1beta1 legacy proposals.
FlagProposal = "proposal"
)
Expand Down Expand Up @@ -282,13 +283,25 @@ $ %s tx gov vote 1 yes --from mykey
return err
}

metadata, err := cmd.Flags().GetString(flagMetadata)
if err != nil {
return err
}

var msg *v1beta2.MsgVote

// Build vote message and run basic validation
msg := v1beta2.NewMsgVote(from, proposalID, byteVoteOption)
if metadata != "" {
msg = v1beta2.NewMsgVote(from, proposalID, byteVoteOption, metadata)
} else {
msg = v1beta2.NewMsgVote(from, proposalID, byteVoteOption, "")
}
likhita-809 marked this conversation as resolved.
Show resolved Hide resolved

return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg)
},
}

cmd.Flags().String(flagMetadata, "", "Specify metadata of the vote")
flags.AddTxFlagsToCmd(cmd)

return cmd
Expand Down Expand Up @@ -331,12 +344,25 @@ $ %s tx gov weighted-vote 1 yes=0.6,no=0.3,abstain=0.05,no_with_veto=0.05 --from
return err
}

metadata, err := cmd.Flags().GetString(flagMetadata)
if err != nil {
return err
}

var msg *v1beta2.MsgVoteWeighted

// Build vote message and run basic validation
msg := v1beta2.NewMsgVoteWeighted(from, proposalID, options)
if metadata != "" {
msg = v1beta2.NewMsgVoteWeighted(from, proposalID, options, metadata)
} else {
msg = v1beta2.NewMsgVoteWeighted(from, proposalID, options, "")
}
likhita-809 marked this conversation as resolved.
Show resolved Hide resolved

return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg)
},
}

cmd.Flags().String(flagMetadata, "", "Specify metadata of the weighted vote")
flags.AddTxFlagsToCmd(cmd)

return cmd
Expand Down
27 changes: 27 additions & 0 deletions x/gov/client/testutil/suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -879,6 +879,7 @@ func (s *IntegrationTestSuite) TestNewCmdVote() {
fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address.String()),
fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation),
fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastBlock),
fmt.Sprintf("--metadata=%s", "AQ=="),
fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()),
},
false, 2,
Expand All @@ -895,6 +896,19 @@ func (s *IntegrationTestSuite) TestNewCmdVote() {
},
false, 0,
},
{
"valid vote with metadata",
[]string{
"1",
"yes",
fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address.String()),
fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation),
fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastBlock),
fmt.Sprintf("--metadata=%s", "AQ=="),
fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()),
},
false, 0,
},
}

for _, tc := range testCases {
Expand Down Expand Up @@ -955,6 +969,19 @@ func (s *IntegrationTestSuite) TestNewCmdWeightedVote() {
},
false, 0,
},
{
"valid vote with metadata",
[]string{
"1",
"yes",
fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address.String()),
fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation),
fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastBlock),
fmt.Sprintf("--metadata=%s", "AQ=="),
fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()),
},
false, 0,
},
{
"invalid valid split vote string",
[]string{
Expand Down
22 changes: 11 additions & 11 deletions x/gov/client/utils/query_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,12 @@ func TestGetPaginatedVotes(t *testing.T) {
acc2 := make(sdk.AccAddress, 20)
acc2[0] = 2
acc1Msgs := []sdk.Msg{
v1beta2.NewMsgVote(acc1, 0, v1beta2.OptionYes),
v1beta2.NewMsgVote(acc1, 0, v1beta2.OptionYes),
v1beta2.NewMsgVote(acc1, 0, v1beta2.OptionYes, ""),
v1beta2.NewMsgVote(acc1, 0, v1beta2.OptionYes, ""),
}
acc2Msgs := []sdk.Msg{
v1beta2.NewMsgVote(acc2, 0, v1beta2.OptionYes),
v1beta2.NewMsgVoteWeighted(acc2, 0, v1beta2.NewNonSplitVoteOption(v1beta2.OptionYes)),
v1beta2.NewMsgVote(acc2, 0, v1beta2.OptionYes, ""),
v1beta2.NewMsgVoteWeighted(acc2, 0, v1beta2.NewNonSplitVoteOption(v1beta2.OptionYes), ""),
}
for _, tc := range []testCase{
{
Expand All @@ -105,8 +105,8 @@ func TestGetPaginatedVotes(t *testing.T) {
acc2Msgs[:1],
},
votes: []v1beta2.Vote{
v1beta2.NewVote(0, acc1, v1beta2.NewNonSplitVoteOption(v1beta2.OptionYes)),
v1beta2.NewVote(0, acc2, v1beta2.NewNonSplitVoteOption(v1beta2.OptionYes))},
v1beta2.NewVote(0, acc1, v1beta2.NewNonSplitVoteOption(v1beta2.OptionYes), ""),
v1beta2.NewVote(0, acc2, v1beta2.NewNonSplitVoteOption(v1beta2.OptionYes), "")},
},
{
description: "2MsgPerTx1Chunk",
Expand All @@ -117,8 +117,8 @@ func TestGetPaginatedVotes(t *testing.T) {
acc2Msgs,
},
votes: []v1beta2.Vote{
v1beta2.NewVote(0, acc1, v1beta2.NewNonSplitVoteOption(v1beta2.OptionYes)),
v1beta2.NewVote(0, acc1, v1beta2.NewNonSplitVoteOption(v1beta2.OptionYes)),
v1beta2.NewVote(0, acc1, v1beta2.NewNonSplitVoteOption(v1beta2.OptionYes), ""),
v1beta2.NewVote(0, acc1, v1beta2.NewNonSplitVoteOption(v1beta2.OptionYes), ""),
},
},
{
Expand All @@ -130,8 +130,8 @@ func TestGetPaginatedVotes(t *testing.T) {
acc2Msgs,
},
votes: []v1beta2.Vote{
v1beta2.NewVote(0, acc2, v1beta2.NewNonSplitVoteOption(v1beta2.OptionYes)),
v1beta2.NewVote(0, acc2, v1beta2.NewNonSplitVoteOption(v1beta2.OptionYes)),
v1beta2.NewVote(0, acc2, v1beta2.NewNonSplitVoteOption(v1beta2.OptionYes), ""),
v1beta2.NewVote(0, acc2, v1beta2.NewNonSplitVoteOption(v1beta2.OptionYes), ""),
},
},
{
Expand All @@ -141,7 +141,7 @@ func TestGetPaginatedVotes(t *testing.T) {
msgs: [][]sdk.Msg{
acc1Msgs[:1],
},
votes: []v1beta2.Vote{v1beta2.NewVote(0, acc1, v1beta2.NewNonSplitVoteOption(v1beta2.OptionYes))},
votes: []v1beta2.Vote{v1beta2.NewVote(0, acc1, v1beta2.NewNonSplitVoteOption(v1beta2.OptionYes), "")},
},
{
description: "InvalidPage",
Expand Down
20 changes: 10 additions & 10 deletions x/gov/keeper/grpc_query_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryProposals() {
for i := 0; i < 5; i++ {
govAddress := app.GovKeeper.GetGovernanceAccount(suite.ctx).GetAddress()
testProposal := []sdk.Msg{
v1beta2.NewMsgVote(govAddress, uint64(i), v1beta2.OptionYes),
v1beta2.NewMsgVote(govAddress, uint64(i), v1beta2.OptionYes, ""),
}
proposal, err := app.GovKeeper.SubmitProposal(ctx, testProposal, "")
suite.Require().NotEmpty(proposal)
Expand Down Expand Up @@ -269,7 +269,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryProposals() {
func() {
testProposals[1].Status = v1beta2.StatusVotingPeriod
app.GovKeeper.SetProposal(ctx, *testProposals[1])
suite.Require().NoError(app.GovKeeper.AddVote(ctx, testProposals[1].Id, addrs[0], v1beta2.NewNonSplitVoteOption(v1beta2.OptionAbstain)))
suite.Require().NoError(app.GovKeeper.AddVote(ctx, testProposals[1].Id, addrs[0], v1beta2.NewNonSplitVoteOption(v1beta2.OptionAbstain), ""))

req = &v1beta2.QueryProposalsRequest{
Voter: addrs[0].String(),
Expand Down Expand Up @@ -384,7 +384,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryVote() {
func() {
proposal.Status = v1beta2.StatusVotingPeriod
app.GovKeeper.SetProposal(ctx, proposal)
suite.Require().NoError(app.GovKeeper.AddVote(ctx, proposal.Id, addrs[0], v1beta2.NewNonSplitVoteOption(v1beta2.OptionAbstain)))
suite.Require().NoError(app.GovKeeper.AddVote(ctx, proposal.Id, addrs[0], v1beta2.NewNonSplitVoteOption(v1beta2.OptionAbstain), ""))

req = &v1beta2.QueryVoteRequest{
ProposalId: proposal.Id,
Expand Down Expand Up @@ -495,8 +495,8 @@ func (suite *KeeperTestSuite) TestGRPCQueryVotes() {
accAddr2, err2 := sdk.AccAddressFromBech32(votes[1].Voter)
suite.Require().NoError(err1)
suite.Require().NoError(err2)
suite.Require().NoError(app.GovKeeper.AddVote(ctx, proposal.Id, accAddr1, votes[0].Options))
suite.Require().NoError(app.GovKeeper.AddVote(ctx, proposal.Id, accAddr2, votes[1].Options))
suite.Require().NoError(app.GovKeeper.AddVote(ctx, proposal.Id, accAddr1, votes[0].Options, ""))
suite.Require().NoError(app.GovKeeper.AddVote(ctx, proposal.Id, accAddr2, votes[1].Options, ""))

req = &v1beta2.QueryVotesRequest{
ProposalId: proposal.Id,
Expand Down Expand Up @@ -596,8 +596,8 @@ func (suite *KeeperTestSuite) TestLegacyGRPCQueryVotes() {
accAddr2, err2 := sdk.AccAddressFromBech32(votes[1].Voter)
suite.Require().NoError(err1)
suite.Require().NoError(err2)
suite.Require().NoError(app.GovKeeper.AddVote(ctx, proposal.Id, accAddr1, v1beta2.NewNonSplitVoteOption(v1beta2.OptionAbstain)))
suite.Require().NoError(app.GovKeeper.AddVote(ctx, proposal.Id, accAddr2, v1beta2.NewNonSplitVoteOption(v1beta2.OptionYes)))
suite.Require().NoError(app.GovKeeper.AddVote(ctx, proposal.Id, accAddr1, v1beta2.NewNonSplitVoteOption(v1beta2.OptionAbstain), ""))
suite.Require().NoError(app.GovKeeper.AddVote(ctx, proposal.Id, accAddr2, v1beta2.NewNonSplitVoteOption(v1beta2.OptionYes), ""))

req = &v1beta1.QueryVotesRequest{
ProposalId: proposal.Id,
Expand Down Expand Up @@ -1055,9 +1055,9 @@ func (suite *KeeperTestSuite) TestGRPCQueryTally() {
proposal.Status = v1beta2.StatusVotingPeriod
app.GovKeeper.SetProposal(ctx, proposal)

suite.Require().NoError(app.GovKeeper.AddVote(ctx, proposal.Id, addrs[0], v1beta2.NewNonSplitVoteOption(v1beta2.OptionYes)))
suite.Require().NoError(app.GovKeeper.AddVote(ctx, proposal.Id, addrs[1], v1beta2.NewNonSplitVoteOption(v1beta2.OptionYes)))
suite.Require().NoError(app.GovKeeper.AddVote(ctx, proposal.Id, addrs[2], v1beta2.NewNonSplitVoteOption(v1beta2.OptionYes)))
suite.Require().NoError(app.GovKeeper.AddVote(ctx, proposal.Id, addrs[0], v1beta2.NewNonSplitVoteOption(v1beta2.OptionYes), ""))
suite.Require().NoError(app.GovKeeper.AddVote(ctx, proposal.Id, addrs[1], v1beta2.NewNonSplitVoteOption(v1beta2.OptionYes), ""))
suite.Require().NoError(app.GovKeeper.AddVote(ctx, proposal.Id, addrs[2], v1beta2.NewNonSplitVoteOption(v1beta2.OptionYes), ""))

req = &v1beta2.QueryTallyResultRequest{ProposalId: proposal.Id}

Expand Down
2 changes: 1 addition & 1 deletion x/gov/keeper/hooks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ func TestHooks(t *testing.T) {
require.NoError(t, err)
require.True(t, govHooksReceiver.AfterProposalDepositValid)

err = app.GovKeeper.AddVote(ctx, p2.Id, addrs[0], v1beta2.NewNonSplitVoteOption(v1beta2.OptionYes))
err = app.GovKeeper.AddVote(ctx, p2.Id, addrs[0], v1beta2.NewNonSplitVoteOption(v1beta2.OptionYes), "")
require.NoError(t, err)
require.True(t, govHooksReceiver.AfterProposalVoteValid)

Expand Down
9 changes: 9 additions & 0 deletions x/gov/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,3 +197,12 @@ func (keeper Keeper) InactiveProposalQueueIterator(ctx sdk.Context, endTime time
store := ctx.KVStore(keeper.storeKey)
return store.Iterator(types.InactiveProposalQueuePrefix, sdk.PrefixEndBytes(types.InactiveProposalByTimeKey(endTime)))
}

// assertMetadataLength returns an error if given metadata length
// is greater than a pre-defined maxMetadataLen.
func (k Keeper) assertMetadataLength(metadata string) error {
if metadata != "" && uint64(len(metadata)) > k.config.MaxMetadataLen {
return types.ErrMetadataTooLong.Wrapf("got metadata with length %d", len(metadata))
}
return nil
}
4 changes: 2 additions & 2 deletions x/gov/keeper/msg_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ func (k msgServer) Vote(goCtx context.Context, msg *v1beta2.MsgVote) (*v1beta2.M
if accErr != nil {
return nil, accErr
}
err := k.Keeper.AddVote(ctx, msg.ProposalId, accAddr, v1beta2.NewNonSplitVoteOption(msg.Option))
err := k.Keeper.AddVote(ctx, msg.ProposalId, accAddr, v1beta2.NewNonSplitVoteOption(msg.Option), msg.Metadata)
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -144,7 +144,7 @@ func (k msgServer) VoteWeighted(goCtx context.Context, msg *v1beta2.MsgVoteWeigh
if accErr != nil {
return nil, accErr
}
err := k.Keeper.AddVote(ctx, msg.ProposalId, accAddr, msg.Options)
err := k.Keeper.AddVote(ctx, msg.ProposalId, accAddr, msg.Options, msg.Metadata)
if err != nil {
return nil, err
}
Expand Down
5 changes: 3 additions & 2 deletions x/gov/keeper/proposal.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ import (

// SubmitProposal create new proposal given an array of messages
func (keeper Keeper) SubmitProposal(ctx sdk.Context, messages []sdk.Msg, metadata string) (v1beta2.Proposal, error) {
if metadata != "" && uint64(len(metadata)) > keeper.config.MaxMetadataLen {
return v1beta2.Proposal{}, types.ErrMetadataTooLong.Wrapf("got metadata with length %d", len(metadata))
err := keeper.assertMetadataLength(metadata)
if err != nil {
return v1beta2.Proposal{}, err
}

// Will hold a comma-separated string of all Msg type URLs.
Expand Down
2 changes: 1 addition & 1 deletion x/gov/keeper/proposal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ func (suite *KeeperTestSuite) TestGetProposalsFiltered() {

if i%2 == 0 {
d := v1beta2.NewDeposit(proposalID, addr1, nil)
v := v1beta2.NewVote(proposalID, addr1, v1beta2.NewNonSplitVoteOption(v1beta2.OptionYes))
v := v1beta2.NewVote(proposalID, addr1, v1beta2.NewNonSplitVoteOption(v1beta2.OptionYes), "")
suite.app.GovKeeper.SetDeposit(suite.ctx, d)
suite.app.GovKeeper.SetVote(suite.ctx, v)
}
Expand Down
6 changes: 3 additions & 3 deletions x/gov/keeper/querier_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -254,13 +254,13 @@ func TestQueries(t *testing.T) {
checkEqualProposal(t, proposal3, *proposals[1])

// Addrs[0] votes on proposals #2 & #3
vote1 := v1beta2.NewVote(proposal2.Id, TestAddrs[0], v1beta2.NewNonSplitVoteOption(v1beta2.OptionYes))
vote2 := v1beta2.NewVote(proposal3.Id, TestAddrs[0], v1beta2.NewNonSplitVoteOption(v1beta2.OptionYes))
vote1 := v1beta2.NewVote(proposal2.Id, TestAddrs[0], v1beta2.NewNonSplitVoteOption(v1beta2.OptionYes), "")
vote2 := v1beta2.NewVote(proposal3.Id, TestAddrs[0], v1beta2.NewNonSplitVoteOption(v1beta2.OptionYes), "")
app.GovKeeper.SetVote(ctx, vote1)
app.GovKeeper.SetVote(ctx, vote2)

// Addrs[1] votes on proposal #3
vote3 := v1beta2.NewVote(proposal3.Id, TestAddrs[1], v1beta2.NewNonSplitVoteOption(v1beta2.OptionYes))
vote3 := v1beta2.NewVote(proposal3.Id, TestAddrs[1], v1beta2.NewNonSplitVoteOption(v1beta2.OptionYes), "")
app.GovKeeper.SetVote(ctx, vote3)

// Test query voted by TestAddrs[0]
Expand Down
Loading