Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
zale144 committed Sep 25, 2024
1 parent ccbd284 commit 3e91172
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 5 deletions.
3 changes: 2 additions & 1 deletion ibctesting/utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -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)),
},
)

Expand Down
3 changes: 2 additions & 1 deletion x/incentives/keeper/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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)),
},
}

Expand Down
2 changes: 1 addition & 1 deletion x/rollapp/keeper/rollapp.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
2 changes: 1 addition & 1 deletion x/rollapp/types/message_update_rollapp.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())
}
2 changes: 1 addition & 1 deletion x/rollapp/types/rollapp.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 3e91172

Please sign in to comment.