From 3e9117236753a82f8ad1b8a2692ff21b47b84267 Mon Sep 17 00:00:00 2001 From: zale144 Date: Wed, 25 Sep 2024 10:20:21 +0200 Subject: [PATCH] Fix tests --- ibctesting/utils_test.go | 3 ++- x/incentives/keeper/suite_test.go | 3 ++- x/rollapp/keeper/rollapp.go | 2 +- x/rollapp/types/message_update_rollapp.go | 2 +- x/rollapp/types/rollapp.go | 2 +- 5 files changed, 7 insertions(+), 5 deletions(-) diff --git a/ibctesting/utils_test.go b/ibctesting/utils_test.go index 22fa55bcf..f672bfc96 100644 --- a/ibctesting/utils_test.go +++ b/ibctesting/utils_test.go @@ -21,6 +21,7 @@ import ( channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" ibctesting "github.com/cosmos/ibc-go/v7/testing" "github.com/cosmos/ibc-go/v7/testing/mock" + "github.com/dymensionxyz/sdk-utils/utils/uptr" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" @@ -144,7 +145,7 @@ func (s *utilSuite) createRollapp(transfersEnabled bool, channelID *string) { Base: "aden", Exponent: 18, }, - InitialSupply: sdk.NewInt(1000), + InitialSupply: uptr.To(sdk.NewInt(1000)), }, ) diff --git a/x/incentives/keeper/suite_test.go b/x/incentives/keeper/suite_test.go index 54fb2b02a..1d6f34249 100644 --- a/x/incentives/keeper/suite_test.go +++ b/x/incentives/keeper/suite_test.go @@ -8,6 +8,7 @@ import ( tmrand "github.com/cometbft/cometbft/libs/rand" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/dymensionxyz/sdk-utils/utils/uptr" "github.com/dymensionxyz/sdk-utils/utils/urand" "github.com/dymensionxyz/dymension/v3/x/incentives/types" @@ -222,7 +223,7 @@ func (suite *KeeperTestSuite) CreateDefaultRollapp(addr sdk.AccAddress) string { Base: "aden", Exponent: 18, }, - InitialSupply: sdk.NewInt(1000), + InitialSupply: uptr.To(sdk.NewInt(1000)), }, } diff --git a/x/rollapp/keeper/rollapp.go b/x/rollapp/keeper/rollapp.go index 211eadfe0..011cf3390 100644 --- a/x/rollapp/keeper/rollapp.go +++ b/x/rollapp/keeper/rollapp.go @@ -52,7 +52,7 @@ func (k Keeper) CheckAndUpdateRollappFields(ctx sdk.Context, update *types.MsgUp current.GenesisInfo.NativeDenom = update.GenesisInfo.NativeDenom } - if update.GenesisInfo.InitialSupply != nil && !update.GenesisInfo.InitialSupply.IsPositive() { + if update.GenesisInfo.InitialSupply != nil && update.GenesisInfo.InitialSupply.IsPositive() { current.GenesisInfo.InitialSupply = update.GenesisInfo.InitialSupply } diff --git a/x/rollapp/types/message_update_rollapp.go b/x/rollapp/types/message_update_rollapp.go index e3387daf7..2818d7d16 100644 --- a/x/rollapp/types/message_update_rollapp.go +++ b/x/rollapp/types/message_update_rollapp.go @@ -82,5 +82,5 @@ func (msg *MsgUpdateRollappInformation) UpdatingGenesisInfo() bool { return msg.GenesisInfo.GenesisChecksum != "" || msg.GenesisInfo.Bech32Prefix != "" || msg.GenesisInfo.NativeDenom.Base != "" || - (msg.GenesisInfo.InitialSupply != nil && !msg.GenesisInfo.InitialSupply.IsPositive()) + (msg.GenesisInfo.InitialSupply != nil && msg.GenesisInfo.InitialSupply.IsPositive()) } diff --git a/x/rollapp/types/rollapp.go b/x/rollapp/types/rollapp.go index 5d0a7e476..39a75ebf8 100644 --- a/x/rollapp/types/rollapp.go +++ b/x/rollapp/types/rollapp.go @@ -103,7 +103,7 @@ func (r Rollapp) GenesisInfoFieldsAreSet() bool { return r.GenesisInfo.GenesisChecksum != "" && r.GenesisInfo.NativeDenom.Validate() == nil && r.GenesisInfo.Bech32Prefix != "" && - (r.GenesisInfo.InitialSupply != nil && !r.GenesisInfo.InitialSupply.IsPositive()) + (r.GenesisInfo.InitialSupply != nil && !r.GenesisInfo.InitialSupply.IsNil()) } func (r Rollapp) IsVulnerable() bool {