Documentation
¶
Index ¶
- type RewarderMock
- type SnapshotterMock
- type StakingKeeperMock
- func (mock *StakingKeeperMock) GetLastTotalPower(context github_com_cosmos_cosmos_sdk_types.Context) github_com_cosmos_cosmos_sdk_types.Int
- func (mock *StakingKeeperMock) GetLastTotalPowerCalls() []struct{ ... }
- func (mock *StakingKeeperMock) PowerReduction(context 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{ ... }
- type StoreMock
- func (mock *StoreMock) DeletePoll()
- func (mock *StoreMock) DeletePollCalls() []struct{}
- func (mock *StoreMock) GetPoll(key exported.PollKey) exported.Poll
- func (mock *StoreMock) GetPollCalls() []struct{ ... }
- func (mock *StoreMock) GetVote(hash string) (types.TalliedVote, bool)
- func (mock *StoreMock) GetVoteCalls() []struct{ ... }
- func (mock *StoreMock) GetVotes() []types.TalliedVote
- func (mock *StoreMock) GetVotesCalls() []struct{}
- func (mock *StoreMock) HasVoted(voter github_com_cosmos_cosmos_sdk_types.ValAddress) bool
- func (mock *StoreMock) HasVotedCalls() []struct{ ... }
- func (mock *StoreMock) SetMetadata(metadata exported.PollMetadata)
- func (mock *StoreMock) SetMetadataCalls() []struct{ ... }
- func (mock *StoreMock) SetVote(voter github_com_cosmos_cosmos_sdk_types.ValAddress, vote types.TalliedVote)
- func (mock *StoreMock) SetVoteCalls() []struct{ ... }
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RewarderMock ¶
type RewarderMock struct { // GetPoolFunc mocks the GetPool method. GetPoolFunc func(ctx github_com_cosmos_cosmos_sdk_types.Context, name string) reward.RewardPool // contains filtered or unexported fields }
RewarderMock is a mock implementation of types.Rewarder.
func TestSomethingThatUsesRewarder(t *testing.T) { // make and configure a mocked types.Rewarder mockedRewarder := &RewarderMock{ GetPoolFunc: func(ctx github_com_cosmos_cosmos_sdk_types.Context, name string) reward.RewardPool { panic("mock out the GetPool method") }, } // use mockedRewarder in code that requires types.Rewarder // and then make assertions. }
func (*RewarderMock) GetPool ¶
func (mock *RewarderMock) GetPool(ctx github_com_cosmos_cosmos_sdk_types.Context, name string) reward.RewardPool
GetPool calls GetPoolFunc.
func (*RewarderMock) GetPoolCalls ¶
func (mock *RewarderMock) GetPoolCalls() []struct { Ctx github_com_cosmos_cosmos_sdk_types.Context Name string }
GetPoolCalls gets all the calls that were made to GetPool. Check the length with:
len(mockedRewarder.GetPoolCalls())
type SnapshotterMock ¶
type SnapshotterMock struct { // GetSnapshotFunc mocks the GetSnapshot method. GetSnapshotFunc func(context github_com_cosmos_cosmos_sdk_types.Context, n int64) (snapshot.Snapshot, bool) // contains filtered or unexported fields }
SnapshotterMock is a mock implementation of types.Snapshotter.
func TestSomethingThatUsesSnapshotter(t *testing.T) { // make and configure a mocked types.Snapshotter mockedSnapshotter := &SnapshotterMock{ GetSnapshotFunc: func(context github_com_cosmos_cosmos_sdk_types.Context, n int64) (snapshot.Snapshot, bool) { panic("mock out the GetSnapshot method") }, } // use mockedSnapshotter in code that requires types.Snapshotter // and then make assertions. }
func (*SnapshotterMock) GetSnapshot ¶
func (mock *SnapshotterMock) GetSnapshot(context github_com_cosmos_cosmos_sdk_types.Context, n int64) (snapshot.Snapshot, bool)
GetSnapshot calls GetSnapshotFunc.
func (*SnapshotterMock) GetSnapshotCalls ¶
func (mock *SnapshotterMock) GetSnapshotCalls() []struct { Context github_com_cosmos_cosmos_sdk_types.Context N int64 }
GetSnapshotCalls gets all the calls that were made to GetSnapshot. Check the length with:
len(mockedSnapshotter.GetSnapshotCalls())
type StakingKeeperMock ¶
type StakingKeeperMock struct { // GetLastTotalPowerFunc mocks the GetLastTotalPower method. GetLastTotalPowerFunc func(context github_com_cosmos_cosmos_sdk_types.Context) github_com_cosmos_cosmos_sdk_types.Int // PowerReductionFunc mocks the PowerReduction method. PowerReductionFunc func(context 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{ GetLastTotalPowerFunc: func(context github_com_cosmos_cosmos_sdk_types.Context) github_com_cosmos_cosmos_sdk_types.Int { panic("mock out the GetLastTotalPower method") }, PowerReductionFunc: func(context 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) GetLastTotalPower ¶
func (mock *StakingKeeperMock) GetLastTotalPower(context 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 { Context 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) PowerReduction ¶
func (mock *StakingKeeperMock) PowerReduction(context 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 { Context 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())
type StoreMock ¶
type StoreMock struct { // DeletePollFunc mocks the DeletePoll method. DeletePollFunc func() // GetPollFunc mocks the GetPoll method. GetPollFunc func(key exported.PollKey) exported.Poll // GetVoteFunc mocks the GetVote method. GetVoteFunc func(hash string) (types.TalliedVote, bool) // GetVotesFunc mocks the GetVotes method. GetVotesFunc func() []types.TalliedVote // HasVotedFunc mocks the HasVoted method. HasVotedFunc func(voter github_com_cosmos_cosmos_sdk_types.ValAddress) bool // SetMetadataFunc mocks the SetMetadata method. SetMetadataFunc func(metadata exported.PollMetadata) // SetVoteFunc mocks the SetVote method. SetVoteFunc func(voter github_com_cosmos_cosmos_sdk_types.ValAddress, vote types.TalliedVote) // contains filtered or unexported fields }
StoreMock is a mock implementation of types.Store.
func TestSomethingThatUsesStore(t *testing.T) { // make and configure a mocked types.Store mockedStore := &StoreMock{ DeletePollFunc: func() { panic("mock out the DeletePoll method") }, GetPollFunc: func(key exported.PollKey) exported.Poll { panic("mock out the GetPoll method") }, GetVoteFunc: func(hash string) (types.TalliedVote, bool) { panic("mock out the GetVote method") }, GetVotesFunc: func() []types.TalliedVote { panic("mock out the GetVotes method") }, HasVotedFunc: func(voter github_com_cosmos_cosmos_sdk_types.ValAddress) bool { panic("mock out the HasVoted method") }, SetMetadataFunc: func(metadata exported.PollMetadata) { panic("mock out the SetMetadata method") }, SetVoteFunc: func(voter github_com_cosmos_cosmos_sdk_types.ValAddress, vote types.TalliedVote) { panic("mock out the SetVote method") }, } // use mockedStore in code that requires types.Store // and then make assertions. }
func (*StoreMock) DeletePollCalls ¶
func (mock *StoreMock) DeletePollCalls() []struct { }
DeletePollCalls gets all the calls that were made to DeletePoll. Check the length with:
len(mockedStore.DeletePollCalls())
func (*StoreMock) GetPollCalls ¶
GetPollCalls gets all the calls that were made to GetPoll. Check the length with:
len(mockedStore.GetPollCalls())
func (*StoreMock) GetVote ¶
func (mock *StoreMock) GetVote(hash string) (types.TalliedVote, bool)
GetVote calls GetVoteFunc.
func (*StoreMock) GetVoteCalls ¶
GetVoteCalls gets all the calls that were made to GetVote. Check the length with:
len(mockedStore.GetVoteCalls())
func (*StoreMock) GetVotes ¶
func (mock *StoreMock) GetVotes() []types.TalliedVote
GetVotes calls GetVotesFunc.
func (*StoreMock) GetVotesCalls ¶
func (mock *StoreMock) GetVotesCalls() []struct { }
GetVotesCalls gets all the calls that were made to GetVotes. Check the length with:
len(mockedStore.GetVotesCalls())
func (*StoreMock) HasVoted ¶
func (mock *StoreMock) HasVoted(voter github_com_cosmos_cosmos_sdk_types.ValAddress) bool
HasVoted calls HasVotedFunc.
func (*StoreMock) HasVotedCalls ¶
func (mock *StoreMock) HasVotedCalls() []struct { Voter github_com_cosmos_cosmos_sdk_types.ValAddress }
HasVotedCalls gets all the calls that were made to HasVoted. Check the length with:
len(mockedStore.HasVotedCalls())
func (*StoreMock) SetMetadata ¶
func (mock *StoreMock) SetMetadata(metadata exported.PollMetadata)
SetMetadata calls SetMetadataFunc.
func (*StoreMock) SetMetadataCalls ¶
func (mock *StoreMock) SetMetadataCalls() []struct { Metadata exported.PollMetadata }
SetMetadataCalls gets all the calls that were made to SetMetadata. Check the length with:
len(mockedStore.SetMetadataCalls())
func (*StoreMock) SetVote ¶
func (mock *StoreMock) SetVote(voter github_com_cosmos_cosmos_sdk_types.ValAddress, vote types.TalliedVote)
SetVote calls SetVoteFunc.
func (*StoreMock) SetVoteCalls ¶
func (mock *StoreMock) SetVoteCalls() []struct { Voter github_com_cosmos_cosmos_sdk_types.ValAddress Vote types.TalliedVote }
SetVoteCalls gets all the calls that were made to SetVote. Check the length with:
len(mockedStore.SetVoteCalls())