testutil

package
v0.0.0-...-3d1925d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 30, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package testutil is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountKeeper

type AccountKeeper interface {
	AddressCodec() addresscodec.Codec

	GetAccount(ctx context.Context, addr sdk.AccAddress) sdk.AccountI

	GetModuleAddress(name string) sdk.AccAddress
	GetModuleAccount(ctx context.Context, name string) sdk.ModuleAccountI

	// TODO remove with genesis 2-phases refactor https://github.com/cosmos/cosmos-sdk/issues/2862
	SetModuleAccount(context.Context, sdk.ModuleAccountI)

	IterateAccounts(ctx context.Context, cb func(account sdk.AccountI) (stop bool))
}

AccountKeeper extends gov's actual expected AccountKeeper with additional methods used in tests.

type BankKeeper

type BankKeeper interface {
	GetAllBalances(ctx context.Context, addr sdk.AccAddress) sdk.Coins
	GetBalance(ctx context.Context, addr sdk.AccAddress, denom string) sdk.Coin
	MintCoins(ctx context.Context, moduleName string, amt sdk.Coins) error
	BurnCoins(ctx context.Context, address []byte, amt sdk.Coins) error
	LockedCoins(ctx context.Context, addr sdk.AccAddress) sdk.Coins
	SpendableCoins(ctx context.Context, addr sdk.AccAddress) sdk.Coins
	SendCoinsFromModuleToAccount(ctx context.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error
	SendCoinsFromModuleToModule(ctx context.Context, senderModule, recipientModule string, amt sdk.Coins) error
	SendCoinsFromAccountToModule(ctx context.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error
}

BankKeeper extends gov's actual expected BankKeeper with additional methods used in tests.

type MockAccountKeeper

type MockAccountKeeper struct {
	// contains filtered or unexported fields
}

MockAccountKeeper is a mock of AccountKeeper interface.

func NewMockAccountKeeper

func NewMockAccountKeeper(ctrl *gomock.Controller) *MockAccountKeeper

NewMockAccountKeeper creates a new mock instance.

func (*MockAccountKeeper) AddressCodec

func (m *MockAccountKeeper) AddressCodec() address.Codec

AddressCodec mocks base method.

func (*MockAccountKeeper) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockAccountKeeper) GetAccount

func (m *MockAccountKeeper) GetAccount(ctx context.Context, addr types.AccAddress) types.AccountI

GetAccount mocks base method.

func (*MockAccountKeeper) GetModuleAccount

func (m *MockAccountKeeper) GetModuleAccount(ctx context.Context, name string) types.ModuleAccountI

GetModuleAccount mocks base method.

func (*MockAccountKeeper) GetModuleAddress

func (m *MockAccountKeeper) GetModuleAddress(name string) types.AccAddress

GetModuleAddress mocks base method.

func (*MockAccountKeeper) IterateAccounts

func (m *MockAccountKeeper) IterateAccounts(ctx context.Context, cb func(types.AccountI) bool)

IterateAccounts mocks base method.

func (*MockAccountKeeper) SetModuleAccount

func (m *MockAccountKeeper) SetModuleAccount(arg0 context.Context, arg1 types.ModuleAccountI)

SetModuleAccount mocks base method.

type MockAccountKeeperMockRecorder

type MockAccountKeeperMockRecorder struct {
	// contains filtered or unexported fields
}

MockAccountKeeperMockRecorder is the mock recorder for MockAccountKeeper.

func (*MockAccountKeeperMockRecorder) AddressCodec

func (mr *MockAccountKeeperMockRecorder) AddressCodec() *gomock.Call

AddressCodec indicates an expected call of AddressCodec.

func (*MockAccountKeeperMockRecorder) GetAccount

func (mr *MockAccountKeeperMockRecorder) GetAccount(ctx, addr interface{}) *gomock.Call

GetAccount indicates an expected call of GetAccount.

func (*MockAccountKeeperMockRecorder) GetModuleAccount

func (mr *MockAccountKeeperMockRecorder) GetModuleAccount(ctx, name interface{}) *gomock.Call

GetModuleAccount indicates an expected call of GetModuleAccount.

func (*MockAccountKeeperMockRecorder) GetModuleAddress

func (mr *MockAccountKeeperMockRecorder) GetModuleAddress(name interface{}) *gomock.Call

GetModuleAddress indicates an expected call of GetModuleAddress.

func (*MockAccountKeeperMockRecorder) IterateAccounts

func (mr *MockAccountKeeperMockRecorder) IterateAccounts(ctx, cb interface{}) *gomock.Call

IterateAccounts indicates an expected call of IterateAccounts.

func (*MockAccountKeeperMockRecorder) SetModuleAccount

func (mr *MockAccountKeeperMockRecorder) SetModuleAccount(arg0, arg1 interface{}) *gomock.Call

SetModuleAccount indicates an expected call of SetModuleAccount.

type MockBankKeeper

type MockBankKeeper struct {
	// contains filtered or unexported fields
}

MockBankKeeper is a mock of BankKeeper interface.

func NewMockBankKeeper

func NewMockBankKeeper(ctrl *gomock.Controller) *MockBankKeeper

NewMockBankKeeper creates a new mock instance.

func (*MockBankKeeper) BurnCoins

func (m *MockBankKeeper) BurnCoins(ctx context.Context, address []byte, amt types.Coins) error

BurnCoins mocks base method.

func (*MockBankKeeper) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockBankKeeper) GetAllBalances

