Documentation ¶
Index ¶
- type RewardPoolMock
- func (mock *RewardPoolMock) AddReward(valAddress sdk.ValAddress, coin sdk.Coin)
- func (mock *RewardPoolMock) AddRewardCalls() []struct{ ... }
- func (mock *RewardPoolMock) ClearRewards(valAddress sdk.ValAddress)
- func (mock *RewardPoolMock) ClearRewardsCalls() []struct{ ... }
- func (mock *RewardPoolMock) ReleaseRewards(valAddress sdk.ValAddress) error
- func (mock *RewardPoolMock) ReleaseRewardsCalls() []struct{ ... }
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RewardPoolMock ¶
type RewardPoolMock struct { // AddRewardFunc mocks the AddReward method. AddRewardFunc func(valAddress sdk.ValAddress, coin sdk.Coin) // ClearRewardsFunc mocks the ClearRewards method. ClearRewardsFunc func(valAddress sdk.ValAddress) // ReleaseRewardsFunc mocks the ReleaseRewards method. ReleaseRewardsFunc func(valAddress sdk.ValAddress) error // contains filtered or unexported fields }
RewardPoolMock is a mock implementation of exported.RewardPool.
func TestSomethingThatUsesRewardPool(t *testing.T) { // make and configure a mocked exported.RewardPool mockedRewardPool := &RewardPoolMock{ AddRewardFunc: func(valAddress sdk.ValAddress, coin sdk.Coin) { panic("mock out the AddReward method") }, ClearRewardsFunc: func(valAddress sdk.ValAddress) { panic("mock out the ClearRewards method") }, ReleaseRewardsFunc: func(valAddress sdk.ValAddress) error { panic("mock out the ReleaseRewards method") }, } // use mockedRewardPool in code that requires exported.RewardPool // and then make assertions. }
func (*RewardPoolMock) AddReward ¶
func (mock *RewardPoolMock) AddReward(valAddress sdk.ValAddress, coin sdk.Coin)
AddReward calls AddRewardFunc.
func (*RewardPoolMock) AddRewardCalls ¶
func (mock *RewardPoolMock) AddRewardCalls() []struct { ValAddress sdk.ValAddress Coin sdk.Coin }
AddRewardCalls gets all the calls that were made to AddReward. Check the length with:
len(mockedRewardPool.AddRewardCalls())
func (*RewardPoolMock) ClearRewards ¶
func (mock *RewardPoolMock) ClearRewards(valAddress sdk.ValAddress)
ClearRewards calls ClearRewardsFunc.
func (*RewardPoolMock) ClearRewardsCalls ¶
func (mock *RewardPoolMock) ClearRewardsCalls() []struct { ValAddress sdk.ValAddress }
ClearRewardsCalls gets all the calls that were made to ClearRewards. Check the length with:
len(mockedRewardPool.ClearRewardsCalls())
func (*RewardPoolMock) ReleaseRewards ¶
func (mock *RewardPoolMock) ReleaseRewards(valAddress sdk.ValAddress) error
ReleaseRewards calls ReleaseRewardsFunc.
func (*RewardPoolMock) ReleaseRewardsCalls ¶
func (mock *RewardPoolMock) ReleaseRewardsCalls() []struct { ValAddress sdk.ValAddress }
ReleaseRewardsCalls gets all the calls that were made to ReleaseRewards. Check the length with:
len(mockedRewardPool.ReleaseRewardsCalls())
Click to show internal directories.
Click to hide internal directories.