Documentation ¶
Index ¶
- type BankKeeperMock
- type SlasherMock
- func (mock *SlasherMock) GetValidatorMissedBlockBitArray(ctx github_com_cosmos_cosmos_sdk_types.Context, ...) bool
- func (mock *SlasherMock) GetValidatorMissedBlockBitArrayCalls() []struct{ ... }
- func (mock *SlasherMock) GetValidatorSigningInfo(ctx github_com_cosmos_cosmos_sdk_types.Context, ...) (slashingtypes.ValidatorSigningInfo, bool)
- func (mock *SlasherMock) GetValidatorSigningInfoCalls() []struct{ ... }
- func (mock *SlasherMock) SignedBlocksWindow(ctx github_com_cosmos_cosmos_sdk_types.Context) int64
- func (mock *SlasherMock) SignedBlocksWindowCalls() []struct{ ... }
- 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 { // SpendableBalanceFunc mocks the SpendableBalance method. SpendableBalanceFunc func(ctx github_com_cosmos_cosmos_sdk_types.Context, address 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 snapshottypes.BankKeeper.
func TestSomethingThatUsesBankKeeper(t *testing.T) { // make and configure a mocked snapshottypes.BankKeeper mockedBankKeeper := &BankKeeperMock{ SpendableBalanceFunc: func(ctx github_com_cosmos_cosmos_sdk_types.Context, address github_com_cosmos_cosmos_sdk_types.AccAddress, denom string) github_com_cosmos_cosmos_sdk_types.Coin { panic("mock out the SpendableBalance method") }, } // use mockedBankKeeper in code that requires snapshottypes.BankKeeper // and then make assertions. }
func (*BankKeeperMock) SpendableBalance ¶ added in v0.34.0
func (mock *BankKeeperMock) SpendableBalance(ctx github_com_cosmos_cosmos_sdk_types.Context, address github_com_cosmos_cosmos_sdk_types.AccAddress, denom string) github_com_cosmos_cosmos_sdk_types.Coin
SpendableBalance calls SpendableBalanceFunc.
func (*BankKeeperMock) SpendableBalanceCalls ¶ added in v0.34.0
func (mock *BankKeeperMock) SpendableBalanceCalls() []struct { Ctx github_com_cosmos_cosmos_sdk_types.Context Address github_com_cosmos_cosmos_sdk_types.AccAddress Denom string }
SpendableBalanceCalls gets all the calls that were made to SpendableBalance. Check the length with:
len(mockedBankKeeper.SpendableBalanceCalls())
type SlasherMock ¶ added in v0.21.0
type SlasherMock struct { // GetValidatorMissedBlockBitArrayFunc mocks the GetValidatorMissedBlockBitArray method. GetValidatorMissedBlockBitArrayFunc func(ctx github_com_cosmos_cosmos_sdk_types.Context, address github_com_cosmos_cosmos_sdk_types.ConsAddress, index int64) bool // GetValidatorSigningInfoFunc mocks the GetValidatorSigningInfo method. GetValidatorSigningInfoFunc func(ctx github_com_cosmos_cosmos_sdk_types.Context, address github_com_cosmos_cosmos_sdk_types.ConsAddress) (slashingtypes.ValidatorSigningInfo, bool) // SignedBlocksWindowFunc mocks the SignedBlocksWindow method. SignedBlocksWindowFunc func(ctx github_com_cosmos_cosmos_sdk_types.Context) int64 // contains filtered or unexported fields }
SlasherMock is a mock implementation of snapshottypes.Slasher.
func TestSomethingThatUsesSlasher(t *testing.T) { // make and configure a mocked snapshottypes.Slasher mockedSlasher := &SlasherMock{ GetValidatorMissedBlockBitArrayFunc: func(ctx github_com_cosmos_cosmos_sdk_types.Context, address github_com_cosmos_cosmos_sdk_types.ConsAddress, index int64) bool { panic("mock out the GetValidatorMissedBlockBitArray method") }, GetValidatorSigningInfoFunc: func(ctx github_com_cosmos_cosmos_sdk_types.Context, address github_com_cosmos_cosmos_sdk_types.ConsAddress) (slashingtypes.ValidatorSigningInfo, bool) { panic("mock out the GetValidatorSigningInfo method") }, SignedBlocksWindowFunc: func(ctx github_com_cosmos_cosmos_sdk_types.Context) int64 { panic("mock out the SignedBlocksWindow method") }, } // use mockedSlasher in code that requires snapshottypes.Slasher // and then make assertions. }
func (*SlasherMock) GetValidatorMissedBlockBitArray ¶ added in v0.21.0
func (mock *SlasherMock) GetValidatorMissedBlockBitArray(ctx github_com_cosmos_cosmos_sdk_types.Context, address github_com_cosmos_cosmos_sdk_types.ConsAddress, index int64) bool
GetValidatorMissedBlockBitArray calls GetValidatorMissedBlockBitArrayFunc.
func (*SlasherMock) GetValidatorMissedBlockBitArrayCalls ¶ added in v0.21.0
func (mock *SlasherMock) GetValidatorMissedBlockBitArrayCalls() []struct { Ctx github_com_cosmos_cosmos_sdk_types.Context Address github_com_cosmos_cosmos_sdk_types.ConsAddress Index int64 }
GetValidatorMissedBlockBitArrayCalls gets all the calls that were made to GetValidatorMissedBlockBitArray. Check the length with:
len(mockedSlasher.GetValidatorMissedBlockBitArrayCalls())
func (*SlasherMock) GetValidatorSigningInfo ¶ added in v0.21.0
func (mock *SlasherMock) GetValidatorSigningInfo(ctx github_com_cosmos_cosmos_sdk_types.Context, address github_com_cosmos_cosmos_sdk_types.ConsAddress) (slashingtypes.ValidatorSigningInfo, bool)
GetValidatorSigningInfo calls GetValidatorSigningInfoFunc.
func (*SlasherMock) GetValidatorSigningInfoCalls ¶ added in v0.21.0
func (mock *SlasherMock) GetValidatorSigningInfoCalls() []struct { Ctx github_com_cosmos_cosmos_sdk_types.Context Address github_com_cosmos_cosmos_sdk_types.ConsAddress }
GetValidatorSigningInfoCalls gets all the calls that were made to GetValidatorSigningInfo. Check the length with:
len(mockedSlasher.GetValidatorSigningInfoCalls())
func (*SlasherMock) SignedBlocksWindow ¶ added in v0.21.0
func (mock *SlasherMock) SignedBlocksWindow(ctx github_com_cosmos_cosmos_sdk_types.Context) int64
SignedBlocksWindow calls SignedBlocksWindowFunc.
func (*SlasherMock) SignedBlocksWindowCalls ¶ added in v0.21.0
func (mock *SlasherMock) SignedBlocksWindowCalls() []struct { Ctx github_com_cosmos_cosmos_sdk_types.Context }
SignedBlocksWindowCalls gets all the calls that were made to SignedBlocksWindow. Check the length with:
len(mockedSlasher.SignedBlocksWindowCalls())
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 snapshottypes.StakingKeeper.
func TestSomethingThatUsesStakingKeeper(t *testing.T) { // make and configure a mocked snapshottypes.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 snapshottypes.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())