From b5b187ac5019d1080d11d6bc443d0bdf63f32266 Mon Sep 17 00:00:00 2001 From: aljo242 Date: Mon, 13 May 2024 12:30:43 -0400 Subject: [PATCH] gen --- x/feemarket/ante/fee_test.go | 3 +- x/feemarket/ante/mocks/mock_account_keeper.go | 3 +- x/feemarket/ante/mocks/mock_bank_keeper.go | 3 +- .../ante/mocks/mock_feegrant_keeper.go | 3 +- .../ante/mocks/mock_feemarket_keeper.go | 31 +------------- x/feemarket/post/fee_test.go | 3 +- x/feemarket/post/mocks/mock_account_keeper.go | 22 +++++++++- x/feemarket/post/mocks/mock_bank_keeper.go | 14 ++++++- .../post/mocks/mock_feegrant_keeper.go | 6 ++- .../post/mocks/mock_feemarket_keeper.go | 40 +++++++++++++++---- .../types/mocks/mock_account_keeper.go | 3 +- 11 files changed, 86 insertions(+), 45 deletions(-) diff --git a/x/feemarket/ante/fee_test.go b/x/feemarket/ante/fee_test.go index b99317e..5a66206 100644 --- a/x/feemarket/ante/fee_test.go +++ b/x/feemarket/ante/fee_test.go @@ -1,10 +1,11 @@ package ante_test import ( - "cosmossdk.io/math" "fmt" "testing" + "cosmossdk.io/math" + "github.com/cosmos/cosmos-sdk/testutil/testdata" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" diff --git a/x/feemarket/ante/mocks/mock_account_keeper.go b/x/feemarket/ante/mocks/mock_account_keeper.go index 36ccd8c..9325e1b 100644 --- a/x/feemarket/ante/mocks/mock_account_keeper.go +++ b/x/feemarket/ante/mocks/mock_account_keeper.go @@ -122,7 +122,8 @@ func (_m *AccountKeeper) SetAccount(ctx types.Context, acc authtypes.AccountI) { func NewAccountKeeper(t interface { mock.TestingT Cleanup(func()) -}) *AccountKeeper { +}, +) *AccountKeeper { mock := &AccountKeeper{} mock.Mock.Test(t) diff --git a/x/feemarket/ante/mocks/mock_bank_keeper.go b/x/feemarket/ante/mocks/mock_bank_keeper.go index fa56f45..0c6734a 100644 --- a/x/feemarket/ante/mocks/mock_bank_keeper.go +++ b/x/feemarket/ante/mocks/mock_bank_keeper.go @@ -78,7 +78,8 @@ func (_m *BankKeeper) SendCoinsFromAccountToModule(ctx types.Context, senderAddr func NewBankKeeper(t interface { mock.TestingT Cleanup(func()) -}) *BankKeeper { +}, +) *BankKeeper { mock := &BankKeeper{} mock.Mock.Test(t) diff --git a/x/feemarket/ante/mocks/mock_feegrant_keeper.go b/x/feemarket/ante/mocks/mock_feegrant_keeper.go index ae04861..b4c64f8 100644 --- a/x/feemarket/ante/mocks/mock_feegrant_keeper.go +++ b/x/feemarket/ante/mocks/mock_feegrant_keeper.go @@ -35,7 +35,8 @@ func (_m *FeeGrantKeeper) UseGrantedFees(ctx types.Context, granter types.AccAdd func NewFeeGrantKeeper(t interface { mock.TestingT Cleanup(func()) -}) *FeeGrantKeeper { +}, +) *FeeGrantKeeper { mock := &FeeGrantKeeper{} mock.Mock.Test(t) diff --git a/x/feemarket/ante/mocks/mock_feemarket_keeper.go b/x/feemarket/ante/mocks/mock_feemarket_keeper.go index 99e8b0b..7d219a1 100644 --- a/x/feemarket/ante/mocks/mock_feemarket_keeper.go +++ b/x/feemarket/ante/mocks/mock_feemarket_keeper.go @@ -34,34 +34,6 @@ func (_m *FeeMarketKeeper) GetDenomResolver() types.DenomResolver { return r0 } -// GetMinGasPrice provides a mock function with given fields: ctx -func (_m *FeeMarketKeeper) GetMinGasPrice(ctx cosmos_sdktypes.Context) (cosmos_sdktypes.Coin, error) { - ret := _m.Called(ctx) - - if len(ret) == 0 { - panic("no return value specified for GetMinGasPrice") - } - - var r0 cosmos_sdktypes.Coin - var r1 error - if rf, ok := ret.Get(0).(func(cosmos_sdktypes.Context) (cosmos_sdktypes.Coin, error)); ok { - return rf(ctx) - } - if rf, ok := ret.Get(0).(func(cosmos_sdktypes.Context) cosmos_sdktypes.Coin); ok { - r0 = rf(ctx) - } else { - r0 = ret.Get(0).(cosmos_sdktypes.Coin) - } - - if rf, ok := ret.Get(1).(func(cosmos_sdktypes.Context) error); ok { - r1 = rf(ctx) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - // GetMinGasPrices provides a mock function with given fields: ctx func (_m *FeeMarketKeeper) GetMinGasPrices(ctx cosmos_sdktypes.Context) (cosmos_sdktypes.DecCoins, error) { ret := _m.Called(ctx) @@ -189,7 +161,8 @@ func (_m *FeeMarketKeeper) SetState(ctx cosmos_sdktypes.Context, state types.Sta func NewFeeMarketKeeper(t interface { mock.TestingT Cleanup(func()) -}) *FeeMarketKeeper { +}, +) *FeeMarketKeeper { mock := &FeeMarketKeeper{} mock.Mock.Test(t) diff --git a/x/feemarket/post/fee_test.go b/x/feemarket/post/fee_test.go index c3b2905..14606d8 100644 --- a/x/feemarket/post/fee_test.go +++ b/x/feemarket/post/fee_test.go @@ -1,10 +1,11 @@ package post_test import ( - "cosmossdk.io/math" "fmt" "testing" + "cosmossdk.io/math" + "github.com/cosmos/cosmos-sdk/testutil/testdata" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" diff --git a/x/feemarket/post/mocks/mock_account_keeper.go b/x/feemarket/post/mocks/mock_account_keeper.go index fb833d3..9325e1b 100644 --- a/x/feemarket/post/mocks/mock_account_keeper.go +++ b/x/feemarket/post/mocks/mock_account_keeper.go @@ -1,4 +1,4 @@ -// Code generated by mockery v0.0.0-dev. DO NOT EDIT. +// Code generated by mockery v2.43.0. DO NOT EDIT. package mocks @@ -18,6 +18,10 @@ type AccountKeeper struct { func (_m *AccountKeeper) GetAccount(ctx types.Context, addr types.AccAddress) authtypes.AccountI { ret := _m.Called(ctx, addr) + if len(ret) == 0 { + panic("no return value specified for GetAccount") + } + var r0 authtypes.AccountI if rf, ok := ret.Get(0).(func(types.Context, types.AccAddress) authtypes.AccountI); ok { r0 = rf(ctx, addr) @@ -34,6 +38,10 @@ func (_m *AccountKeeper) GetAccount(ctx types.Context, addr types.AccAddress) au func (_m *AccountKeeper) GetModuleAccount(ctx types.Context, name string) authtypes.ModuleAccountI { ret := _m.Called(ctx, name) + if len(ret) == 0 { + panic("no return value specified for GetModuleAccount") + } + var r0 authtypes.ModuleAccountI if rf, ok := ret.Get(0).(func(types.Context, string) authtypes.ModuleAccountI); ok { r0 = rf(ctx, name) @@ -50,6 +58,10 @@ func (_m *AccountKeeper) GetModuleAccount(ctx types.Context, name string) authty func (_m *AccountKeeper) GetModuleAddress(moduleName string) types.AccAddress { ret := _m.Called(moduleName) + if len(ret) == 0 { + panic("no return value specified for GetModuleAddress") + } + var r0 types.AccAddress if rf, ok := ret.Get(0).(func(string) types.AccAddress); ok { r0 = rf(moduleName) @@ -66,6 +78,10 @@ func (_m *AccountKeeper) GetModuleAddress(moduleName string) types.AccAddress { func (_m *AccountKeeper) GetParams(ctx types.Context) authtypes.Params { ret := _m.Called(ctx) + if len(ret) == 0 { + panic("no return value specified for GetParams") + } + var r0 authtypes.Params if rf, ok := ret.Get(0).(func(types.Context) authtypes.Params); ok { r0 = rf(ctx) @@ -80,6 +96,10 @@ func (_m *AccountKeeper) GetParams(ctx types.Context) authtypes.Params { func (_m *AccountKeeper) NewAccountWithAddress(ctx types.Context, addr types.AccAddress) authtypes.AccountI { ret := _m.Called(ctx, addr) + if len(ret) == 0 { + panic("no return value specified for NewAccountWithAddress") + } + var r0 authtypes.AccountI if rf, ok := ret.Get(0).(func(types.Context, types.AccAddress) authtypes.AccountI); ok { r0 = rf(ctx, addr) diff --git a/x/feemarket/post/mocks/mock_bank_keeper.go b/x/feemarket/post/mocks/mock_bank_keeper.go index 26d9807..9d41b44 100644 --- a/x/feemarket/post/mocks/mock_bank_keeper.go +++ b/x/feemarket/post/mocks/mock_bank_keeper.go @@ -1,4 +1,4 @@ -// Code generated by mockery v0.0.0-dev. DO NOT EDIT. +// Code generated by mockery v2.43.0. DO NOT EDIT. package mocks @@ -24,6 +24,10 @@ func (_m *BankKeeper) IsSendEnabledCoins(ctx types.Context, coins ...types.Coin) _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for IsSendEnabledCoins") + } + var r0 error if rf, ok := ret.Get(0).(func(types.Context, ...types.Coin) error); ok { r0 = rf(ctx, coins...) @@ -38,6 +42,10 @@ func (_m *BankKeeper) IsSendEnabledCoins(ctx types.Context, coins ...types.Coin) func (_m *BankKeeper) SendCoins(ctx types.Context, from types.AccAddress, to types.AccAddress, amt types.Coins) error { ret := _m.Called(ctx, from, to, amt) + if len(ret) == 0 { + panic("no return value specified for SendCoins") + } + var r0 error if rf, ok := ret.Get(0).(func(types.Context, types.AccAddress, types.AccAddress, types.Coins) error); ok { r0 = rf(ctx, from, to, amt) @@ -52,6 +60,10 @@ func (_m *BankKeeper) SendCoins(ctx types.Context, from types.AccAddress, to typ func (_m *BankKeeper) SendCoinsFromAccountToModule(ctx types.Context, senderAddr types.AccAddress, recipientModule string, amt types.Coins) error { ret := _m.Called(ctx, senderAddr, recipientModule, amt) + if len(ret) == 0 { + panic("no return value specified for SendCoinsFromAccountToModule") + } + var r0 error if rf, ok := ret.Get(0).(func(types.Context, types.AccAddress, string, types.Coins) error); ok { r0 = rf(ctx, senderAddr, recipientModule, amt) diff --git a/x/feemarket/post/mocks/mock_feegrant_keeper.go b/x/feemarket/post/mocks/mock_feegrant_keeper.go index aefc832..afac1e0 100644 --- a/x/feemarket/post/mocks/mock_feegrant_keeper.go +++ b/x/feemarket/post/mocks/mock_feegrant_keeper.go @@ -1,4 +1,4 @@ -// Code generated by mockery v0.0.0-dev. DO NOT EDIT. +// Code generated by mockery v2.43.0. DO NOT EDIT. package mocks @@ -17,6 +17,10 @@ type FeeGrantKeeper struct { func (_m *FeeGrantKeeper) UseGrantedFees(ctx types.Context, granter types.AccAddress, grantee types.AccAddress, fee types.Coins, msgs []types.Msg) error { ret := _m.Called(ctx, granter, grantee, fee, msgs) + if len(ret) == 0 { + panic("no return value specified for UseGrantedFees") + } + var r0 error if rf, ok := ret.Get(0).(func(types.Context, types.AccAddress, types.AccAddress, types.Coins, []types.Msg) error); ok { r0 = rf(ctx, granter, grantee, fee, msgs) diff --git a/x/feemarket/post/mocks/mock_feemarket_keeper.go b/x/feemarket/post/mocks/mock_feemarket_keeper.go index 4d53c56..7d219a1 100644 --- a/x/feemarket/post/mocks/mock_feemarket_keeper.go +++ b/x/feemarket/post/mocks/mock_feemarket_keeper.go @@ -1,4 +1,4 @@ -// Code generated by mockery v0.0.0-dev. DO NOT EDIT. +// Code generated by mockery v2.43.0. DO NOT EDIT. package mocks @@ -18,6 +18,10 @@ type FeeMarketKeeper struct { func (_m *FeeMarketKeeper) GetDenomResolver() types.DenomResolver { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for GetDenomResolver") + } + var r0 types.DenomResolver if rf, ok := ret.Get(0).(func() types.DenomResolver); ok { r0 = rf() @@ -30,19 +34,25 @@ func (_m *FeeMarketKeeper) GetDenomResolver() types.DenomResolver { return r0 } -// GetMinGasPrice provides a mock function with given fields: ctx -func (_m *FeeMarketKeeper) GetMinGasPrice(ctx cosmos_sdktypes.Context) (cosmos_sdktypes.Coin, error) { +// GetMinGasPrices provides a mock function with given fields: ctx +func (_m *FeeMarketKeeper) GetMinGasPrices(ctx cosmos_sdktypes.Context) (cosmos_sdktypes.DecCoins, error) { ret := _m.Called(ctx) - var r0 cosmos_sdktypes.Coin + if len(ret) == 0 { + panic("no return value specified for GetMinGasPrices") + } + + var r0 cosmos_sdktypes.DecCoins var r1 error - if rf, ok := ret.Get(0).(func(cosmos_sdktypes.Context) (cosmos_sdktypes.Coin, error)); ok { + if rf, ok := ret.Get(0).(func(cosmos_sdktypes.Context) (cosmos_sdktypes.DecCoins, error)); ok { return rf(ctx) } - if rf, ok := ret.Get(0).(func(cosmos_sdktypes.Context) cosmos_sdktypes.Coin); ok { + if rf, ok := ret.Get(0).(func(cosmos_sdktypes.Context) cosmos_sdktypes.DecCoins); ok { r0 = rf(ctx) } else { - r0 = ret.Get(0).(cosmos_sdktypes.Coin) + if ret.Get(0) != nil { + r0 = ret.Get(0).(cosmos_sdktypes.DecCoins) + } } if rf, ok := ret.Get(1).(func(cosmos_sdktypes.Context) error); ok { @@ -58,6 +68,10 @@ func (_m *FeeMarketKeeper) GetMinGasPrice(ctx cosmos_sdktypes.Context) (cosmos_s func (_m *FeeMarketKeeper) GetParams(ctx cosmos_sdktypes.Context) (types.Params, error) { ret := _m.Called(ctx) + if len(ret) == 0 { + panic("no return value specified for GetParams") + } + var r0 types.Params var r1 error if rf, ok := ret.Get(0).(func(cosmos_sdktypes.Context) (types.Params, error)); ok { @@ -82,6 +96,10 @@ func (_m *FeeMarketKeeper) GetParams(ctx cosmos_sdktypes.Context) (types.Params, func (_m *FeeMarketKeeper) GetState(ctx cosmos_sdktypes.Context) (types.State, error) { ret := _m.Called(ctx) + if len(ret) == 0 { + panic("no return value specified for GetState") + } + var r0 types.State var r1 error if rf, ok := ret.Get(0).(func(cosmos_sdktypes.Context) (types.State, error)); ok { @@ -106,6 +124,10 @@ func (_m *FeeMarketKeeper) GetState(ctx cosmos_sdktypes.Context) (types.State, e func (_m *FeeMarketKeeper) SetParams(ctx cosmos_sdktypes.Context, params types.Params) error { ret := _m.Called(ctx, params) + if len(ret) == 0 { + panic("no return value specified for SetParams") + } + var r0 error if rf, ok := ret.Get(0).(func(cosmos_sdktypes.Context, types.Params) error); ok { r0 = rf(ctx, params) @@ -120,6 +142,10 @@ func (_m *FeeMarketKeeper) SetParams(ctx cosmos_sdktypes.Context, params types.P func (_m *FeeMarketKeeper) SetState(ctx cosmos_sdktypes.Context, state types.State) error { ret := _m.Called(ctx, state) + if len(ret) == 0 { + panic("no return value specified for SetState") + } + var r0 error if rf, ok := ret.Get(0).(func(cosmos_sdktypes.Context, types.State) error); ok { r0 = rf(ctx, state) diff --git a/x/feemarket/types/mocks/mock_account_keeper.go b/x/feemarket/types/mocks/mock_account_keeper.go index ef92bd5..0d99089 100644 --- a/x/feemarket/types/mocks/mock_account_keeper.go +++ b/x/feemarket/types/mocks/mock_account_keeper.go @@ -80,7 +80,8 @@ func (_m *AccountKeeper) GetModuleAddress(name string) types.AccAddress { func NewAccountKeeper(t interface { mock.TestingT Cleanup(func()) -}) *AccountKeeper { +}, +) *AccountKeeper { mock := &AccountKeeper{} mock.Mock.Test(t)