From 10edf973bf95cd8a28d8af1cd312c3e4e9939f6e Mon Sep 17 00:00:00 2001 From: Michael Tsitrin <114929630+mtsitrin@users.noreply.github.com> Date: Wed, 8 Jan 2025 19:28:29 +0200 Subject: [PATCH] fix(iro): missing `StartTimeAfterSettlement` in IRO default params (#1704) * fixed missing StartTimeAfterSettlement in incentives params * linter --- x/iro/types/plan.go | 3 ++- .../keeper/msg_server_update_rollapp_test.go | 21 +++++++++++++++++++ x/rollapp/types/message_update_rollapp.go | 2 ++ 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/x/iro/types/plan.go b/x/iro/types/plan.go index c7d393c2f..23e1fb238 100644 --- a/x/iro/types/plan.go +++ b/x/iro/types/plan.go @@ -94,7 +94,8 @@ func (p Plan) GetIRODenom() string { func DefaultIncentivePlanParams() IncentivePlanParams { return IncentivePlanParams{ - NumEpochsPaidOver: 43200, // 1 month in minute epoch + NumEpochsPaidOver: 43200, // 1 month in minute epoch + StartTimeAfterSettlement: DefaultIncentivePlanMinimumStartTimeAfterSettlement, } } diff --git a/x/rollapp/keeper/msg_server_update_rollapp_test.go b/x/rollapp/keeper/msg_server_update_rollapp_test.go index bf66e630b..4c4f5bb71 100644 --- a/x/rollapp/keeper/msg_server_update_rollapp_test.go +++ b/x/rollapp/keeper/msg_server_update_rollapp_test.go @@ -389,6 +389,16 @@ func (s *RollappTestSuite) TestUpdateRollappLaunched() { }, expError: types.ErrImmutableFieldUpdateAfterLaunched, }, + // update min sequencer bond + { + name: "Update sealed rollapp: fail - min sequencer bond update", + update: &types.MsgUpdateRollappInformation{ + Owner: alice, + RollappId: rollappId, + MinSequencerBond: types.DefaultMinSequencerBondGlobalCoin, + }, + expError: types.ErrImmutableFieldUpdateAfterLaunched, + }, { name: "Update sealed rollapp: fail - try to update genesis checksum when sealed", update: &types.MsgUpdateRollappInformation{ @@ -401,6 +411,17 @@ func (s *RollappTestSuite) TestUpdateRollappLaunched() { }, expError: types.ErrImmutableFieldUpdateAfterLaunched, }, + // TODO: should return error, but now it doesn't (https://github.com/dymensionxyz/dymension/issues/1703) + { + name: "Update rollapp: success - set non valid min denom ignores this field", + update: &types.MsgUpdateRollappInformation{ + Owner: alice, + RollappId: rollappId, + MinSequencerBond: sdk.Coin{Denom: "no_valid_1243", Amount: sdk.NewInt(100)}, + }, + mallete: func(expected *types.Rollapp) {}, + expError: nil, + }, } for _, tc := range tests { diff --git a/x/rollapp/types/message_update_rollapp.go b/x/rollapp/types/message_update_rollapp.go index 74f5a3cb5..9545a6999 100644 --- a/x/rollapp/types/message_update_rollapp.go +++ b/x/rollapp/types/message_update_rollapp.go @@ -71,6 +71,8 @@ func (msg *MsgUpdateRollappInformation) ValidateBasic() error { } } + // TODO: validate min seq bond (https://github.com/dymensionxyz/dymension/issues/1703) + if msg.Metadata != nil { if err := msg.Metadata.Validate(); err != nil { return errors.Join(ErrInvalidMetadata, err)