testutil

package
v0.0.0-...-a6871c7 Latest Latest
Warning

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

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

Documentation

Overview

Package testutil is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CallCreateValidatorHooks

func CallCreateValidatorHooks(ctx sdk.Context, k keeper.Keeper, addr sdk.AccAddress, valAddr sdk.ValAddress) error

func CreateValidator

func CreateValidator(pk cryptotypes.PubKey, operator string, stake math.Int) (stakingtypes.Validator, error)

func Delegate

func Delegate(
	ctx sdk.Context,
	distrKeeper keeper.Keeper,
	delegator sdk.AccAddress,
	validator *stakingtypes.Validator,
	amount math.Int,
	delegation *stakingtypes.Delegation,
	sk *MockStakingKeeper,
	addressCodec address.Codec,
) (
	newShares math.LegacyDec,
	updatedDel stakingtypes.Delegation,
	err error,
)

Delegate imitate what x/staking Delegate does. It should be used for testing only. If a delegation is passed we are simulating an update to a previous delegation, if it's nil then we simulate a new delegation.

func SlashValidator

func SlashValidator(
	ctx sdk.Context,
	consAddr sdk.ConsAddress,
	infractionHeight int64,
	power int64,
	slashFactor math.LegacyDec,
	validator *stakingtypes.Validator,
	distrKeeper *keeper.Keeper,
	sk *MockStakingKeeper,
) math.Int

SlashValidator copies what x/staking Slash does. It should be used for testing only. And it must be updated whenever the original function is updated. The passed validator will get its tokens updated.

Types

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

GetAccount mocks base method.

func (*MockAccountKeeper) GetModuleAccount

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

GetModuleAccount mocks base method.

func (*MockAccountKeeper) GetModuleAddress

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

GetModuleAddress mocks base method.

func (*MockAccountKeeper) SetModuleAccount

func (m *MockAccountKeeper) SetModuleAccount(arg0 context.Context, arg1 types0.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) 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) BlockedAddr

func (m *MockBankKeeper) BlockedAddr(addr types0.AccAddress) bool

BlockedAddr 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 types0.AccAddress) types0.Coins

GetAllBalances mocks base method.

func (*MockBankKeeper) MintCoins

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

MintCoins mocks base method.

func (*MockBankKeeper) SendCoinsFromAccountToModule

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

SendCoinsFromAccountToModule mocks base method.

func (*MockBankKeeper) SendCoinsFromModuleToAccount

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

SendCoinsFromModuleToAccount mocks base method.

func (*MockBankKeeper) SendCoinsFromModuleToModule

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

SendCoinsFromModuleToModule mocks base method.

func (*MockBankKeeper) SpendableCoins

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

SpendableCoins mocks base method.

type MockBankKeeperMockRecorder

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

MockBankKeeperMockRecorder is the mock recorder for MockBankKeeper.

func (*MockBankKeeperMockRecorder) BlockedAddr

func (mr *MockBankKeeperMockRecorder) BlockedAddr(addr interface{}) *gomock.Call

BlockedAddr indicates an expected call of BlockedAddr.

func (*MockBankKeeperMockRecorder) GetAllBalances

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

GetAllBalances indicates an expected call of GetAllBalances.

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) DistributeFromCommunityPool

func (m *MockPoolKeeper) DistributeFromCommunityPool(ctx context.Context, amount types0.Coins, receiveAddr types0.AccAddress) error

DistributeFromCommunityPool mocks base method.

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 types0.Coins, sender types0.AccAddress) error

FundCommunityPool mocks base method.

func (*MockPoolKeeper) GetCommunityPool

func (m *MockPoolKeeper) GetCommunityPool(ctx context.Context) (types0.Coins, error)

GetCommunityPool mocks base method.

func (*MockPoolKeeper) SetToDistribute

func (m *MockPoolKeeper) SetToDistribute(ctx context.Context, amount types0.Coins, addr string) error

SetToDistribute mocks base method.

type MockPoolKeeperMockRecorder

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

MockPoolKeeperMockRecorder is the mock recorder for MockPoolKeeper.

func (*MockPoolKeeperMockRecorder) DistributeFromCommunityPool

func (mr *MockPoolKeeperMockRecorder) DistributeFromCommunityPool(ctx, amount, receiveAddr interface{}) *gomock.Call

DistributeFromCommunityPool indicates an expected call of DistributeFromCommunityPool.

func (*MockPoolKeeperMockRecorder) FundCommunityPool

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

FundCommunityPool indicates an expected call of FundCommunityPool.

func (*MockPoolKeeperMockRecorder) GetCommunityPool

func (mr *MockPoolKeeperMockRecorder) GetCommunityPool(ctx interface{}) *gomock.Call

