Skip to content

Commit

Permalink
Merge pull request #363 from neutron-org/chore/bump-pfm
Browse files Browse the repository at this point in the history
Chore: bump pfm
  • Loading branch information
pr0n00gler authored Nov 14, 2023
2 parents 4804545 + 9d51475 commit 483f875
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 31 deletions.
41 changes: 20 additions & 21 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ import (
"path/filepath"

globalfeetypes "github.com/cosmos/gaia/v11/x/globalfee/types"
"github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7/router"

"github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7/packetforward"
"github.com/cosmos/interchain-security/v3/testutil/integration"

wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types"
Expand Down Expand Up @@ -147,8 +146,8 @@ import (
storetypes "github.com/cosmos/cosmos-sdk/store/types"
consensusparamkeeper "github.com/cosmos/cosmos-sdk/x/consensus/keeper"
consensusparamtypes "github.com/cosmos/cosmos-sdk/x/consensus/types"
routerkeeper "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7/router/keeper"
routertypes "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7/router/types"
pfmkeeper "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7/packetforward/keeper"
pfmtypes "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7/packetforward/types"

"github.com/neutron-org/neutron/x/dex"
dexkeeper "github.com/neutron-org/neutron/x/dex/keeper"
Expand Down Expand Up @@ -225,7 +224,7 @@ var (
),
),
ibchooks.AppModuleBasic{},
router.AppModuleBasic{},
packetforward.AppModuleBasic{},
auction.AppModuleBasic{},
globalfee.AppModule{},
dex.AppModuleBasic{},
Expand Down Expand Up @@ -310,11 +309,11 @@ type App struct {
ConsumerKeeper ccvconsumerkeeper.Keeper
TokenFactoryKeeper *tokenfactorykeeper.Keeper
CronKeeper cronkeeper.Keeper
PFMKeeper *routerkeeper.Keeper
PFMKeeper *pfmkeeper.Keeper
DexKeeper dexkeeper.Keeper
SwapKeeper ibcswapkeeper.Keeper

RouterModule router.AppModule
PFMModule packetforward.AppModule

HooksTransferIBCModule *ibchooks.IBCMiddleware
HooksICS4Wrapper ibchooks.ICS4Middleware
Expand Down Expand Up @@ -396,7 +395,7 @@ func New(
evidencetypes.StoreKey, ibctransfertypes.StoreKey, icacontrollertypes.StoreKey,
icahosttypes.StoreKey, capabilitytypes.StoreKey,
interchainqueriesmoduletypes.StoreKey, contractmanagermoduletypes.StoreKey, interchaintxstypes.StoreKey, wasmtypes.StoreKey, feetypes.StoreKey,
feeburnertypes.StoreKey, adminmoduletypes.StoreKey, ccvconsumertypes.StoreKey, tokenfactorytypes.StoreKey, routertypes.StoreKey,
feeburnertypes.StoreKey, adminmoduletypes.StoreKey, ccvconsumertypes.StoreKey, tokenfactorytypes.StoreKey, pfmtypes.StoreKey,
crontypes.StoreKey, ibchookstypes.StoreKey, consensusparamtypes.StoreKey, crisistypes.StoreKey, auctiontypes.StoreKey, dextypes.StoreKey,
)
tkeys := sdk.NewTransientStoreKeys(paramstypes.TStoreKey)
Expand Down Expand Up @@ -532,15 +531,15 @@ func New(
feeBurnerModule := feeburner.NewAppModule(appCodec, *app.FeeBurnerKeeper)

// PFMKeeper must be created before TransferKeeper
app.PFMKeeper = routerkeeper.NewKeeper(
app.PFMKeeper = pfmkeeper.NewKeeper(
appCodec,
app.keys[routertypes.StoreKey],
app.GetSubspace(routertypes.ModuleName),
app.keys[pfmtypes.StoreKey],
app.TransferKeeper.Keeper,
app.IBCKeeper.ChannelKeeper,
app.FeeBurnerKeeper,
&app.BankKeeper,
app.IBCKeeper.ChannelKeeper,
authtypes.NewModuleAddress(adminmoduletypes.ModuleName).String(),
)
wasmHooks := ibchooks.NewWasmHooks(nil, sdk.GetConfig().GetBech32AccountAddrPrefix()) // The contract keeper needs to be set later
app.HooksICS4Wrapper = ibchooks.NewICS4Middleware(
Expand Down Expand Up @@ -751,14 +750,14 @@ func New(
contractManagerModule := contractmanager.NewAppModule(appCodec, app.ContractManagerKeeper)
ibcHooksModule := ibchooks.NewAppModule(app.AccountKeeper)

app.RouterModule = router.NewAppModule(app.PFMKeeper)
app.PFMModule = packetforward.NewAppModule(app.PFMKeeper, app.GetSubspace(pfmtypes.ModuleName))

var ibcStack ibcporttypes.IBCModule = router.NewIBCMiddleware(
var ibcStack ibcporttypes.IBCModule = packetforward.NewIBCMiddleware(
app.HooksTransferIBCModule,
app.PFMKeeper,
0,
routerkeeper.DefaultForwardTransferPacketTimeoutTimestamp,
routerkeeper.DefaultRefundTransferPacketTimeoutTimestamp,
pfmkeeper.DefaultForwardTransferPacketTimeoutTimestamp,
pfmkeeper.DefaultRefundTransferPacketTimeoutTimestamp,
)

ibcStack = ibcswap.NewIBCMiddleware(ibcStack, app.SwapKeeper)
Expand Down Expand Up @@ -799,7 +798,7 @@ func New(
transferModule,
consumerModule,
icaModule,
app.RouterModule,
app.PFMModule,
interchainQueriesModule,
interchainTxsModule,
feeModule,
Expand Down Expand Up @@ -846,7 +845,7 @@ func New(
feeburnertypes.ModuleName,
adminmoduletypes.ModuleName,
ibchookstypes.ModuleName,
routertypes.ModuleName,
pfmtypes.ModuleName,
crontypes.ModuleName,
globalfee.ModuleName,
ibcswaptypes.ModuleName,
Expand Down Expand Up @@ -879,7 +878,7 @@ func New(
feeburnertypes.ModuleName,
adminmoduletypes.ModuleName,
ibchookstypes.ModuleName,
routertypes.ModuleName,
pfmtypes.ModuleName,
crontypes.ModuleName,
globalfee.ModuleName,
ibcswaptypes.ModuleName,
Expand Down Expand Up @@ -919,7 +918,7 @@ func New(
feeburnertypes.ModuleName,
adminmoduletypes.ModuleName,
ibchookstypes.ModuleName, // after auth keeper
routertypes.ModuleName,
pfmtypes.ModuleName,
crontypes.ModuleName,
globalfee.ModuleName,
ibcswaptypes.ModuleName,
Expand Down Expand Up @@ -947,7 +946,7 @@ func New(
transferModule,
consumerModule,
icaModule,
app.RouterModule,
app.PFMModule,
interchainQueriesModule,
interchainTxsModule,
feeBurnerModule,
Expand Down Expand Up @@ -1288,7 +1287,7 @@ func initParamsKeeper(appCodec codec.BinaryCodec, legacyAmino *codec.LegacyAmino
paramsKeeper.Subspace(icacontrollertypes.SubModuleName).WithKeyTable(icacontrollertypes.ParamKeyTable())
paramsKeeper.Subspace(icahosttypes.SubModuleName).WithKeyTable(icahosttypes.ParamKeyTable())

paramsKeeper.Subspace(routertypes.ModuleName).WithKeyTable(routertypes.ParamKeyTable())
paramsKeeper.Subspace(pfmtypes.ModuleName).WithKeyTable(pfmtypes.ParamKeyTable())

paramsKeeper.Subspace(globalfee.ModuleName).WithKeyTable(globalfeetypes.ParamKeyTable())

Expand Down
3 changes: 1 addition & 2 deletions app/proposals_allowlisting.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"github.com/cosmos/cosmos-sdk/x/params/types/proposal"
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"
globalfeetypes "github.com/cosmos/gaia/v11/x/globalfee/types"
packetforwardmiddlewaretypes "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7/router/types"
icahosttypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/host/types"
ibctransfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types"
ibcclienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types"
Expand Down Expand Up @@ -105,5 +104,5 @@ var WhitelistedParams = map[paramChangeKey]struct{}{
// {Subspace: crontypes.ModuleName, Key: string(crontypes.KeySecurityAddress)}: {},
// {Subspace: crontypes.ModuleName, Key: string(crontypes.KeyLimit)}: {},
// packet-forward-middleware
{Subspace: packetforwardmiddlewaretypes.ModuleName, Key: string(packetforwardmiddlewaretypes.KeyFeePercentage)}: {},
// {Subspace: packetforwardmiddlewaretypes.ModuleName, Key: string(packetforwardmiddlewaretypes.KeyFeePercentage)}: {},
}
3 changes: 1 addition & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ require (
github.com/cosmos/cosmos-sdk v0.47.5
github.com/cosmos/gaia/v11 v11.0.0-00010101000000-000000000000
github.com/cosmos/gogoproto v1.4.10
// TEMP: Using this version to support duality swap-and-forward
github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7 v7.0.0-20230629164013-34f5e666f806
github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7 v7.1.0
github.com/cosmos/ibc-go/v7 v7.3.1
github.com/cosmos/ics23/go v0.10.0
github.com/cosmos/interchain-security/v3 v3.1.0
Expand Down
5 changes: 3 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -399,8 +399,8 @@ github.com/cosmos/gogoproto v1.4.10 h1:QH/yT8X+c0F4ZDacDv3z+xE3WU1P1Z3wQoLMBRJoK
github.com/cosmos/gogoproto v1.4.10/go.mod h1:3aAZzeRWpAwr+SS/LLkICX2/kDFyaYVzckBDzygIxek=
github.com/cosmos/iavl v0.20.1 h1:rM1kqeG3/HBT85vsZdoSNsehciqUQPWrR4BYmqE2+zg=
github.com/cosmos/iavl v0.20.1/go.mod h1:WO7FyvaZJoH65+HFOsDir7xU9FWk2w9cHXNW1XHcl7A=
github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7 v7.0.0-20230629164013-34f5e666f806 h1:iFWb/KrnP5jthNZ23l72wqE8nzHJHzoVe22giUfJce8=
github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7 v7.0.0-20230629164013-34f5e666f806/go.mod h1:fctjEnz9xaBFOlmYYPdKL8Hs1Y3GUKilSwsJdqBb5QU=
github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7 v7.1.0 h1:v4JhwpC2Z+y0ECpLuxGgooSv+HZitmxlG+n/6xDmwHk=
github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7 v7.1.0/go.mod h1:W2/sU0MZ7tFh3irQuoGIWTIw0lWOS6GZCR8WY5OBUGE=
github.com/cosmos/ibc-go/v7 v7.3.1 h1:bil1IjnHdyWDASFYKfwdRiNtFP6WK3osW7QFEAgU4I8=
github.com/cosmos/ibc-go/v7 v7.3.1/go.mod h1:wvx4pPBofe5ZdMNV3OFRxSI4auEP5Qfqf8JXLLNV04g=
github.com/cosmos/ics23/go v0.10.0 h1:iXqLLgp2Lp+EdpIuwXTYIQU+AiHj9mOC2X9ab++bZDM=
Expand Down Expand Up @@ -1203,6 +1203,7 @@ go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ=
go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=
go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A=
go.uber.org/mock v0.2.0 h1:TaP3xedm7JaAgScZO7tlvlKrqT0p7I6OsdGB5YNSMDU=
go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0=
go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4=
go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU=
Expand Down
2 changes: 1 addition & 1 deletion tests/ibc/gmp_swap_forward_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"time"

"cosmossdk.io/math"
forwardtypes "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7/router/types"
forwardtypes "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7/packetforward/types"
transfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types"

"github.com/neutron-org/neutron/x/dex/types"
Expand Down
2 changes: 1 addition & 1 deletion tests/ibc/swap_forward_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"time"

"cosmossdk.io/math"
forwardtypes "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7/router/types"
forwardtypes "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7/packetforward/types"
transfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types"
"github.com/iancoleman/orderedmap"
"golang.org/x/exp/maps"
Expand Down
2 changes: 1 addition & 1 deletion x/ibcswap/ibc_middleware.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"cosmossdk.io/math"
sdk "github.com/cosmos/cosmos-sdk/types"
capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types"
forwardtypes "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7/router/types"
forwardtypes "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7/packetforward/types"
transfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types"
clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types"
channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types"
Expand Down
2 changes: 1 addition & 1 deletion x/ibcswap/types/swap_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"testing"

"cosmossdk.io/math"
forwardtypes "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7/router/types"
forwardtypes "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7/packetforward/types"
"github.com/iancoleman/orderedmap"
"github.com/stretchr/testify/require"

Expand Down

0 comments on commit 483f875

Please sign in to comment.