Documentation ¶
Index ¶
- type BankKeeperMock
- type StakingKeeperMock
- func (mock *StakingKeeperMock) BondDenom(ctx github_com_cosmos_cosmos_sdk_types.Context) string
- func (mock *StakingKeeperMock) BondDenomCalls() []struct{ ... }
- func (mock *StakingKeeperMock) GetLastTotalPower(ctx github_com_cosmos_cosmos_sdk_types.Context) github_com_cosmos_cosmos_sdk_types.Int
- func (mock *StakingKeeperMock) GetLastTotalPowerCalls() []struct{ ... }
- func (mock *StakingKeeperMock) IterateBondedValidatorsByPower(ctx github_com_cosmos_cosmos_sdk_types.Context, ...)
- func (mock *StakingKeeperMock) IterateBondedValidatorsByPowerCalls() []struct{ ... }
- func (mock *StakingKeeperMock) PowerReduction(ctx github_com_cosmos_cosmos_sdk_types.Context) github_com_cosmos_cosmos_sdk_types.Int
- func (mock *StakingKeeperMock) PowerReductionCalls() []struct{ ... }
- func (mock *StakingKeeperMock) Validator(ctx github_com_cosmos_cosmos_sdk_types.Context, ...) stakingtypes.ValidatorI
- func (mock *StakingKeeperMock) ValidatorCalls() []struct{ ... }
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BankKeeperMock ¶
type BankKeeperMock struct { // GetBalanceFunc mocks the GetBalance method. GetBalanceFunc func(ctx github_com_cosmos_cosmos_sdk_types.Context, addr github_com_cosmos_cosmos_sdk_types.AccAddress, denom string) github_com_cosmos_cosmos_sdk_types.Coin // contains filtered or unexported fields }
BankKeeperMock is a mock implementation of types.BankKeeper.
func TestSomethingThatUsesBankKeeper(t *testing.T) { // make and configure a mocked types.BankKeeper mockedBankKeeper := &BankKeeperMock{ GetBalanceFunc: func(ctx github_com_cosmos_cosmos_sdk_types.Context, addr github_com_cosmos_cosmos_sdk_types.AccAddress, denom string) github_com_cosmos_cosmos_sdk_types.Coin { panic("mock out the GetBalance method") }, } // use mockedBankKeeper in code that requires types.BankKeeper // and then make assertions. }
func (*BankKeeperMock) GetBalance ¶
func (mock *BankKeeperMock) GetBalance(ctx github_com_cosmos_cosmos_sdk_types.Context, addr github_com_cosmos_cosmos_sdk_types.AccAddress, denom string) github_com_cosmos_cosmos_sdk_types.Coin
GetBalance calls GetBalanceFunc.
func (*BankKeeperMock) GetBalanceCalls ¶
func (mock *BankKeeperMock) GetBalanceCalls() []struct { Ctx github_com_cosmos_cosmos_sdk_types.Context Addr github_com_cosmos_cosmos_sdk_types.AccAddress Denom string }
GetBalanceCalls gets all the calls that were made to GetBalance. Check the length with:
len(mockedBankKeeper.GetBalanceCalls())
type StakingKeeperMock ¶
type StakingKeeperMock struct { // BondDenomFunc mocks the BondDenom method. BondDenomFunc func(ctx github_com_cosmos_cosmos_sdk_types.Context) string // GetLastTotalPowerFunc mocks the GetLastTotalPower method. GetLastTotalPowerFunc func(ctx github_com_cosmos_cosmos_sdk_types.Context) github_com_cosmos_cosmos_sdk_types.Int // IterateBondedValidatorsByPowerFunc mocks the IterateBondedValidatorsByPower method. IterateBondedValidatorsByPowerFunc func(ctx github_com_cosmos_cosmos_sdk_types.Context, fn func(index int64, validator stakingtypes.ValidatorI) (stop bool)) // PowerReductionFunc mocks the PowerReduction method. PowerReductionFunc func(ctx github_com_cosmos_cosmos_sdk_types.Context) github_com_cosmos_cosmos_sdk_types.Int // ValidatorFunc mocks the Validator method. ValidatorFunc func(ctx github_com_cosmos_cosmos_sdk_types.Context, addr github_com_cosmos_cosmos_sdk_types.ValAddress) stakingtypes.ValidatorI // contains filtered or unexported fields }
StakingKeeperMock is a mock implementation of types.StakingKeeper.
func TestSomethingThatUsesStakingKeeper(t *testing.T) { // make and configure a mocked types.StakingKeeper mockedStakingKeeper := &StakingKeeperMock{ BondDenomFunc: func(ctx github_com_cosmos_cosmos_sdk_types.Context) string { panic("mock out the BondDenom method") }, GetLastTotalPowerFunc: func(ctx github_com_cosmos_cosmos_sdk_types.Context) github_com_cosmos_cosmos_sdk_types.Int { panic("mock out the GetLastTotalPower method") }, IterateBondedValidatorsByPowerFunc: func(ctx github_com_cosmos_cosmos_sdk_types.Context, fn func(index int64, validator stakingtypes.ValidatorI) (stop bool)) { panic("mock out the IterateBondedValidatorsByPower method") }, PowerReductionFunc: func(ctx github_com_cosmos_cosmos_sdk_types.Context) github_com_cosmos_cosmos_sdk_types.Int { panic("mock out the PowerReduction method") }, ValidatorFunc: func(ctx github_com_cosmos_cosmos_sdk_types.Context, addr github_com_cosmos_cosmos_sdk_types.ValAddress) stakingtypes.ValidatorI { panic("mock out the Validator method") }, } // use mockedStakingKeeper in code that requires types.StakingKeeper // and then make assertions. }
func (*StakingKeeperMock) BondDenom ¶
func (mock *StakingKeeperMock) BondDenom(ctx github_com_cosmos_cosmos_sdk_types.Context) string
BondDenom calls BondDenomFunc.
func (*StakingKeeperMock) BondDenomCalls ¶
func (mock *StakingKeeperMock) BondDenomCalls() []struct { Ctx github_com_cosmos_cosmos_sdk_types.Context }
BondDenomCalls gets all the calls that were made to BondDenom. Check the length with:
len(mockedStakingKeeper.BondDenomCalls())
func (*StakingKeeperMock) GetLastTotalPower ¶
func (mock *StakingKeeperMock) GetLastTotalPower(ctx github_com_cosmos_cosmos_sdk_types.Context) github_com_cosmos_cosmos_sdk_types.Int
GetLastTotalPower calls GetLastTotalPowerFunc.
func (*StakingKeeperMock) GetLastTotalPowerCalls ¶
func (mock *StakingKeeperMock) GetLastTotalPowerCalls() []struct { Ctx github_com_cosmos_cosmos_sdk_types.Context }
GetLastTotalPowerCalls gets all the calls that were made to GetLastTotalPower. Check the length with:
len(mockedStakingKeeper.GetLastTotalPowerCalls())
func (*StakingKeeperMock) IterateBondedValidatorsByPower ¶
func (mock *StakingKeeperMock) IterateBondedValidatorsByPower(ctx github_com_cosmos_cosmos_sdk_types.Context, fn func(index int64, validator stakingtypes.ValidatorI) (stop bool))
IterateBondedValidatorsByPower calls IterateBondedValidatorsByPowerFunc.
func (*StakingKeeperMock) IterateBondedValidatorsByPowerCalls ¶
func (mock *StakingKeeperMock) IterateBondedValidatorsByPowerCalls() []struct { Ctx github_com_cosmos_cosmos_sdk_types.Context Fn func(index int64, validator stakingtypes.ValidatorI) (stop bool) }
IterateBondedValidatorsByPowerCalls gets all the calls that were made to IterateBondedValidatorsByPower. Check the length with:
len(mockedStakingKeeper.IterateBondedValidatorsByPowerCalls())
func (*StakingKeeperMock) PowerReduction ¶
func (mock *StakingKeeperMock) PowerReduction(ctx github_com_cosmos_cosmos_sdk_types.Context) github_com_cosmos_cosmos_sdk_types.Int
PowerReduction calls PowerReductionFunc.
func (*StakingKeeperMock) PowerReductionCalls ¶
func (mock *StakingKeeperMock) PowerReductionCalls() []struct { Ctx github_com_cosmos_cosmos_sdk_types.Context }
PowerReductionCalls gets all the calls that were made to PowerReduction. Check the length with:
len(mockedStakingKeeper.PowerReductionCalls())
func (*StakingKeeperMock) Validator ¶
func (mock *StakingKeeperMock) Validator(ctx github_com_cosmos_cosmos_sdk_types.Context, addr github_com_cosmos_cosmos_sdk_types.ValAddress) stakingtypes.ValidatorI
Validator calls ValidatorFunc.
func (*StakingKeeperMock) ValidatorCalls ¶
func (mock *StakingKeeperMock) ValidatorCalls() []struct { Ctx github_com_cosmos_cosmos_sdk_types.Context Addr github_com_cosmos_cosmos_sdk_types.ValAddress }
ValidatorCalls gets all the calls that were made to Validator. Check the length with:
len(mockedStakingKeeper.ValidatorCalls())