GetCommunityPool indicates an expected call of GetCommunityPool.

func (*MockPoolKeeperMockRecorder) SetToDistribute

func (mr *MockPoolKeeperMockRecorder) SetToDistribute(ctx, amount, addr interface{}) *gomock.Call

SetToDistribute indicates an expected call of SetToDistribute.

type MockStakingHooks

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

MockStakingHooks is a mock of StakingHooks interface.

func NewMockStakingHooks

func NewMockStakingHooks(ctrl *gomock.Controller) *MockStakingHooks

NewMockStakingHooks creates a new mock instance.

func (*MockStakingHooks) AfterDelegationModified

func (m *MockStakingHooks) AfterDelegationModified(ctx context.Context, delAddr types0.AccAddress, valAddr types0.ValAddress) error

AfterDelegationModified mocks base method.

func (*MockStakingHooks) AfterValidatorCreated

func (m *MockStakingHooks) AfterValidatorCreated(ctx context.Context, valAddr types0.ValAddress) error

AfterValidatorCreated mocks base method.

func (*MockStakingHooks) EXPECT

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

type MockStakingHooksMockRecorder

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

MockStakingHooksMockRecorder is the mock recorder for MockStakingHooks.

func (*MockStakingHooksMockRecorder) AfterDelegationModified

func (mr *MockStakingHooksMockRecorder) AfterDelegationModified(ctx, delAddr, valAddr interface{}) *gomock.Call

AfterDelegationModified indicates an expected call of AfterDelegationModified.

func (*MockStakingHooksMockRecorder) AfterValidatorCreated

func (mr *MockStakingHooksMockRecorder) AfterValidatorCreated(ctx, valAddr interface{}) *gomock.Call

AfterValidatorCreated indicates an expected call of AfterValidatorCreated.

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) ConsensusAddressCodec

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

ConsensusAddressCodec mocks base method.

func (*MockStakingKeeper) Delegation

Delegation mocks base method.

func (*MockStakingKeeper) EXPECT

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

func (*MockStakingKeeper) GetAllDelegatorDelegations

func (m *MockStakingKeeper) GetAllDelegatorDelegations(ctx context.Context, delegator types0.AccAddress) ([]types.Delegation, error)

GetAllDelegatorDelegations mocks base method.

func (*MockStakingKeeper) GetAllSDKDelegations

func (m *MockStakingKeeper) GetAllSDKDelegations(ctx context.Context) ([]types.Delegation, error)

GetAllSDKDelegations mocks base method.

func (*MockStakingKeeper) GetAllValidators

func (m *MockStakingKeeper) GetAllValidators(ctx context.Context) ([]types.Validator, error)

GetAllValidators mocks base method.

func (*MockStakingKeeper) IterateDelegations

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

IterateDelegations mocks base method.

func (*MockStakingKeeper) IterateValidators

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

IterateValidators mocks base method.

func (*MockStakingKeeper) Validator

Validator mocks base method.

func (*MockStakingKeeper) ValidatorAddressCodec

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

ValidatorAddressCodec mocks base method.

func (*MockStakingKeeper) ValidatorByConsAddr

func (m *MockStakingKeeper) ValidatorByConsAddr(arg0 context.Context, arg1 types0.ConsAddress) (types0.ValidatorI, error)

ValidatorByConsAddr 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) ConsensusAddressCodec

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

ConsensusAddressCodec indicates an expected call of ConsensusAddressCodec.

func (*MockStakingKeeperMockRecorder) Delegation

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

Delegation indicates an expected call of Delegation.

func (*MockStakingKeeperMockRecorder) GetAllDelegatorDelegations

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

GetAllDelegatorDelegations indicates an expected call of GetAllDelegatorDelegations.

func (*MockStakingKeeperMockRecorder) GetAllSDKDelegations

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

GetAllSDKDelegations indicates an expected call of GetAllSDKDelegations.

func (*MockStakingKeeperMockRecorder) GetAllValidators

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

GetAllValidators indicates an expected call of GetAllValidators.

func (*MockStakingKeeperMockRecorder) IterateDelegations

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

IterateDelegations indicates an expected call of IterateDelegations.

func (*MockStakingKeeperMockRecorder) IterateValidators

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

IterateValidators indicates an expected call of IterateValidators.

func (*MockStakingKeeperMockRecorder) Validator

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

Validator indicates an expected call of Validator.

func (*MockStakingKeeperMockRecorder) ValidatorAddressCodec

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

ValidatorAddressCodec indicates an expected call of ValidatorAddressCodec.

func (*MockStakingKeeperMockRecorder) ValidatorByConsAddr

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

ValidatorByConsAddr indicates an expected call of ValidatorByConsAddr.

Jump to

Keyboard shortcuts

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