func (m *MockBankKeeper) GetAllBalances(ctx context.Context, addr types.AccAddress) types.Coins

GetAllBalances mocks base method.

func (*MockBankKeeper) GetBalance

func (m *MockBankKeeper) GetBalance(ctx context.Context, addr types.AccAddress, denom string) types.Coin

GetBalance mocks base method.

func (*MockBankKeeper) LockedCoins

func (m *MockBankKeeper) LockedCoins(ctx context.Context, addr types.AccAddress) types.Coins

LockedCoins mocks base method.

func (*MockBankKeeper) MintCoins

func (m *MockBankKeeper) MintCoins(ctx context.Context, moduleName string, amt types.Coins) error

MintCoins mocks base method.

func (*MockBankKeeper) SendCoinsFromAccountToModule

func (m *MockBankKeeper) SendCoinsFromAccountToModule(ctx context.Context, senderAddr types.AccAddress, recipientModule string, amt types.Coins) error

SendCoinsFromAccountToModule mocks base method.

func (*MockBankKeeper) SendCoinsFromModuleToAccount

func (m *MockBankKeeper) SendCoinsFromModuleToAccount(ctx context.Context, senderModule string, recipientAddr types.AccAddress, amt types.Coins) error

SendCoinsFromModuleToAccount mocks base method.

func (*MockBankKeeper) SendCoinsFromModuleToModule

func (m *MockBankKeeper) SendCoinsFromModuleToModule(ctx context.Context, senderModule, recipientModule string, amt types.Coins) error

SendCoinsFromModuleToModule mocks base method.

func (*MockBankKeeper) SpendableCoins

func (m *MockBankKeeper) SpendableCoins(ctx context.Context, addr types.AccAddress) types.Coins

SpendableCoins mocks base method.

type MockBankKeeperMockRecorder

type MockBankKeeperMockRecorder struct {
	// contains filtered or unexported fields
}

MockBankKeeperMockRecorder is the mock recorder for MockBankKeeper.

func (*MockBankKeeperMockRecorder) BurnCoins

func (mr *MockBankKeeperMockRecorder) BurnCoins(ctx, address, amt interface{}) *gomock.Call

BurnCoins indicates an expected call of BurnCoins.

func (*MockBankKeeperMockRecorder) GetAllBalances

