Skip to content

Commit

Permalink
test: fix
Browse files Browse the repository at this point in the history
  • Loading branch information
cosmic-vagabond committed Nov 28, 2023
1 parent c811880 commit 121e495
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 16 deletions.
6 changes: 0 additions & 6 deletions x/amm/keeper/msg_server_create_pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ import (
"strconv"

sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
"github.com/elys-network/elys/x/amm/types"
)

Expand All @@ -16,10 +14,6 @@ import (
func (k msgServer) CreatePool(goCtx context.Context, msg *types.MsgCreatePool) (*types.MsgCreatePoolResponse, error) {
ctx := sdk.UnwrapSDKContext(goCtx)

if k.authority != msg.Sender {
return nil, sdkerrors.Wrapf(govtypes.ErrInvalidSigner, "invalid authority; expected %s, got %s", k.authority, msg.Sender)
}

poolId, err := k.Keeper.CreatePool(ctx, msg)
if err != nil {
return &types.MsgCreatePoolResponse{}, err
Expand Down
7 changes: 2 additions & 5 deletions x/amm/keeper/msg_server_create_pool_test.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
package keeper_test

import (
"github.com/cometbft/cometbft/crypto/ed25519"
sdk "github.com/cosmos/cosmos-sdk/types"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
minttypes "github.com/cosmos/cosmos-sdk/x/mint/types"
"github.com/elys-network/elys/x/amm/keeper"
"github.com/elys-network/elys/x/amm/types"
Expand Down Expand Up @@ -114,9 +113,7 @@ func (suite *KeeperTestSuite) TestMsgServerCreatePool() {
suite.SetupStableCoinPrices()

// bootstrap accounts
// sender := sdk.AccAddress(ed25519.GenPrivKey().PubKey().Address())
// use gov address as sender
sender := authtypes.NewModuleAddress(govtypes.ModuleName)
sender := sdk.AccAddress(ed25519.GenPrivKey().PubKey().Address())

// bootstrap balances
err := suite.app.BankKeeper.MintCoins(suite.ctx, minttypes.ModuleName, tc.senderInitBalance)
Expand Down
7 changes: 2 additions & 5 deletions x/amm/keeper/msg_server_exit_pool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@ package keeper_test
import (
"time"

"github.com/cometbft/cometbft/crypto/ed25519"
sdk "github.com/cosmos/cosmos-sdk/types"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
minttypes "github.com/cosmos/cosmos-sdk/x/mint/types"
"github.com/elys-network/elys/x/amm/keeper"
"github.com/elys-network/elys/x/amm/types"
Expand Down Expand Up @@ -116,9 +115,7 @@ func (suite *KeeperTestSuite) TestMsgServerExitPool() {
suite.SetupStableCoinPrices()

// bootstrap accounts
// sender := sdk.AccAddress(ed25519.GenPrivKey().PubKey().Address())
// use gov address as sender
sender := authtypes.NewModuleAddress(govtypes.ModuleName)
sender := sdk.AccAddress(ed25519.GenPrivKey().PubKey().Address())

// bootstrap balances
err := suite.app.BankKeeper.MintCoins(suite.ctx, minttypes.ModuleName, tc.poolInitBalance)
Expand Down

0 comments on commit 121e495

Please sign in to comment.