Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

- Migrate `x/gov` fork from Atom One to Atom One SDK [#248](https://github.com/atomone-hub/atomone/pull/248)
- Add governors to `x/gov` module [#258](https://github.com/atomone-hub/atomone/pull/258)
- Prevent Oversight DAO from vetoing proposals that include a change to the Oversight DAO address [#275](https://github.com/atomone-hub/atomone/pull/275)
- Prevent Oversight DAO from vetoing proposals that include a change to the Oversight DAO address [#275](https://github.com/atomone-hub/atomone/pull/275) [#299](https://github.com/atomone-hub/atomone/pull/299)

### STATE BREAKING

Expand Down
2 changes: 1 addition & 1 deletion x/coredaos/keeper/msg_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ func (ms MsgServer) VetoProposal(goCtx context.Context, msg *types.MsgVetoPropos

return nil, err
}
if updateParamsMsg.Params.OversightDaoAddress != "" && updateParamsMsg.Params.OversightDaoAddress != params.OversightDaoAddress {
if updateParamsMsg.Params.OversightDaoAddress != params.OversightDaoAddress {
logger.Error(
"proposal contains a change of the oversight DAO address, vetoing it would prevent the replacement of the current oversight DAO",
"proposal", proposal.Id,
Expand Down
26 changes: 26 additions & 0 deletions x/coredaos/keeper/msg_server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -709,6 +709,20 @@ func TestMsgServerVetoProposal(t *testing.T) {
Status: govtypesv1.StatusVotingPeriod,
Messages: proposalWithChangeOversightDAOMsgs,
}
proposalWithEmptyOversightDAOMsgs, err := sdktx.SetMsgs([]sdk.Msg{&types.MsgUpdateParams{
Authority: "cosmos10d07y265gmmuvt4z0w9aw880jnsr700j6zn9kn",
Params: types.Params{
OversightDaoAddress: "",
},
}})
require.NoError(t, err)
proposalWithEmptyOversightDAO := govtypesv1.Proposal{
Title: "Test Proposal",
Summary: "A proposal to set empty oversight DAO address",
Id: 5,
Status: govtypesv1.StatusVotingPeriod,
Messages: proposalWithEmptyOversightDAOMsgs,
}
tests := []struct {
name string
msg *types.MsgVetoProposal
Expand Down Expand Up @@ -840,6 +854,18 @@ func TestMsgServerVetoProposal(t *testing.T) {
},
setOversightDAO: true,
},
{
name: "veto proposal with disablement of oversight DAO",
msg: &types.MsgVetoProposal{
Vetoer: oversightDAOAcc,
ProposalId: 5,
},
expectedErr: "proposal with ID 5 contains a change of the oversight DAO address, vetoing it would prevent the replacement of the current oversight DAO: oversight DAO cannot veto this proposal",
setupMocks: func(ctx sdk.Context, m *testutil.Mocks) {
m.GovKeeper.EXPECT().GetProposal(ctx, uint64(5)).Return(proposalWithEmptyOversightDAO, true)
},
setOversightDAO: true,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
Expand Down
Loading