Skip to content

Commit

Permalink
refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
pr0n00gler committed Sep 16, 2024
1 parent 8f98b0f commit 5bea9ef
Show file tree
Hide file tree
Showing 17 changed files with 4 additions and 1,597 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ test: test-unit
test-all: check test-race test-cover

test-unit:
@VERSION=$(VERSION) go test -mod=readonly -tags='ledger test_ledger_mock' ./...
@VERSION=$(VERSION) go test -mod=readonly -tags='ledger test_ledger_mock' `go list ./... | grep -v dex`

test-race:
@VERSION=$(VERSION) go test -mod=readonly -race -tags='ledger test_ledger_mock' ./...
Expand Down
21 changes: 0 additions & 21 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,10 +193,6 @@ import (
dexkeeper "github.com/neutron-org/neutron/v4/x/dex/keeper"
dextypes "github.com/neutron-org/neutron/v4/x/dex/types"

"github.com/neutron-org/neutron/v4/x/ibcswap"
ibcswapkeeper "github.com/neutron-org/neutron/v4/x/ibcswap/keeper"
ibcswaptypes "github.com/neutron-org/neutron/v4/x/ibcswap/types"

globalfeekeeper "github.com/neutron-org/neutron/v4/x/globalfee/keeper"
gmpmiddleware "github.com/neutron-org/neutron/v4/x/gmp"

Expand Down Expand Up @@ -276,7 +272,6 @@ var (
globalfee.AppModule{},
feemarket.AppModuleBasic{},
dex.AppModuleBasic{},
ibcswap.AppModuleBasic{},
oracle.AppModuleBasic{},
marketmap.AppModuleBasic{},
dynamicfees.AppModuleBasic{},
Expand All @@ -298,7 +293,6 @@ var (
tokenfactorytypes.ModuleName: {authtypes.Minter, authtypes.Burner},
crontypes.ModuleName: nil,
dextypes.ModuleName: {authtypes.Minter, authtypes.Burner},
ibcswaptypes.ModuleName: {authtypes.Burner},
oracletypes.ModuleName: nil,
marketmaptypes.ModuleName: nil,
feemarkettypes.FeeCollectorName: nil,
Expand Down Expand Up @@ -370,7 +364,6 @@ type App struct {
CronKeeper cronkeeper.Keeper
PFMKeeper *pfmkeeper.Keeper
DexKeeper dexkeeper.Keeper
SwapKeeper ibcswapkeeper.Keeper
GlobalFeeKeeper globalfeekeeper.Keeper

PFMModule packetforward.AppModule
Expand Down Expand Up @@ -748,15 +741,6 @@ func New(

dexModule := dex.NewAppModule(appCodec, app.DexKeeper, app.BankKeeper)

app.SwapKeeper = ibcswapkeeper.NewKeeper(
appCodec,
app.MsgServiceRouter(),
app.IBCKeeper.ChannelKeeper,
app.BankKeeper,
)

swapModule := ibcswap.NewAppModule(app.SwapKeeper)

wasmDir := filepath.Join(homePath, "wasm")
wasmConfig, err := wasm.ReadWasmConfig(appOpts)
if err != nil {
Expand Down Expand Up @@ -921,7 +905,6 @@ func New(
pfmkeeper.DefaultRefundTransferPacketTimeoutTimestamp,
)

ibcStack = ibcswap.NewIBCMiddleware(ibcStack, app.SwapKeeper)
ibcStack = gmpmiddleware.NewIBCMiddleware(ibcStack)

ibcRouter.AddRoute(icacontrollertypes.SubModuleName, icaControllerStack).
Expand Down Expand Up @@ -972,7 +955,6 @@ func New(
globalfee.NewAppModule(app.GlobalFeeKeeper, app.GetSubspace(globalfee.ModuleName), app.AppCodec(), app.keys[globalfee.ModuleName]),
feemarket.NewAppModule(appCodec, *app.FeeMarkerKeeper),
dynamicfees.NewAppModule(appCodec, *app.DynamicFeesKeeper),
swapModule,
dexModule,
marketmapModule,
oracleModule,
Expand Down Expand Up @@ -1022,7 +1004,6 @@ func New(
oracletypes.ModuleName,
globalfee.ModuleName,
feemarkettypes.ModuleName,
ibcswaptypes.ModuleName,
dextypes.ModuleName,
consensusparamtypes.ModuleName,
)
Expand Down Expand Up @@ -1059,7 +1040,6 @@ func New(
oracletypes.ModuleName,
globalfee.ModuleName,
feemarkettypes.ModuleName,
ibcswaptypes.ModuleName,
dextypes.ModuleName,
consensusparamtypes.ModuleName,
)
Expand Down Expand Up @@ -1101,7 +1081,6 @@ func New(
feemarkettypes.ModuleName,
oracletypes.ModuleName,
marketmaptypes.ModuleName,
ibcswaptypes.ModuleName,
dextypes.ModuleName,
dynamicfeestypes.ModuleName,
consensusparamtypes.ModuleName,
Expand Down
Binary file modified contracts/neutron_chain_manager.wasm
Binary file not shown.
1 change: 1 addition & 0 deletions tests/feemarket/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1050,6 +1050,7 @@ github.com/skip-mev/chaintestutil v0.0.0-20240514161515-056d7ba45610 h1:4JlsiRVt
github.com/skip-mev/chaintestutil v0.0.0-20240514161515-056d7ba45610/go.mod h1:kB8gFZX07CyJnw8q9iEZijI3qJTIe1K/Y++P5VGkrcg=
github.com/skip-mev/feemarket v1.1.0 h1:3z/3Mplmk4t1C/IjghC+OE361L9n8dR3Xr7bXIcS7ec=
github.com/skip-mev/feemarket v1.1.0/go.mod h1:CVsCaHxJDK4y271c1Dan6Z8G2QaOyWJLoSBnDEPon40=
github.com/skip-mev/feemarket v1.1.1/go.mod h1:DUa6djUsTeMOrbrcIZqWSVxU9IZNCXp96ruaojyBNpc=
github.com/skip-mev/feemarket/tests/e2e v1.10.0 h1:oKAZSo+rynd2b7+T8/U+4C+h//rrTdjLICG2Awjk8YA=
github.com/skip-mev/feemarket/tests/e2e v1.10.0/go.mod h1:57BURopGhr+L0zDkhj1E9jzP9W8rMzRb3b+MT+trlB4=
github.com/skip-mev/interchaintest/v8 v8.0.1-0.20240611183342-72ec508eb966 h1:X5BD7m4QieHlORqGho1Af8r0O1GSWBRYO330xyu2kzQ=
Expand Down
88 changes: 0 additions & 88 deletions tests/ibc/gmp_swap_forward_test.go

This file was deleted.

38 changes: 0 additions & 38 deletions tests/ibc/ibc_setup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (

"cosmossdk.io/math"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v8/packetforward"
transfertypes "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types"
clienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types" //nolint:staticcheck
channeltypes "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types"
Expand All @@ -20,12 +19,10 @@ import (

appparams "github.com/neutron-org/neutron/v4/app/params"
"github.com/neutron-org/neutron/v4/testutil"
dextypes "github.com/neutron-org/neutron/v4/x/dex/types"
)

var (
nativeDenom = appparams.DefaultDenom
ibcTransferAmount = math.NewInt(100_000)
genesisWalletAmount, _ = math.NewIntFromString("10000000000000000000")
)

Expand Down Expand Up @@ -338,38 +335,3 @@ func (s *IBCTestSuite) assertChainBBalance(addr sdk.AccAddress, denom string, ex
func (s *IBCTestSuite) assertChainCBalance(addr sdk.AccAddress, denom string, expectedAmt math.Int) {
s.assertBalance(s.bundleC.App.GetTestBankKeeper(), s.bundleC.Chain, addr, denom, expectedAmt)
}

func (s *IBCTestSuite) ReceiverOverrideAddr(channel, sender string) sdk.AccAddress {
addr, err := packetforward.GetReceiver(channel, sender)
if err != nil {
panic("Cannot calc receiver override: " + err.Error())
}
return sdk.MustAccAddressFromBech32(addr)
}

func (s *IBCTestSuite) neutronDeposit(
token0 string,
token1 string,
depositAmount0 math.Int,
depositAmount1 math.Int,
tickIndex int64,
fee uint64,
creator sdk.AccAddress,
) {
// create deposit msg
msgDeposit := dextypes.NewMsgDeposit(
creator.String(),
creator.String(),
token0,
token1,
[]math.Int{depositAmount0},
[]math.Int{depositAmount1},
[]int64{tickIndex},
[]uint64{fee},
[]*dextypes.DepositOptions{{DisableAutoswap: false}},
)

// execute deposit msg
_, err := s.neutronChain.SendMsgs(msgDeposit)
s.Assert().NoError(err, "Deposit Failed")
}
96 changes: 0 additions & 96 deletions tests/ibc/swap_forward_test.go

This file was deleted.

Loading

0 comments on commit 5bea9ef

Please sign in to comment.