chore: implement feedback of automerged prs (#16308)
This commit is contained in:
parent
f851e188b3
commit
3608dabf77
@ -4763,7 +4763,7 @@ func (x *EventLeaveGroup) GetAddress() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
// EventProposalTallyFinalized is an event emitted when a proposal tally is finalized.
|
||||
// EventProposalPruned is an event emitted when a proposal is pruned.
|
||||
type EventProposalPruned struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
@ -4773,7 +4773,7 @@ type EventProposalPruned struct {
|
||||
ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"`
|
||||
// status is the proposal status (UNSPECIFIED, SUBMITTED, ACCEPTED, REJECTED, ABORTED, WITHDRAWN).
|
||||
Status ProposalStatus `protobuf:"varint,2,opt,name=status,proto3,enum=cosmos.group.v1.ProposalStatus" json:"status,omitempty"`
|
||||
// tally_result is the proposal tally result.
|
||||
// tally_result is the proposal tally result (when applicable).
|
||||
TallyResult *TallyResult `protobuf:"bytes,3,opt,name=tally_result,json=tallyResult,proto3" json:"tally_result,omitempty"`
|
||||
}
|
||||
|
||||
|
||||
@ -89,9 +89,9 @@ func (suite *KeeperTestSuite) TestActivateVotingPeriod() {
|
||||
suite.Require().True(proposal.VotingStartTime.Equal(suite.ctx.BlockHeader().Time))
|
||||
|
||||
has, err := suite.govKeeper.ActiveProposalsQueue.Has(suite.ctx, collections.Join(*proposal.VotingEndTime, proposal.Id))
|
||||
require.NoError(suite.T(), err)
|
||||
require.True(suite.T(), has)
|
||||
require.NoError(suite.T(), suite.govKeeper.DeleteProposal(suite.ctx, proposal.Id))
|
||||
suite.Require().NoError(err)
|
||||
suite.Require().True(has)
|
||||
suite.Require().NoError(suite.govKeeper.DeleteProposal(suite.ctx, proposal.Id))
|
||||
}
|
||||
}
|
||||
|
||||
@ -111,22 +111,22 @@ func (suite *KeeperTestSuite) TestDeleteProposalInVotingPeriod() {
|
||||
suite.Require().NoError(err)
|
||||
suite.Require().Nil(proposal.VotingStartTime)
|
||||
|
||||
require.NoError(suite.T(), suite.govKeeper.ActivateVotingPeriod(suite.ctx, proposal))
|
||||
suite.Require().NoError(suite.govKeeper.ActivateVotingPeriod(suite.ctx, proposal))
|
||||
|
||||
proposal, err = suite.govKeeper.Proposals.Get(suite.ctx, proposal.Id)
|
||||
suite.Require().Nil(err)
|
||||
suite.Require().True(proposal.VotingStartTime.Equal(suite.ctx.BlockHeader().Time))
|
||||
|
||||
has, err := suite.govKeeper.ActiveProposalsQueue.Has(suite.ctx, collections.Join(*proposal.VotingEndTime, proposal.Id))
|
||||
require.NoError(suite.T(), err)
|
||||
require.True(suite.T(), has)
|
||||
suite.Require().NoError(err)
|
||||
suite.Require().True(has)
|
||||
|
||||
// add vote
|
||||
voteOptions := []*v1.WeightedVoteOption{{Option: v1.OptionYes, Weight: "1.0"}}
|
||||
err = suite.govKeeper.AddVote(suite.ctx, proposal.Id, suite.addrs[0], voteOptions, "")
|
||||
suite.Require().NoError(err)
|
||||
|
||||
require.NoError(suite.T(), suite.govKeeper.DeleteProposal(suite.ctx, proposal.Id))
|
||||
suite.Require().NoError(suite.govKeeper.DeleteProposal(suite.ctx, proposal.Id))
|
||||
|
||||
// add vote but proposal is deleted along with its VotingPeriodProposalKey
|
||||
err = suite.govKeeper.AddVote(suite.ctx, proposal.Id, suite.addrs[0], voteOptions, "")
|
||||
|
||||
@ -464,13 +464,13 @@ func (m *EventLeaveGroup) GetAddress() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
// EventProposalTallyFinalized is an event emitted when a proposal tally is finalized.
|
||||
// EventProposalPruned is an event emitted when a proposal is pruned.
|
||||
type EventProposalPruned struct {
|
||||
// proposal_id is the unique ID of the proposal.
|
||||
ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"`
|
||||
// status is the proposal status (UNSPECIFIED, SUBMITTED, ACCEPTED, REJECTED, ABORTED, WITHDRAWN).
|
||||
Status ProposalStatus `protobuf:"varint,2,opt,name=status,proto3,enum=cosmos.group.v1.ProposalStatus" json:"status,omitempty"`
|
||||
// tally_result is the proposal tally result.
|
||||
// tally_result is the proposal tally result (when applicable).
|
||||
TallyResult *TallyResult `protobuf:"bytes,3,opt,name=tally_result,json=tallyResult,proto3" json:"tally_result,omitempty"`
|
||||
}
|
||||
|
||||
|
||||
@ -23,7 +23,7 @@ import (
|
||||
minttypes "github.com/cosmos/cosmos-sdk/x/mint/types"
|
||||
)
|
||||
|
||||
var EventTallyResult = "cosmos.group.v1.EventProposalPruned"
|
||||
var EventProposalPruned = "cosmos.group.v1.EventProposalPruned"
|
||||
|
||||
func (s *TestSuite) TestCreateGroupWithLotsOfMembers() {
|
||||
for i := 50; i < 70; i++ {
|
||||
@ -1834,7 +1834,7 @@ func (s *TestSuite) TestSubmitProposal() {
|
||||
toBalances := s.bankKeeper.GetAllBalances(sdkCtx, addr2)
|
||||
s.Require().Contains(toBalances, sdk.NewInt64Coin("test", 100))
|
||||
events := sdkCtx.EventManager().ABCIEvents()
|
||||
s.Require().True(eventTypeFound(events, EventTallyResult))
|
||||
s.Require().True(eventTypeFound(events, EventProposalPruned))
|
||||
},
|
||||
},
|
||||
"with try exec, not enough yes votes for proposal to pass": {
|
||||
@ -1983,7 +1983,7 @@ func (s *TestSuite) TestWithdrawProposal() {
|
||||
s.Require().NoError(s.groupKeeper.TallyProposalsAtVPEnd(ctxVPE))
|
||||
events := ctxVPE.EventManager().ABCIEvents()
|
||||
|
||||
s.Require().True(eventTypeFound(events, EventTallyResult))
|
||||
s.Require().True(eventTypeFound(events, EventProposalPruned))
|
||||
},
|
||||
},
|
||||
}
|
||||
@ -2549,7 +2549,7 @@ func (s *TestSuite) TestExecProposal() {
|
||||
expToBalances: sdk.NewInt64Coin("test", 100),
|
||||
postRun: func(sdkCtx sdk.Context) {
|
||||
events := sdkCtx.EventManager().ABCIEvents()
|
||||
s.Require().True(eventTypeFound(events, EventTallyResult))
|
||||
s.Require().True(eventTypeFound(events, EventProposalPruned))
|
||||
},
|
||||
},
|
||||
"proposal with multiple messages executed when accepted": {
|
||||
@ -2567,7 +2567,7 @@ func (s *TestSuite) TestExecProposal() {
|
||||
expToBalances: sdk.NewInt64Coin("test", 200),
|
||||
postRun: func(sdkCtx sdk.Context) {
|
||||
events := sdkCtx.EventManager().ABCIEvents()
|
||||
s.Require().True(eventTypeFound(events, EventTallyResult))
|
||||
s.Require().True(eventTypeFound(events, EventProposalPruned))
|
||||
},
|
||||
},
|
||||
"proposal not executed when rejected": {
|
||||
@ -2580,7 +2580,7 @@ func (s *TestSuite) TestExecProposal() {
|
||||
expExecutorResult: group.PROPOSAL_EXECUTOR_RESULT_NOT_RUN,
|
||||
postRun: func(sdkCtx sdk.Context) {
|
||||
events := sdkCtx.EventManager().ABCIEvents()
|
||||
s.Require().False(eventTypeFound(events, EventTallyResult))
|
||||
s.Require().False(eventTypeFound(events, EventProposalPruned))
|
||||
},
|
||||
},
|
||||
"open proposal must not fail": {
|
||||
@ -2591,7 +2591,7 @@ func (s *TestSuite) TestExecProposal() {
|
||||
expExecutorResult: group.PROPOSAL_EXECUTOR_RESULT_NOT_RUN,
|
||||
postRun: func(sdkCtx sdk.Context) {
|
||||
events := sdkCtx.EventManager().ABCIEvents()
|
||||
s.Require().False(eventTypeFound(events, EventTallyResult))
|
||||
s.Require().False(eventTypeFound(events, EventProposalPruned))
|
||||
},
|
||||
},
|
||||
"invalid proposal id": {
|
||||
@ -2649,7 +2649,7 @@ func (s *TestSuite) TestExecProposal() {
|
||||
expExecutorResult: group.PROPOSAL_EXECUTOR_RESULT_SUCCESS,
|
||||
postRun: func(sdkCtx sdk.Context) {
|
||||
events := sdkCtx.EventManager().ABCIEvents()
|
||||
s.Require().True(eventTypeFound(events, EventTallyResult))
|
||||
s.Require().True(eventTypeFound(events, EventProposalPruned))
|
||||
},
|
||||
},
|
||||
"prevent double execution when successful": {
|
||||
@ -2939,7 +2939,7 @@ func (s *TestSuite) TestExecPrunedProposalsAndVotes() {
|
||||
s.Require().NoError(err)
|
||||
s.Require().Empty(res.GetVotes())
|
||||
events := sdkCtx.EventManager().ABCIEvents()
|
||||
s.Require().True(eventTypeFound(events, EventTallyResult))
|
||||
s.Require().True(eventTypeFound(events, EventProposalPruned))
|
||||
|
||||
} else {
|
||||
// Check that proposal and votes exists
|
||||
|
||||
Loading…
Reference in New Issue
Block a user