func (mr *MockBankKeeperMockRecorder) GetAllBalances(ctx, addr interface{}) *gomock.Call

GetAllBalances indicates an expected call of GetAllBalances.

func (*MockBankKeeperMockRecorder) GetBalance

func (mr *MockBankKeeperMockRecorder) GetBalance(ctx, addr, denom interface{}) *gomock.Call

GetBalance indicates an expected call of GetBalance.

func (*MockBankKeeperMockRecorder) LockedCoins

func (mr *MockBankKeeperMockRecorder) LockedCoins(ctx, addr interface{}) *gomock.Call

LockedCoins indicates an expected call of LockedCoins.

func (*MockBankKeeperMockRecorder) MintCoins

func (mr *MockBankKeeperMockRecorder) MintCoins(ctx, moduleName, amt interface{}) *gomock.Call

MintCoins indicates an expected call of MintCoins.

func (*MockBankKeeperMockRecorder) SendCoinsFromAccountToModule

func (mr *MockBankKeeperMockRecorder) SendCoinsFromAccountToModule(ctx, senderAddr, recipientModule, amt interface{}) *gomock.Call

SendCoinsFromAccountToModule indicates an expected call of SendCoinsFromAccountToModule.

func (*MockBankKeeperMockRecorder) SendCoinsFromModuleToAccount

func (mr *MockBankKeeperMockRecorder) SendCoinsFromModuleToAccount(ctx, senderModule, recipientAddr, amt interface{}) *gomock.Call

SendCoinsFromModuleToAccount indicates an expected call of SendCoinsFromModuleToAccount.

func (*MockBankKeeperMockRecorder) SendCoinsFromModuleToModule

func (mr *MockBankKeeperMockRecorder) SendCoinsFromModuleToModule(ctx, senderModule, recipientModule, amt interface{}) *gomock.Call

SendCoinsFromModuleToModule indicates an expected call of SendCoinsFromModuleToModule.

func (*MockBankKeeperMockRecorder) SpendableCoins

func (mr *MockBankKeeperMockRecorder) SpendableCoins(ctx, addr interface{}) *gomock.Call

SpendableCoins indicates an expected call of SpendableCoins.

type MockPoolKeeper

type MockPoolKeeper struct {
	// contains filtered or unexported fields
}

MockPoolKeeper is a mock of PoolKeeper interface.

func NewMockPoolKeeper

func NewMockPoolKeeper(ctrl *gomock.Controller) *MockPoolKeeper

NewMockPoolKeeper creates a new mock instance.

func (*MockPoolKeeper) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockPoolKeeper) FundCommunityPool

func (m *MockPoolKeeper) FundCommunityPool(ctx context.Context, amount types.Coins, sender types.AccAddress) error

FundCommunityPool mocks base method.

type MockPoolKeeperMockRecorder

type MockPoolKeeperMockRecorder struct {
	// contains filtered or unexported fields
}

MockPoolKeeperMockRecorder is the mock recorder for MockPoolKeeper.

func (*MockPoolKeeperMockRecorder) FundCommunityPool

func (mr *MockPoolKeeperMockRecorder) FundCommunityPool(ctx, amount, sender interface{}) *gomock.Call

FundCommunityPool indicates an expected call of FundCommunityPool.

type MockStakingKeeper

type MockStakingKeeper struct {
	// contains filtered or unexported fields
}

MockStakingKeeper is a mock of StakingKeeper interface.

func NewMockStakingKeeper

func NewMockStakingKeeper(ctrl *gomock.Controller) *MockStakingKeeper

NewMockStakingKeeper creates a new mock instance.

func (*MockStakingKeeper) BondDenom

func (m *MockStakingKeeper) BondDenom(ctx context.Context) (string, error)

BondDenom mocks base method.

func (*MockStakingKeeper) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockStakingKeeper) IterateBondedValidatorsByPower

