Skip to content
Open
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
43 changes: 43 additions & 0 deletions x/coredaos/keeper/msg_server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,49 @@ func TestMsgServerUpdateParams(t *testing.T) {
}
}

func TestMsgServerUpdateParamsRevalidatesOnExecution(t *testing.T) {
const authority = "cosmos10d07y265gmmuvt4z0w9aw880jnsr700j6zn9kn"

timeDuration := time.Duration(1)
tests := []struct {
name string
params types.Params
expectedErr string
}{
{
name: "steeringdao set to authority address",
params: types.Params{
SteeringDaoAddress: authority,
VotingPeriodExtensionDuration: &timeDuration,
},
expectedErr: "authority address cannot be the same as steering DAO address: invalid address",
},
{
name: "oversightdao set to authority address",
params: types.Params{
OversightDaoAddress: authority,
VotingPeriodExtensionDuration: &timeDuration,
},
expectedErr: "authority address cannot be the same as oversight DAO address: invalid address",
},
}

for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
ms, k, _, ctx := testutil.SetupMsgServer(t)
params := types.DefaultParams()
k.Params.Set(ctx, params)

_, err := ms.UpdateParams(ctx, &types.MsgUpdateParams{
Authority: authority,
Params: tt.params,
})
require.EqualError(t, err, tt.expectedErr)
require.Equal(t, params, k.GetParams(ctx))
})
}
}

func TestMsgServerAnnotateProposal(t *testing.T) {
testAcc := simtestutil.CreateRandomAccounts(2)
annotatorAcc := testAcc[0].String()
Expand Down
Loading