Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chore: refactoring #722

Merged
merged 1 commit into from
Sep 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -192,10 +192,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 @@ -297,7 +292,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 @@ -369,7 +363,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 @@ -752,15 +745,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 @@ -919,7 +903,6 @@ func New(
pfmkeeper.DefaultRefundTransferPacketTimeoutTimestamp,
)

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

ibcRouter.AddRoute(icacontrollertypes.SubModuleName, icaControllerStack).
Expand Down Expand Up @@ -970,7 +953,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 @@ -1019,7 +1001,6 @@ func New(
oracletypes.ModuleName,
globalfee.ModuleName,
feemarkettypes.ModuleName,
ibcswaptypes.ModuleName,
dextypes.ModuleName,
)

Expand Down Expand Up @@ -1055,7 +1036,6 @@ func New(
oracletypes.ModuleName,
globalfee.ModuleName,
feemarkettypes.ModuleName,
ibcswaptypes.ModuleName,
dextypes.ModuleName,
)

Expand Down Expand Up @@ -1096,7 +1076,6 @@ func New(
feemarkettypes.ModuleName,
oracletypes.ModuleName,
marketmaptypes.ModuleName,
ibcswaptypes.ModuleName,
dextypes.ModuleName,
dynamicfeestypes.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 @@ -1059,6 +1059,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
Loading