diff --git a/go.mod b/go.mod index c7816c8d..fc217ee5 100644 --- a/go.mod +++ b/go.mod @@ -19,6 +19,7 @@ require ( github.com/spf13/cast v1.5.1 github.com/spf13/cobra v1.8.0 github.com/stretchr/testify v1.8.4 + go.uber.org/mock v0.2.0 golang.org/x/tools v0.6.0 google.golang.org/genproto/googleapis/api v0.0.0-20231212172506-995d672761c0 google.golang.org/grpc v1.60.1 @@ -233,7 +234,7 @@ require ( github.com/gogo/googleapis v1.4.1 // indirect github.com/golang/glog v1.1.2 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect - github.com/golang/mock v1.6.0 // indirect + github.com/golang/mock v1.6.0 github.com/golang/snappy v0.0.4 // indirect github.com/google/btree v1.1.2 // indirect github.com/google/go-cmp v0.6.0 // indirect diff --git a/x/feeabs/ante/ante_test.go b/x/feeabs/ante/ante_test.go new file mode 100644 index 00000000..0440f291 --- /dev/null +++ b/x/feeabs/ante/ante_test.go @@ -0,0 +1,236 @@ +package ante_test + +import ( + "testing" + + "github.com/golang/mock/gomock" + "github.com/stretchr/testify/require" + + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + + "github.com/osmosis-labs/fee-abstraction/v7/x/feeabs/ante" + "github.com/osmosis-labs/fee-abstraction/v7/x/feeabs/types" +) + +func TestMempoolDecorator(t *testing.T) { + gasLimit := uint64(200000) + // mockHostZoneConfig is used to mock the host zone config, with ibcfee as the ibc fee denom to be used as alternative fee + mockHostZoneConfig := types.HostChainFeeAbsConfig{ + IbcDenom: "ibcfee", + OsmosisPoolTokenDenomIn: "osmosis", + PoolId: 1, + Status: types.HostChainFeeAbsStatus_UPDATED, + MinSwapAmount: 0, + } + testCases := []struct { + name string + feeAmount sdk.Coins + minGasPrice sdk.DecCoins + malleate func(*AnteTestSuite) + isErr bool + expErr error + }{ + { + "empty fee, should fail", + sdk.Coins{}, + sdk.NewDecCoinsFromCoins(sdk.NewCoins(sdk.NewInt64Coin("native", 100))...), + func(suite *AnteTestSuite) { + }, + true, + sdkerrors.ErrInsufficientFee, + }, + { + "not enough native fee, should fail", + sdk.NewCoins(sdk.NewInt64Coin("native", 100)), + sdk.NewDecCoinsFromCoins(sdk.NewCoins(sdk.NewInt64Coin("native", 1000))...), + func(suite *AnteTestSuite) {}, + true, + sdkerrors.ErrInsufficientFee, + }, + { + "enough native fee, should pass", + sdk.NewCoins(sdk.NewInt64Coin("native", 1000*int64(gasLimit))), + sdk.NewDecCoinsFromCoins(sdk.NewCoins(sdk.NewInt64Coin("native", 1000))...), + func(suite *AnteTestSuite) {}, + false, + nil, + }, + { + "unknown ibc fee denom, should fail", + sdk.NewCoins(sdk.NewInt64Coin("ibcfee", 1000*int64(gasLimit))), + sdk.NewDecCoinsFromCoins(sdk.NewCoins(sdk.NewInt64Coin("native", 1000))...), + func(suite *AnteTestSuite) {}, + true, + sdkerrors.ErrInvalidCoins, + }, + { + "not enough ibc fee, should fail", + sdk.NewCoins(sdk.NewInt64Coin("ibcfee", 999*int64(gasLimit))), + sdk.NewDecCoinsFromCoins(sdk.NewCoins(sdk.NewInt64Coin("native", 1000))...), + func(suite *AnteTestSuite) { + err := suite.feeabsKeeper.SetHostZoneConfig(suite.ctx, mockHostZoneConfig) + require.NoError(t, err) + suite.feeabsKeeper.SetTwapRate(suite.ctx, "ibcfee", sdk.NewDec(1)) + suite.stakingKeeper.EXPECT().BondDenom(gomock.Any()).Return("native").MinTimes(1) + }, + true, + sdkerrors.ErrInsufficientFee, + }, + + { + "enough ibc fee, should pass", + sdk.NewCoins(sdk.NewInt64Coin("ibcfee", 1000*int64(gasLimit))), + sdk.NewDecCoinsFromCoins(sdk.NewCoins(sdk.NewInt64Coin("native", 1000))...), + func(suite *AnteTestSuite) { + err := suite.feeabsKeeper.SetHostZoneConfig(suite.ctx, mockHostZoneConfig) + require.NoError(t, err) + suite.feeabsKeeper.SetTwapRate(suite.ctx, "ibcfee", sdk.NewDec(1)) + suite.stakingKeeper.EXPECT().BondDenom(gomock.Any()).Return("native").MinTimes(1) + }, + false, + nil, + }, + // TODO: Add support for multiple denom fees(--fees 50ibc,50native) + // { + // "half native fee, half ibc fee, should pass", + // sdk.NewCoins(sdk.NewInt64Coin("native", 500*int64(gasLimit)), sdk.NewInt64Coin("ibcfee", 500*int64(gasLimit))), + // sdk.NewDecCoinsFromCoins(sdk.NewCoins(sdk.NewInt64Coin("native", 1000))...), + // func(suite *AnteTestSuite) { + // err := suite.feeabsKeeper.SetHostZoneConfig(suite.ctx, types.HostChainFeeAbsConfig{ + // IbcDenom: "ibcfee", + // OsmosisPoolTokenDenomIn: "osmosis", + // PoolId: 1, + // Status: types.HostChainFeeAbsStatus_UPDATED, + // MinSwapAmount: 0, + // }) + // require.NoError(t, err) + // suite.feeabsKeeper.SetTwapRate(suite.ctx, "ibcfee", sdk.NewDec(1)) + // suite.stakingKeeper.EXPECT().BondDenom(gomock.Any()).Return("native").MinTimes(1) + // }, + // false, + // nil, + // }, + } + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + suite := SetupTestSuite(t, true) + + tc.malleate(suite) + suite.txBuilder.SetGasLimit(gasLimit) + suite.txBuilder.SetFeeAmount(tc.feeAmount) + suite.ctx = suite.ctx.WithMinGasPrices(tc.minGasPrice) + + // Construct tx and run through mempool decorator + tx := suite.txBuilder.GetTx() + mempoolDecorator := ante.NewFeeAbstrationMempoolFeeDecorator(suite.feeabsKeeper) + antehandler := sdk.ChainAnteDecorators(mempoolDecorator) + + // Run the ante handler + _, err := antehandler(suite.ctx, tx, false) + + if tc.isErr { + require.Error(t, err) + require.ErrorIs(t, err, tc.expErr) + } else { + require.NoError(t, err) + } + }) + } +} + +func TestDeductFeeDecorator(t *testing.T) { + gasLimit := uint64(200000) + minGasPrice := sdk.NewDecCoinsFromCoins(sdk.NewCoins(sdk.NewInt64Coin("native", 1000))...) + feeAmount := sdk.NewCoins(sdk.NewInt64Coin("native", 1000*int64(gasLimit))) + ibcFeeAmount := sdk.NewCoins(sdk.NewInt64Coin("ibcfee", 1000*int64(gasLimit))) + // mockHostZoneConfig is used to mock the host zone config, with ibcfee as the ibc fee denom to be used as alternative fee + mockHostZoneConfig := types.HostChainFeeAbsConfig{ + IbcDenom: "ibcfee", + OsmosisPoolTokenDenomIn: "osmosis", + PoolId: 1, + Status: types.HostChainFeeAbsStatus_UPDATED, + MinSwapAmount: 0, + } + testCases := []struct { + name string + malleate func(*AnteTestSuite) + isErr bool + expErr error + }{ + { + "not enough native fee in balance, should fail", + func(suite *AnteTestSuite) { + suite.feeabsKeeper.SetTwapRate(suite.ctx, "ibcfee", sdk.NewDec(1)) + // suite.bankKeeper.EXPECT().SendCoinsFromAccountToModule(gomock.Any(), gomock.Any(), types.ModuleName, feeAmount).Return(sdkerrors.ErrInsufficientFee).MinTimes(1) + suite.bankKeeper.EXPECT().SendCoinsFromAccountToModule(gomock.Any(), gomock.Any(), authtypes.FeeCollectorName, feeAmount).Return(sdkerrors.ErrInsufficientFee).MinTimes(1) + }, + true, + sdkerrors.ErrInsufficientFunds, + }, + { + "enough native fee in balance, should pass", + func(suite *AnteTestSuite) { + suite.feeabsKeeper.SetTwapRate(suite.ctx, "ibcfee", sdk.NewDec(1)) + suite.bankKeeper.EXPECT().SendCoinsFromAccountToModule(gomock.Any(), gomock.Any(), authtypes.FeeCollectorName, feeAmount).Return(nil).MinTimes(1) + }, + false, + nil, + }, + { + "not enough ibc fee in balance, should fail", + func(suite *AnteTestSuite) { + err := suite.feeabsKeeper.SetHostZoneConfig(suite.ctx, mockHostZoneConfig) + require.NoError(t, err) + suite.feeabsKeeper.SetTwapRate(suite.ctx, "ibcfee", sdk.NewDec(1)) + suite.txBuilder.SetFeeAmount(ibcFeeAmount) + suite.stakingKeeper.EXPECT().BondDenom(gomock.Any()).Return("native").MinTimes(1) + suite.bankKeeper.EXPECT().SendCoinsFromAccountToModule(gomock.Any(), gomock.Any(), types.ModuleName, ibcFeeAmount).Return(sdkerrors.ErrInsufficientFunds).MinTimes(1) + }, + true, + sdkerrors.ErrInsufficientFunds, + }, + { + "enough ibc fee in balance, should pass", + func(suite *AnteTestSuite) { + err := suite.feeabsKeeper.SetHostZoneConfig(suite.ctx, mockHostZoneConfig) + require.NoError(t, err) + suite.feeabsKeeper.SetTwapRate(suite.ctx, "ibcfee", sdk.NewDec(1)) + suite.txBuilder.SetFeeAmount(ibcFeeAmount) + suite.stakingKeeper.EXPECT().BondDenom(gomock.Any()).Return("native").MinTimes(1) + suite.bankKeeper.EXPECT().SendCoinsFromAccountToModule(gomock.Any(), gomock.Any(), types.ModuleName, ibcFeeAmount).Return(nil).MinTimes(1) + suite.bankKeeper.EXPECT().SendCoinsFromAccountToModule(gomock.Any(), gomock.Any(), authtypes.FeeCollectorName, feeAmount).Return(nil).MinTimes(1) + }, + false, + nil, + }, + } + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + suite := SetupTestSuite(t, false) + acc := suite.CreateTestAccounts(1)[0] + // default value for gasLimit, feeAmount, feePayer. Use native token fee as default + suite.txBuilder.SetGasLimit(gasLimit) + suite.txBuilder.SetFeeAmount(feeAmount) + suite.txBuilder.SetFeePayer(acc.acc.GetAddress()) + suite.ctx = suite.ctx.WithMinGasPrices(minGasPrice) + + // mallate the test case, e.g. setup to pay fee in IBC token + tc.malleate(suite) + + // Construct tx and run through mempool decorator + tx := suite.txBuilder.GetTx() + deductFeeDecorator := ante.NewFeeAbstractionDeductFeeDecorate(suite.accountKeeper, suite.bankKeeper, suite.feeabsKeeper, suite.feeGrantKeeper) + antehandler := sdk.ChainAnteDecorators(deductFeeDecorator) + _, err := antehandler(suite.ctx, tx, false) + + if tc.isErr { + require.Error(t, err) + require.ErrorIs(t, err, tc.expErr) + } else { + require.NoError(t, err) + } + }) + } +} diff --git a/x/feeabs/ante/decorate.go b/x/feeabs/ante/decorate.go index 6d2242b3..30f70986 100644 --- a/x/feeabs/ante/decorate.go +++ b/x/feeabs/ante/decorate.go @@ -291,7 +291,7 @@ func (famfd FeeAbstrationMempoolFeeDecorator) AnteHandle(ctx sdk.Context, tx sdk // After replace the feeCoinsNonZeroDenom, feeCoinsNonZeroDenom must be in denom subset of nonZeroCoinFeesReq if !feeCoinsNonZeroDenom.DenomsSubsetOf(nonZeroCoinFeesReq) { - return ctx, sdkerrors.Wrapf(errorstypes.ErrInsufficientFee, "fee is not a subset of required fees; got %s, required: %s", feeCoins.String(), feeRequired.String()) + return ctx, sdkerrors.Wrapf(errorstypes.ErrInvalidCoins, "fee is not a subset of required fees; got %s, required: %s", feeCoinsNonZeroDenom.String(), feeRequired.String()) } // if the msg does not satisfy bypass condition and the feeCoins denoms are subset of fezeRequired, @@ -315,8 +315,8 @@ func (famfd FeeAbstrationMempoolFeeDecorator) AnteHandle(ctx sdk.Context, tx sdk // Not contain zeroCoinFeesDenomReq's denoms // // check if the feeCoins has coins' amount higher/equal to nonZeroCoinFeesReq - if !feeCoins.IsAnyGTE(nonZeroCoinFeesReq) { - err := sdkerrors.Wrapf(errorstypes.ErrInsufficientFee, "insufficient fees; got: %s required: %s", feeCoins, feeRequired) + if !feeCoinsNonZeroDenom.IsAnyGTE(nonZeroCoinFeesReq) { + err := sdkerrors.Wrapf(errorstypes.ErrInsufficientFee, "insufficient fees; got: %s required: %s", feeCoinsNonZeroDenom, nonZeroCoinFeesReq) if byPassExceedMaxGasUsage { err = sdkerrors.Wrapf(errorstypes.ErrInsufficientFee, "Insufficient fees; bypass-min-fee-msg-types with gas consumption exceeds the maximum allowed gas value.") } diff --git a/x/feeabs/ante/testutil_test.go b/x/feeabs/ante/testutil_test.go new file mode 100644 index 00000000..618ffad3 --- /dev/null +++ b/x/feeabs/ante/testutil_test.go @@ -0,0 +1,120 @@ +package ante_test + +import ( + "testing" + + transferkeeper "github.com/cosmos/ibc-go/v7/modules/apps/transfer/keeper" + "github.com/stretchr/testify/require" + ubermock "go.uber.org/mock/gomock" + + "github.com/cosmos/cosmos-sdk/client" + cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" + storetypes "github.com/cosmos/cosmos-sdk/store/types" + "github.com/cosmos/cosmos-sdk/testutil" + "github.com/cosmos/cosmos-sdk/testutil/testdata" + sdk "github.com/cosmos/cosmos-sdk/types" + moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" + "github.com/cosmos/cosmos-sdk/x/auth" + authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" + + feeabskeeper "github.com/osmosis-labs/fee-abstraction/v7/x/feeabs/keeper" + feeabstestutil "github.com/osmosis-labs/fee-abstraction/v7/x/feeabs/testutil" + feeabstypes "github.com/osmosis-labs/fee-abstraction/v7/x/feeabs/types" +) + +// TestAccount represents an account used in the tests in x/auth/ante. +type TestAccount struct { + acc authtypes.AccountI + priv cryptotypes.PrivKey +} + +// AnteTestSuite is a test suite to be used with ante handler tests. +type AnteTestSuite struct { + ctx sdk.Context + clientCtx client.Context + txBuilder client.TxBuilder + accountKeeper authkeeper.AccountKeeper + bankKeeper *feeabstestutil.MockBankKeeper + feeGrantKeeper *feeabstestutil.MockFeegrantKeeper + stakingKeeper *feeabstestutil.MockStakingKeeper + feeabsKeeper feeabskeeper.Keeper + channelKeeper *feeabstestutil.MockChannelKeeper + portKeeper *feeabstestutil.MockPortKeeper + scopedKeeper *feeabstestutil.MockScopedKeeper + encCfg moduletestutil.TestEncodingConfig +} + +// SetupTest setups a new test, with new app, context, and anteHandler. +func SetupTestSuite(t *testing.T, isCheckTx bool) *AnteTestSuite { + t.Helper() + suite := &AnteTestSuite{} + ctrl := ubermock.NewController(t) + + // Setup mock keepers + suite.bankKeeper = feeabstestutil.NewMockBankKeeper(ctrl) + suite.stakingKeeper = feeabstestutil.NewMockStakingKeeper(ctrl) + suite.feeGrantKeeper = feeabstestutil.NewMockFeegrantKeeper(ctrl) + suite.channelKeeper = feeabstestutil.NewMockChannelKeeper(ctrl) + suite.portKeeper = feeabstestutil.NewMockPortKeeper(ctrl) + suite.scopedKeeper = feeabstestutil.NewMockScopedKeeper(ctrl) + + // setup necessary params for Account Keeper + key := sdk.NewKVStoreKey(feeabstypes.StoreKey) + authKey := sdk.NewKVStoreKey(authtypes.StoreKey) + subspace := paramtypes.NewSubspace(nil, nil, nil, nil, "feeabs") + subspace = subspace.WithKeyTable(feeabstypes.ParamKeyTable()) + maccPerms := map[string][]string{ + "fee_collector": nil, + "mint": {"minter"}, + "bonded_tokens_pool": {"burner", "staking"}, + "not_bonded_tokens_pool": {"burner", "staking"}, + "multiPerm": {"burner", "minter", "staking"}, + "random": {"random"}, + "feeabs": nil, + } + + // setup context for Account Keeper + testCtx := testutil.DefaultContextWithDB(t, key, sdk.NewTransientStoreKey("transient_test")) + testCtx.CMS.MountStoreWithDB(authKey, storetypes.StoreTypeIAVL, testCtx.DB) + testCtx.CMS.MountStoreWithDB(sdk.NewTransientStoreKey("transient_test2"), storetypes.StoreTypeTransient, testCtx.DB) + err := testCtx.CMS.LoadLatestVersion() + require.NoError(t, err) + suite.ctx = testCtx.Ctx.WithIsCheckTx(isCheckTx).WithBlockHeight(1) // app.BaseApp.NewContext(isCheckTx, tmproto.Header{}).WithBlockHeight(1) + + suite.encCfg = moduletestutil.MakeTestEncodingConfig(auth.AppModuleBasic{}) + suite.encCfg.Amino.RegisterConcrete(&testdata.TestMsg{}, "testdata.TestMsg", nil) + testdata.RegisterInterfaces(suite.encCfg.InterfaceRegistry) + suite.accountKeeper = authkeeper.NewAccountKeeper( + suite.encCfg.Codec, authKey, authtypes.ProtoBaseAccount, maccPerms, sdk.Bech32MainPrefix, authtypes.NewModuleAddress("gov").String(), + ) + suite.accountKeeper.SetModuleAccount(suite.ctx, authtypes.NewEmptyModuleAccount(feeabstypes.ModuleName)) + // Setup feeabs keeper + suite.feeabsKeeper = feeabskeeper.NewKeeper(suite.encCfg.Codec, key, subspace, suite.stakingKeeper, suite.accountKeeper, nil, transferkeeper.Keeper{}, suite.channelKeeper, suite.portKeeper, suite.scopedKeeper) + suite.clientCtx = client.Context{}. + WithTxConfig(suite.encCfg.TxConfig) + require.NoError(t, err) + + // setup txBuilder + suite.txBuilder = suite.clientCtx.TxConfig.NewTxBuilder() + + return suite +} + +func (suite *AnteTestSuite) CreateTestAccounts(numAccs int) []TestAccount { + var accounts []TestAccount + + for i := 0; i < numAccs; i++ { + priv, _, addr := testdata.KeyTestPubAddr() + acc := suite.accountKeeper.NewAccountWithAddress(suite.ctx, addr) + err := acc.SetAccountNumber(uint64(i)) + if err != nil { + panic(err) + } + suite.accountKeeper.SetAccount(suite.ctx, acc) + accounts = append(accounts, TestAccount{acc, priv}) + } + + return accounts +} diff --git a/x/feeabs/testutil/expected_keeper_mocks.go b/x/feeabs/testutil/expected_keeper_mocks.go new file mode 100644 index 00000000..d7dab3ff --- /dev/null +++ b/x/feeabs/testutil/expected_keeper_mocks.go @@ -0,0 +1,613 @@ +// Code generated by MockGen. DO NOT EDIT. +// Source: x/feeabs/types/expected_keepers.go +// +// Generated by this command: +// +// mockgen -source=x/feeabs/types/expected_keepers.go -package testutil -destination x/feeabs/testutil/expected_keeper_mocks.go +// + +// Package testutil is a generated GoMock package. +package testutil + +import ( + reflect "reflect" + + types "github.com/cosmos/cosmos-sdk/types" + types0 "github.com/cosmos/cosmos-sdk/x/auth/types" + types1 "github.com/cosmos/cosmos-sdk/x/capability/types" + types2 "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" + types3 "github.com/cosmos/ibc-go/v7/modules/core/03-connection/types" + types4 "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" + exported "github.com/cosmos/ibc-go/v7/modules/core/exported" + gomock "go.uber.org/mock/gomock" +) + +// MockAccountKeeper is a mock of AccountKeeper interface. +type MockAccountKeeper struct { + ctrl *gomock.Controller + recorder *MockAccountKeeperMockRecorder +} + +// MockAccountKeeperMockRecorder is the mock recorder for MockAccountKeeper. +type MockAccountKeeperMockRecorder struct { + mock *MockAccountKeeper +} + +// NewMockAccountKeeper creates a new mock instance. +func NewMockAccountKeeper(ctrl *gomock.Controller) *MockAccountKeeper { + mock := &MockAccountKeeper{ctrl: ctrl} + mock.recorder = &MockAccountKeeperMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockAccountKeeper) EXPECT() *MockAccountKeeperMockRecorder { + return m.recorder +} + +// GetAccount mocks base method. +func (m *MockAccountKeeper) GetAccount(ctx types.Context, addr types.AccAddress) types0.AccountI { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetAccount", ctx, addr) + ret0, _ := ret[0].(types0.AccountI) + return ret0 +} + +// GetAccount indicates an expected call of GetAccount. +func (mr *MockAccountKeeperMockRecorder) GetAccount(ctx, addr any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAccount", reflect.TypeOf((*MockAccountKeeper)(nil).GetAccount), ctx, addr) +} + +// GetModuleAccount mocks base method. +func (m *MockAccountKeeper) GetModuleAccount(ctx types.Context, moduleName string) types0.ModuleAccountI { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetModuleAccount", ctx, moduleName) + ret0, _ := ret[0].(types0.ModuleAccountI) + return ret0 +} + +// GetModuleAccount indicates an expected call of GetModuleAccount. +func (mr *MockAccountKeeperMockRecorder) GetModuleAccount(ctx, moduleName any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetModuleAccount", reflect.TypeOf((*MockAccountKeeper)(nil).GetModuleAccount), ctx, moduleName) +} + +// GetModuleAddress mocks base method. +func (m *MockAccountKeeper) GetModuleAddress(moduleName string) types.AccAddress { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetModuleAddress", moduleName) + ret0, _ := ret[0].(types.AccAddress) + return ret0 +} + +// GetModuleAddress indicates an expected call of GetModuleAddress. +func (mr *MockAccountKeeperMockRecorder) GetModuleAddress(moduleName any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetModuleAddress", reflect.TypeOf((*MockAccountKeeper)(nil).GetModuleAddress), moduleName) +} + +// GetParams mocks base method. +func (m *MockAccountKeeper) GetParams(ctx types.Context) types0.Params { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetParams", ctx) + ret0, _ := ret[0].(types0.Params) + return ret0 +} + +// GetParams indicates an expected call of GetParams. +func (mr *MockAccountKeeperMockRecorder) GetParams(ctx any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetParams", reflect.TypeOf((*MockAccountKeeper)(nil).GetParams), ctx) +} + +// IterateAccounts mocks base method. +func (m *MockAccountKeeper) IterateAccounts(ctx types.Context, process func(types0.AccountI) bool) { + m.ctrl.T.Helper() + m.ctrl.Call(m, "IterateAccounts", ctx, process) +} + +// IterateAccounts indicates an expected call of IterateAccounts. +func (mr *MockAccountKeeperMockRecorder) IterateAccounts(ctx, process any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IterateAccounts", reflect.TypeOf((*MockAccountKeeper)(nil).IterateAccounts), ctx, process) +} + +// NewAccountWithAddress mocks base method. +func (m *MockAccountKeeper) NewAccountWithAddress(ctx types.Context, addr types.AccAddress) types0.AccountI { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "NewAccountWithAddress", ctx, addr) + ret0, _ := ret[0].(types0.AccountI) + return ret0 +} + +// NewAccountWithAddress indicates an expected call of NewAccountWithAddress. +func (mr *MockAccountKeeperMockRecorder) NewAccountWithAddress(ctx, addr any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NewAccountWithAddress", reflect.TypeOf((*MockAccountKeeper)(nil).NewAccountWithAddress), ctx, addr) +} + +// SetAccount mocks base method. +func (m *MockAccountKeeper) SetAccount(ctx types.Context, acc types0.AccountI) { + m.ctrl.T.Helper() + m.ctrl.Call(m, "SetAccount", ctx, acc) +} + +// SetAccount indicates an expected call of SetAccount. +func (mr *MockAccountKeeperMockRecorder) SetAccount(ctx, acc any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetAccount", reflect.TypeOf((*MockAccountKeeper)(nil).SetAccount), ctx, acc) +} + +// SetModuleAccount mocks base method. +func (m *MockAccountKeeper) SetModuleAccount(arg0 types.Context, arg1 types0.ModuleAccountI) { + m.ctrl.T.Helper() + m.ctrl.Call(m, "SetModuleAccount", arg0, arg1) +} + +// SetModuleAccount indicates an expected call of SetModuleAccount. +func (mr *MockAccountKeeperMockRecorder) SetModuleAccount(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetModuleAccount", reflect.TypeOf((*MockAccountKeeper)(nil).SetModuleAccount), arg0, arg1) +} + +// MockBankKeeper is a mock of BankKeeper interface. +type MockBankKeeper struct { + ctrl *gomock.Controller + recorder *MockBankKeeperMockRecorder +} + +// MockBankKeeperMockRecorder is the mock recorder for MockBankKeeper. +type MockBankKeeperMockRecorder struct { + mock *MockBankKeeper +} + +// NewMockBankKeeper creates a new mock instance. +func NewMockBankKeeper(ctrl *gomock.Controller) *MockBankKeeper { + mock := &MockBankKeeper{ctrl: ctrl} + mock.recorder = &MockBankKeeperMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockBankKeeper) EXPECT() *MockBankKeeperMockRecorder { + return m.recorder +} + +// GetAllBalances mocks base method. +func (m *MockBankKeeper) GetAllBalances(ctx types.Context, addr types.AccAddress) types.Coins { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetAllBalances", ctx, addr) + ret0, _ := ret[0].(types.Coins) + return ret0 +} + +// GetAllBalances indicates an expected call of GetAllBalances. +func (mr *MockBankKeeperMockRecorder) GetAllBalances(ctx, addr any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAllBalances", reflect.TypeOf((*MockBankKeeper)(nil).GetAllBalances), ctx, addr) +} + +// GetBalance mocks base method. +func (m *MockBankKeeper) GetBalance(ctx types.Context, addr types.AccAddress, denom string) types.Coin { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetBalance", ctx, addr, denom) + ret0, _ := ret[0].(types.Coin) + return ret0 +} + +// GetBalance indicates an expected call of GetBalance. +func (mr *MockBankKeeperMockRecorder) GetBalance(ctx, addr, denom any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBalance", reflect.TypeOf((*MockBankKeeper)(nil).GetBalance), ctx, addr, denom) +} + +// IsSendEnabledCoins mocks base method. +func (m *MockBankKeeper) IsSendEnabledCoins(ctx types.Context, coins ...types.Coin) error { + m.ctrl.T.Helper() + varargs := []any{ctx} + for _, a := range coins { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "IsSendEnabledCoins", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// IsSendEnabledCoins indicates an expected call of IsSendEnabledCoins. +func (mr *MockBankKeeperMockRecorder) IsSendEnabledCoins(ctx any, coins ...any) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]any{ctx}, coins...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsSendEnabledCoins", reflect.TypeOf((*MockBankKeeper)(nil).IsSendEnabledCoins), varargs...) +} + +// SendCoins mocks base method. +func (m *MockBankKeeper) SendCoins(ctx types.Context, fromAddr, toAddr types.AccAddress, amt types.Coins) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SendCoins", ctx, fromAddr, toAddr, amt) + ret0, _ := ret[0].(error) + return ret0 +} + +// SendCoins indicates an expected call of SendCoins. +func (mr *MockBankKeeperMockRecorder) SendCoins(ctx, fromAddr, toAddr, amt any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendCoins", reflect.TypeOf((*MockBankKeeper)(nil).SendCoins), ctx, fromAddr, toAddr, amt) +} + +// SendCoinsFromAccountToModule mocks base method. +func (m *MockBankKeeper) SendCoinsFromAccountToModule(ctx types.Context, senderAddr types.AccAddress, recipientModule string, amt types.Coins) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SendCoinsFromAccountToModule", ctx, senderAddr, recipientModule, amt) + ret0, _ := ret[0].(error) + return ret0 +} + +// SendCoinsFromAccountToModule indicates an expected call of SendCoinsFromAccountToModule. +func (mr *MockBankKeeperMockRecorder) SendCoinsFromAccountToModule(ctx, senderAddr, recipientModule, amt any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendCoinsFromAccountToModule", reflect.TypeOf((*MockBankKeeper)(nil).SendCoinsFromAccountToModule), ctx, senderAddr, recipientModule, amt) +} + +// SendCoinsFromModuleToModule mocks base method. +func (m *MockBankKeeper) SendCoinsFromModuleToModule(ctx types.Context, senderModule, recipientModule string, amt types.Coins) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SendCoinsFromModuleToModule", ctx, senderModule, recipientModule, amt) + ret0, _ := ret[0].(error) + return ret0 +} + +// SendCoinsFromModuleToModule indicates an expected call of SendCoinsFromModuleToModule. +func (mr *MockBankKeeperMockRecorder) SendCoinsFromModuleToModule(ctx, senderModule, recipientModule, amt any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendCoinsFromModuleToModule", reflect.TypeOf((*MockBankKeeper)(nil).SendCoinsFromModuleToModule), ctx, senderModule, recipientModule, amt) +} + +// SpendableCoins mocks base method. +func (m *MockBankKeeper) SpendableCoins(ctx types.Context, addr types.AccAddress) types.Coins { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SpendableCoins", ctx, addr) + ret0, _ := ret[0].(types.Coins) + return ret0 +} + +// SpendableCoins indicates an expected call of SpendableCoins. +func (mr *MockBankKeeperMockRecorder) SpendableCoins(ctx, addr any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SpendableCoins", reflect.TypeOf((*MockBankKeeper)(nil).SpendableCoins), ctx, addr) +} + +// MockFeegrantKeeper is a mock of FeegrantKeeper interface. +type MockFeegrantKeeper struct { + ctrl *gomock.Controller + recorder *MockFeegrantKeeperMockRecorder +} + +// MockFeegrantKeeperMockRecorder is the mock recorder for MockFeegrantKeeper. +type MockFeegrantKeeperMockRecorder struct { + mock *MockFeegrantKeeper +} + +// NewMockFeegrantKeeper creates a new mock instance. +func NewMockFeegrantKeeper(ctrl *gomock.Controller) *MockFeegrantKeeper { + mock := &MockFeegrantKeeper{ctrl: ctrl} + mock.recorder = &MockFeegrantKeeperMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockFeegrantKeeper) EXPECT() *MockFeegrantKeeperMockRecorder { + return m.recorder +} + +// UseGrantedFees mocks base method. +func (m *MockFeegrantKeeper) UseGrantedFees(ctx types.Context, granter, grantee types.AccAddress, fee types.Coins, msgs []types.Msg) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "UseGrantedFees", ctx, granter, grantee, fee, msgs) + ret0, _ := ret[0].(error) + return ret0 +} + +// UseGrantedFees indicates an expected call of UseGrantedFees. +func (mr *MockFeegrantKeeperMockRecorder) UseGrantedFees(ctx, granter, grantee, fee, msgs any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UseGrantedFees", reflect.TypeOf((*MockFeegrantKeeper)(nil).UseGrantedFees), ctx, granter, grantee, fee, msgs) +} + +// MockStakingKeeper is a mock of StakingKeeper interface. +type MockStakingKeeper struct { + ctrl *gomock.Controller + recorder *MockStakingKeeperMockRecorder +} + +// MockStakingKeeperMockRecorder is the mock recorder for MockStakingKeeper. +type MockStakingKeeperMockRecorder struct { + mock *MockStakingKeeper +} + +// NewMockStakingKeeper creates a new mock instance. +func NewMockStakingKeeper(ctrl *gomock.Controller) *MockStakingKeeper { + mock := &MockStakingKeeper{ctrl: ctrl} + mock.recorder = &MockStakingKeeperMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockStakingKeeper) EXPECT() *MockStakingKeeperMockRecorder { + return m.recorder +} + +// BondDenom mocks base method. +func (m *MockStakingKeeper) BondDenom(ctx types.Context) string { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "BondDenom", ctx) + ret0, _ := ret[0].(string) + return ret0 +} + +// BondDenom indicates an expected call of BondDenom. +func (mr *MockStakingKeeperMockRecorder) BondDenom(ctx any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BondDenom", reflect.TypeOf((*MockStakingKeeper)(nil).BondDenom), ctx) +} + +// MockClientKeeper is a mock of ClientKeeper interface. +type MockClientKeeper struct { + ctrl *gomock.Controller + recorder *MockClientKeeperMockRecorder +} + +// MockClientKeeperMockRecorder is the mock recorder for MockClientKeeper. +type MockClientKeeperMockRecorder struct { + mock *MockClientKeeper +} + +// NewMockClientKeeper creates a new mock instance. +func NewMockClientKeeper(ctrl *gomock.Controller) *MockClientKeeper { + mock := &MockClientKeeper{ctrl: ctrl} + mock.recorder = &MockClientKeeperMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockClientKeeper) EXPECT() *MockClientKeeperMockRecorder { + return m.recorder +} + +// GetClientConsensusState mocks base method. +func (m *MockClientKeeper) GetClientConsensusState(ctx types.Context, clientID string) (exported.ConsensusState, bool) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetClientConsensusState", ctx, clientID) + ret0, _ := ret[0].(exported.ConsensusState) + ret1, _ := ret[1].(bool) + return ret0, ret1 +} + +// GetClientConsensusState indicates an expected call of GetClientConsensusState. +func (mr *MockClientKeeperMockRecorder) GetClientConsensusState(ctx, clientID any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetClientConsensusState", reflect.TypeOf((*MockClientKeeper)(nil).GetClientConsensusState), ctx, clientID) +} + +// MockConnectionKeeper is a mock of ConnectionKeeper interface. +type MockConnectionKeeper struct { + ctrl *gomock.Controller + recorder *MockConnectionKeeperMockRecorder +} + +// MockConnectionKeeperMockRecorder is the mock recorder for MockConnectionKeeper. +type MockConnectionKeeperMockRecorder struct { + mock *MockConnectionKeeper +} + +// NewMockConnectionKeeper creates a new mock instance. +func NewMockConnectionKeeper(ctrl *gomock.Controller) *MockConnectionKeeper { + mock := &MockConnectionKeeper{ctrl: ctrl} + mock.recorder = &MockConnectionKeeperMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockConnectionKeeper) EXPECT() *MockConnectionKeeperMockRecorder { + return m.recorder +} + +// GetConnection mocks base method. +func (m *MockConnectionKeeper) GetConnection(ctx types.Context, connectionID string) (types3.ConnectionEnd, bool) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetConnection", ctx, connectionID) + ret0, _ := ret[0].(types3.ConnectionEnd) + ret1, _ := ret[1].(bool) + return ret0, ret1 +} + +// GetConnection indicates an expected call of GetConnection. +func (mr *MockConnectionKeeperMockRecorder) GetConnection(ctx, connectionID any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetConnection", reflect.TypeOf((*MockConnectionKeeper)(nil).GetConnection), ctx, connectionID) +} + +// MockPortKeeper is a mock of PortKeeper interface. +type MockPortKeeper struct { + ctrl *gomock.Controller + recorder *MockPortKeeperMockRecorder +} + +// MockPortKeeperMockRecorder is the mock recorder for MockPortKeeper. +type MockPortKeeperMockRecorder struct { + mock *MockPortKeeper +} + +// NewMockPortKeeper creates a new mock instance. +func NewMockPortKeeper(ctrl *gomock.Controller) *MockPortKeeper { + mock := &MockPortKeeper{ctrl: ctrl} + mock.recorder = &MockPortKeeperMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockPortKeeper) EXPECT() *MockPortKeeperMockRecorder { + return m.recorder +} + +// BindPort mocks base method. +func (m *MockPortKeeper) BindPort(ctx types.Context, portID string) *types1.Capability { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "BindPort", ctx, portID) + ret0, _ := ret[0].(*types1.Capability) + return ret0 +} + +// BindPort indicates an expected call of BindPort. +func (mr *MockPortKeeperMockRecorder) BindPort(ctx, portID any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BindPort", reflect.TypeOf((*MockPortKeeper)(nil).BindPort), ctx, portID) +} + +// MockScopedKeeper is a mock of ScopedKeeper interface. +type MockScopedKeeper struct { + ctrl *gomock.Controller + recorder *MockScopedKeeperMockRecorder +} + +// MockScopedKeeperMockRecorder is the mock recorder for MockScopedKeeper. +type MockScopedKeeperMockRecorder struct { + mock *MockScopedKeeper +} + +// NewMockScopedKeeper creates a new mock instance. +func NewMockScopedKeeper(ctrl *gomock.Controller) *MockScopedKeeper { + mock := &MockScopedKeeper{ctrl: ctrl} + mock.recorder = &MockScopedKeeperMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockScopedKeeper) EXPECT() *MockScopedKeeperMockRecorder { + return m.recorder +} + +// AuthenticateCapability mocks base method. +func (m *MockScopedKeeper) AuthenticateCapability(ctx types.Context, capability *types1.Capability, name string) bool { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "AuthenticateCapability", ctx, capability, name) + ret0, _ := ret[0].(bool) + return ret0 +} + +// AuthenticateCapability indicates an expected call of AuthenticateCapability. +func (mr *MockScopedKeeperMockRecorder) AuthenticateCapability(ctx, capability, name any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AuthenticateCapability", reflect.TypeOf((*MockScopedKeeper)(nil).AuthenticateCapability), ctx, capability, name) +} + +// ClaimCapability mocks base method. +func (m *MockScopedKeeper) ClaimCapability(ctx types.Context, capability *types1.Capability, name string) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ClaimCapability", ctx, capability, name) + ret0, _ := ret[0].(error) + return ret0 +} + +// ClaimCapability indicates an expected call of ClaimCapability. +func (mr *MockScopedKeeperMockRecorder) ClaimCapability(ctx, capability, name any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClaimCapability", reflect.TypeOf((*MockScopedKeeper)(nil).ClaimCapability), ctx, capability, name) +} + +// GetCapability mocks base method. +func (m *MockScopedKeeper) GetCapability(ctx types.Context, name string) (*types1.Capability, bool) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetCapability", ctx, name) + ret0, _ := ret[0].(*types1.Capability) + ret1, _ := ret[1].(bool) + return ret0, ret1 +} + +// GetCapability indicates an expected call of GetCapability. +func (mr *MockScopedKeeperMockRecorder) GetCapability(ctx, name any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetCapability", reflect.TypeOf((*MockScopedKeeper)(nil).GetCapability), ctx, name) +} + +// MockChannelKeeper is a mock of ChannelKeeper interface. +type MockChannelKeeper struct { + ctrl *gomock.Controller + recorder *MockChannelKeeperMockRecorder +} + +// MockChannelKeeperMockRecorder is the mock recorder for MockChannelKeeper. +type MockChannelKeeperMockRecorder struct { + mock *MockChannelKeeper +} + +// NewMockChannelKeeper creates a new mock instance. +func NewMockChannelKeeper(ctrl *gomock.Controller) *MockChannelKeeper { + mock := &MockChannelKeeper{ctrl: ctrl} + mock.recorder = &MockChannelKeeperMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockChannelKeeper) EXPECT() *MockChannelKeeperMockRecorder { + return m.recorder +} + +// ChanCloseInit mocks base method. +func (m *MockChannelKeeper) ChanCloseInit(ctx types.Context, portID, channelID string, chanCap *types1.Capability) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ChanCloseInit", ctx, portID, channelID, chanCap) + ret0, _ := ret[0].(error) + return ret0 +} + +// ChanCloseInit indicates an expected call of ChanCloseInit. +func (mr *MockChannelKeeperMockRecorder) ChanCloseInit(ctx, portID, channelID, chanCap any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ChanCloseInit", reflect.TypeOf((*MockChannelKeeper)(nil).ChanCloseInit), ctx, portID, channelID, chanCap) +} + +// GetChannel mocks base method. +func (m *MockChannelKeeper) GetChannel(ctx types.Context, srcPort, srcChan string) (types4.Channel, bool) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetChannel", ctx, srcPort, srcChan) + ret0, _ := ret[0].(types4.Channel) + ret1, _ := ret[1].(bool) + return ret0, ret1 +} + +// GetChannel indicates an expected call of GetChannel. +func (mr *MockChannelKeeperMockRecorder) GetChannel(ctx, srcPort, srcChan any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetChannel", reflect.TypeOf((*MockChannelKeeper)(nil).GetChannel), ctx, srcPort, srcChan) +} + +// GetNextSequenceSend mocks base method. +func (m *MockChannelKeeper) GetNextSequenceSend(ctx types.Context, portID, channelID string) (uint64, bool) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetNextSequenceSend", ctx, portID, channelID) + ret0, _ := ret[0].(uint64) + ret1, _ := ret[1].(bool) + return ret0, ret1 +} + +// GetNextSequenceSend indicates an expected call of GetNextSequenceSend. +func (mr *MockChannelKeeperMockRecorder) GetNextSequenceSend(ctx, portID, channelID any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetNextSequenceSend", reflect.TypeOf((*MockChannelKeeper)(nil).GetNextSequenceSend), ctx, portID, channelID) +} + +// SendPacket mocks base method. +func (m *MockChannelKeeper) SendPacket(ctx types.Context, channelCap *types1.Capability, sourcePort, sourceChannel string, timeoutHeight types2.Height, timeoutTimestamp uint64, data []byte) (uint64, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SendPacket", ctx, channelCap, sourcePort, sourceChannel, timeoutHeight, timeoutTimestamp, data) + ret0, _ := ret[0].(uint64) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// SendPacket indicates an expected call of SendPacket. +func (mr *MockChannelKeeperMockRecorder) SendPacket(ctx, channelCap, sourcePort, sourceChannel, timeoutHeight, timeoutTimestamp, data any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendPacket", reflect.TypeOf((*MockChannelKeeper)(nil).SendPacket), ctx, channelCap, sourcePort, sourceChannel, timeoutHeight, timeoutTimestamp, data) +} diff --git a/x/feeabs/types/expected_keepers.go b/x/feeabs/types/expected_keepers.go index 488bc425..1d709ad1 100644 --- a/x/feeabs/types/expected_keepers.go +++ b/x/feeabs/types/expected_keepers.go @@ -7,15 +7,20 @@ import ( ibcexported "github.com/cosmos/ibc-go/v7/modules/core/exported" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/auth/types" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" ) // AccountKeeper defines the expected account keeper used for simulations (noalias) type AccountKeeper interface { - GetAccount(ctx sdk.Context, addr sdk.AccAddress) types.AccountI + GetAccount(ctx sdk.Context, addr sdk.AccAddress) authtypes.AccountI GetModuleAddress(moduleName string) sdk.AccAddress - GetModuleAccount(ctx sdk.Context, moduleName string) types.ModuleAccountI + GetModuleAccount(ctx sdk.Context, moduleName string) authtypes.ModuleAccountI + IterateAccounts(ctx sdk.Context, process func(authtypes.AccountI) (stop bool)) + SetModuleAccount(sdk.Context, authtypes.ModuleAccountI) + GetParams(ctx sdk.Context) authtypes.Params + SetAccount(ctx sdk.Context, acc authtypes.AccountI) + NewAccountWithAddress(ctx sdk.Context, addr sdk.AccAddress) authtypes.AccountI } // BankKeeper defines the expected interface needed to retrieve account balances. @@ -25,6 +30,8 @@ type BankKeeper interface { GetBalance(ctx sdk.Context, addr sdk.AccAddress, denom string) sdk.Coin GetAllBalances(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins SendCoinsFromModuleToModule(ctx sdk.Context, senderModule, recipientModule string, amt sdk.Coins) error + IsSendEnabledCoins(ctx sdk.Context, coins ...sdk.Coin) error + SendCoins(ctx sdk.Context, fromAddr sdk.AccAddress, toAddr sdk.AccAddress, amt sdk.Coins) error } type FeegrantKeeper interface {