func (m *MockStakingKeeper) IterateBondedValidatorsByPower(arg0 context.Context, arg1 func(int64, types.ValidatorI) bool) error

IterateBondedValidatorsByPower mocks base method.

func (*MockStakingKeeper) IterateDelegations

func (m *MockStakingKeeper) IterateDelegations(ctx context.Context, delegator types.AccAddress, fn func(int64, types.DelegationI) bool) error

IterateDelegations mocks base method.

func (*MockStakingKeeper) TokensFromConsensusPower

func (m *MockStakingKeeper) TokensFromConsensusPower(ctx context.Context, power int64) math.Int

TokensFromConsensusPower mocks base method.

func (*MockStakingKeeper) TotalBondedTokens

func (m *MockStakingKeeper) TotalBondedTokens(arg0 context.Context) (math.Int, error)

TotalBondedTokens mocks base method.

func (*MockStakingKeeper) ValidatorAddressCodec

func (m *MockStakingKeeper) ValidatorAddressCodec() address.Codec

ValidatorAddressCodec mocks base method.

type MockStakingKeeperMockRecorder

type MockStakingKeeperMockRecorder struct {
	// contains filtered or unexported fields
}

MockStakingKeeperMockRecorder is the mock recorder for MockStakingKeeper.

func (*MockStakingKeeperMockRecorder) BondDenom

func (mr *MockStakingKeeperMockRecorder) BondDenom(ctx interface{}) *gomock.Call

BondDenom indicates an expected call of BondDenom.

func (*MockStakingKeeperMockRecorder) IterateBondedValidatorsByPower

func (mr *MockStakingKeeperMockRecorder) IterateBondedValidatorsByPower(arg0, arg1 interface{}) *gomock.Call

IterateBondedValidatorsByPower indicates an expected call of IterateBondedValidatorsByPower.

func (*MockStakingKeeperMockRecorder) IterateDelegations

func (mr *MockStakingKeeperMockRecorder) IterateDelegations(ctx, delegator, fn interface{}) *gomock.Call

IterateDelegations indicates an expected call of IterateDelegations.

func (*MockStakingKeeperMockRecorder) TokensFromConsensusPower

func (mr *MockStakingKeeperMockRecorder) TokensFromConsensusPower(ctx, power interface{}) *gomock.Call

TokensFromConsensusPower indicates an expected call of TokensFromConsensusPower.

func (*MockStakingKeeperMockRecorder) TotalBondedTokens

func (mr *MockStakingKeeperMockRecorder) TotalBondedTokens(arg0 interface{}) *gomock.Call

TotalBondedTokens indicates an expected call of TotalBondedTokens.

func (*MockStakingKeeperMockRecorder) ValidatorAddressCodec

func (mr *MockStakingKeeperMockRecorder) ValidatorAddressCodec() *gomock.Call

ValidatorAddressCodec indicates an expected call of ValidatorAddressCodec.

type PoolKeeper

type PoolKeeper interface {
	FundCommunityPool(ctx context.Context, amount sdk.Coins, sender sdk.AccAddress) error
}

PoolKeeper extends the gov's actual expected PoolKeeper.

type StakingKeeper

type StakingKeeper interface {
	ValidatorAddressCodec() addresscodec.Codec
	// iterate through bonded validators by operator address, execute func for each validator
	IterateBondedValidatorsByPower(
		context.Context, func(index int64, validator sdk.ValidatorI) (stop bool),
	) error

	TotalBondedTokens(context.Context) (math.Int, error) // total bonded tokens within the validator set
	IterateDelegations(
		ctx context.Context, delegator sdk.AccAddress,
		fn func(index int64, delegation sdk.DelegationI) (stop bool),
	) error

	BondDenom(ctx context.Context) (string, error)
	TokensFromConsensusPower(ctx context.Context, power int64) math.Int
}

StakingKeeper extends gov's actual expected StakingKeeper with additional methods used in tests.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL