Documentation ¶
Index ¶
- type PollMock
- func (mock *PollMock) AllowOverride()
- func (mock *PollMock) AllowOverrideCalls() []struct{}
- func (mock *PollMock) Delete() error
- func (mock *PollMock) DeleteCalls() []struct{}
- func (mock *PollMock) GetKey() exported.PollKey
- func (mock *PollMock) GetKeyCalls() []struct{}
- func (mock *PollMock) GetResult() codec.ProtoMarshaler
- func (mock *PollMock) GetResultCalls() []struct{}
- func (mock *PollMock) GetRewardPoolName() (string, bool)
- func (mock *PollMock) GetRewardPoolNameCalls() []struct{}
- func (mock *PollMock) GetTotalVotingPower() github_com_cosmos_cosmos_sdk_types.Int
- func (mock *PollMock) GetTotalVotingPowerCalls() []struct{}
- func (mock *PollMock) GetVoters() []exported.Voter
- func (mock *PollMock) GetVotersCalls() []struct{}
- func (mock *PollMock) HasVoted(voter github_com_cosmos_cosmos_sdk_types.ValAddress) bool
- func (mock *PollMock) HasVotedCalls() []struct{ ... }
- func (mock *PollMock) HasVotedCorrectly(voter github_com_cosmos_cosmos_sdk_types.ValAddress) bool
- func (mock *PollMock) HasVotedCorrectlyCalls() []struct{ ... }
- func (mock *PollMock) HasVotedLate(voter github_com_cosmos_cosmos_sdk_types.ValAddress) bool
- func (mock *PollMock) HasVotedLateCalls() []struct{ ... }
- func (mock *PollMock) Is(state exported.PollState) bool
- func (mock *PollMock) IsCalls() []struct{ ... }
- func (mock *PollMock) SetExpired()
- func (mock *PollMock) SetExpiredCalls() []struct{}
- func (mock *PollMock) Vote(voter github_com_cosmos_cosmos_sdk_types.ValAddress, blockHeight int64, ...) (codec.ProtoMarshaler, bool, error)
- func (mock *PollMock) VoteCalls() []struct{ ... }
- type VoteHandlerMock
- func (mock *VoteHandlerMock) HandleCompletedPoll(ctx github_com_cosmos_cosmos_sdk_types.Context, poll exported.Poll) error
- func (mock *VoteHandlerMock) HandleCompletedPollCalls() []struct{ ... }
- func (mock *VoteHandlerMock) HandleExpiredPoll(ctx github_com_cosmos_cosmos_sdk_types.Context, poll exported.Poll) error
- func (mock *VoteHandlerMock) HandleExpiredPollCalls() []struct{ ... }
- func (mock *VoteHandlerMock) HandleResult(ctx github_com_cosmos_cosmos_sdk_types.Context, result codec.ProtoMarshaler) error
- func (mock *VoteHandlerMock) HandleResultCalls() []struct{ ... }
- func (mock *VoteHandlerMock) IsFalsyResult(result codec.ProtoMarshaler) bool
- func (mock *VoteHandlerMock) IsFalsyResultCalls() []struct{ ... }
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PollMock ¶
type PollMock struct { // AllowOverrideFunc mocks the AllowOverride method. AllowOverrideFunc func() // DeleteFunc mocks the Delete method. DeleteFunc func() error // GetKeyFunc mocks the GetKey method. GetKeyFunc func() exported.PollKey // GetResultFunc mocks the GetResult method. GetResultFunc func() codec.ProtoMarshaler // GetRewardPoolNameFunc mocks the GetRewardPoolName method. GetRewardPoolNameFunc func() (string, bool) // GetTotalVotingPowerFunc mocks the GetTotalVotingPower method. GetTotalVotingPowerFunc func() github_com_cosmos_cosmos_sdk_types.Int // GetVotersFunc mocks the GetVoters method. GetVotersFunc func() []exported.Voter // HasVotedFunc mocks the HasVoted method. HasVotedFunc func(voter github_com_cosmos_cosmos_sdk_types.ValAddress) bool // HasVotedCorrectlyFunc mocks the HasVotedCorrectly method. HasVotedCorrectlyFunc func(voter github_com_cosmos_cosmos_sdk_types.ValAddress) bool // HasVotedLateFunc mocks the HasVotedLate method. HasVotedLateFunc func(voter github_com_cosmos_cosmos_sdk_types.ValAddress) bool // IsFunc mocks the Is method. IsFunc func(state exported.PollState) bool // SetExpiredFunc mocks the SetExpired method. SetExpiredFunc func() // VoteFunc mocks the Vote method. VoteFunc func(voter github_com_cosmos_cosmos_sdk_types.ValAddress, blockHeight int64, data codec.ProtoMarshaler) (codec.ProtoMarshaler, bool, error) // contains filtered or unexported fields }
PollMock is a mock implementation of exported.Poll.
func TestSomethingThatUsesPoll(t *testing.T) { // make and configure a mocked exported.Poll mockedPoll := &PollMock{ AllowOverrideFunc: func() { panic("mock out the AllowOverride method") }, DeleteFunc: func() error { panic("mock out the Delete method") }, GetKeyFunc: func() exported.PollKey { panic("mock out the GetKey method") }, GetResultFunc: func() codec.ProtoMarshaler { panic("mock out the GetResult method") }, GetRewardPoolNameFunc: func() (string, bool) { panic("mock out the GetRewardPoolName method") }, GetTotalVotingPowerFunc: func() github_com_cosmos_cosmos_sdk_types.Int { panic("mock out the GetTotalVotingPower method") }, GetVotersFunc: func() []exported.Voter { panic("mock out the GetVoters method") }, HasVotedFunc: func(voter github_com_cosmos_cosmos_sdk_types.ValAddress) bool { panic("mock out the HasVoted method") }, HasVotedCorrectlyFunc: func(voter github_com_cosmos_cosmos_sdk_types.ValAddress) bool { panic("mock out the HasVotedCorrectly method") }, HasVotedLateFunc: func(voter github_com_cosmos_cosmos_sdk_types.ValAddress) bool { panic("mock out the HasVotedLate method") }, IsFunc: func(state exported.PollState) bool { panic("mock out the Is method") }, SetExpiredFunc: func() { panic("mock out the SetExpired method") }, VoteFunc: func(voter github_com_cosmos_cosmos_sdk_types.ValAddress, blockHeight int64, data codec.ProtoMarshaler) (codec.ProtoMarshaler, bool, error) { panic("mock out the Vote method") }, } // use mockedPoll in code that requires exported.Poll // and then make assertions. }
func (*PollMock) AllowOverride ¶
func (mock *PollMock) AllowOverride()
AllowOverride calls AllowOverrideFunc.
func (*PollMock) AllowOverrideCalls ¶
func (mock *PollMock) AllowOverrideCalls() []struct { }
AllowOverrideCalls gets all the calls that were made to AllowOverride. Check the length with:
len(mockedPoll.AllowOverrideCalls())
func (*PollMock) DeleteCalls ¶
func (mock *PollMock) DeleteCalls() []struct { }
DeleteCalls gets all the calls that were made to Delete. Check the length with:
len(mockedPoll.DeleteCalls())
func (*PollMock) GetKeyCalls ¶
func (mock *PollMock) GetKeyCalls() []struct { }
GetKeyCalls gets all the calls that were made to GetKey. Check the length with:
len(mockedPoll.GetKeyCalls())
func (*PollMock) GetResult ¶
func (mock *PollMock) GetResult() codec.ProtoMarshaler
GetResult calls GetResultFunc.
func (*PollMock) GetResultCalls ¶
func (mock *PollMock) GetResultCalls() []struct { }
GetResultCalls gets all the calls that were made to GetResult. Check the length with:
len(mockedPoll.GetResultCalls())
func (*PollMock) GetRewardPoolName ¶ added in v0.18.0
GetRewardPoolName calls GetRewardPoolNameFunc.
func (*PollMock) GetRewardPoolNameCalls ¶ added in v0.18.0
func (mock *PollMock) GetRewardPoolNameCalls() []struct { }
GetRewardPoolNameCalls gets all the calls that were made to GetRewardPoolName. Check the length with:
len(mockedPoll.GetRewardPoolNameCalls())
func (*PollMock) GetTotalVotingPower ¶
func (mock *PollMock) GetTotalVotingPower() github_com_cosmos_cosmos_sdk_types.Int
GetTotalVotingPower calls GetTotalVotingPowerFunc.
func (*PollMock) GetTotalVotingPowerCalls ¶
func (mock *PollMock) GetTotalVotingPowerCalls() []struct { }
GetTotalVotingPowerCalls gets all the calls that were made to GetTotalVotingPower. Check the length with:
len(mockedPoll.GetTotalVotingPowerCalls())
func (*PollMock) GetVotersCalls ¶
func (mock *PollMock) GetVotersCalls() []struct { }
GetVotersCalls gets all the calls that were made to GetVoters. Check the length with:
len(mockedPoll.GetVotersCalls())
func (*PollMock) HasVoted ¶ added in v0.18.0
func (mock *PollMock) HasVoted(voter github_com_cosmos_cosmos_sdk_types.ValAddress) bool
HasVoted calls HasVotedFunc.
func (*PollMock) HasVotedCalls ¶ added in v0.18.0
func (mock *PollMock) 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(mockedPoll.HasVotedCalls())
func (*PollMock) HasVotedCorrectly ¶ added in v0.18.0
func (mock *PollMock) HasVotedCorrectly(voter github_com_cosmos_cosmos_sdk_types.ValAddress) bool
HasVotedCorrectly calls HasVotedCorrectlyFunc.
func (*PollMock) HasVotedCorrectlyCalls ¶ added in v0.18.0
func (mock *PollMock) HasVotedCorrectlyCalls() []struct { Voter github_com_cosmos_cosmos_sdk_types.ValAddress }
HasVotedCorrectlyCalls gets all the calls that were made to HasVotedCorrectly. Check the length with:
len(mockedPoll.HasVotedCorrectlyCalls())
func (*PollMock) HasVotedLate ¶ added in v0.18.0
func (mock *PollMock) HasVotedLate(voter github_com_cosmos_cosmos_sdk_types.ValAddress) bool
HasVotedLate calls HasVotedLateFunc.
func (*PollMock) HasVotedLateCalls ¶ added in v0.18.0
func (mock *PollMock) HasVotedLateCalls() []struct { Voter github_com_cosmos_cosmos_sdk_types.ValAddress }
HasVotedLateCalls gets all the calls that were made to HasVotedLate. Check the length with:
len(mockedPoll.HasVotedLateCalls())
func (*PollMock) IsCalls ¶
IsCalls gets all the calls that were made to Is. Check the length with:
len(mockedPoll.IsCalls())
func (*PollMock) SetExpired ¶ added in v0.18.0
func (mock *PollMock) SetExpired()
SetExpired calls SetExpiredFunc.
func (*PollMock) SetExpiredCalls ¶ added in v0.18.0
func (mock *PollMock) SetExpiredCalls() []struct { }
SetExpiredCalls gets all the calls that were made to SetExpired. Check the length with:
len(mockedPoll.SetExpiredCalls())
func (*PollMock) Vote ¶
func (mock *PollMock) Vote(voter github_com_cosmos_cosmos_sdk_types.ValAddress, blockHeight int64, data codec.ProtoMarshaler) (codec.ProtoMarshaler, bool, error)
Vote calls VoteFunc.
func (*PollMock) VoteCalls ¶
func (mock *PollMock) VoteCalls() []struct { Voter github_com_cosmos_cosmos_sdk_types.ValAddress BlockHeight int64 Data codec.ProtoMarshaler }
VoteCalls gets all the calls that were made to Vote. Check the length with:
len(mockedPoll.VoteCalls())
type VoteHandlerMock ¶ added in v0.18.0
type VoteHandlerMock struct { // HandleCompletedPollFunc mocks the HandleCompletedPoll method. HandleCompletedPollFunc func(ctx github_com_cosmos_cosmos_sdk_types.Context, poll exported.Poll) error // HandleExpiredPollFunc mocks the HandleExpiredPoll method. HandleExpiredPollFunc func(ctx github_com_cosmos_cosmos_sdk_types.Context, poll exported.Poll) error // HandleResultFunc mocks the HandleResult method. HandleResultFunc func(ctx github_com_cosmos_cosmos_sdk_types.Context, result codec.ProtoMarshaler) error // IsFalsyResultFunc mocks the IsFalsyResult method. IsFalsyResultFunc func(result codec.ProtoMarshaler) bool // contains filtered or unexported fields }
VoteHandlerMock is a mock implementation of exported.VoteHandler.
func TestSomethingThatUsesVoteHandler(t *testing.T) { // make and configure a mocked exported.VoteHandler mockedVoteHandler := &VoteHandlerMock{ HandleCompletedPollFunc: func(ctx github_com_cosmos_cosmos_sdk_types.Context, poll exported.Poll) error { panic("mock out the HandleCompletedPoll method") }, HandleExpiredPollFunc: func(ctx github_com_cosmos_cosmos_sdk_types.Context, poll exported.Poll) error { panic("mock out the HandleExpiredPoll method") }, HandleResultFunc: func(ctx github_com_cosmos_cosmos_sdk_types.Context, result codec.ProtoMarshaler) error { panic("mock out the HandleResult method") }, IsFalsyResultFunc: func(result codec.ProtoMarshaler) bool { panic("mock out the IsFalsyResult method") }, } // use mockedVoteHandler in code that requires exported.VoteHandler // and then make assertions. }
func (*VoteHandlerMock) HandleCompletedPoll ¶ added in v0.18.0
func (mock *VoteHandlerMock) HandleCompletedPoll(ctx github_com_cosmos_cosmos_sdk_types.Context, poll exported.Poll) error
HandleCompletedPoll calls HandleCompletedPollFunc.
func (*VoteHandlerMock) HandleCompletedPollCalls ¶ added in v0.18.0
func (mock *VoteHandlerMock) HandleCompletedPollCalls() []struct { Ctx github_com_cosmos_cosmos_sdk_types.Context Poll exported.Poll }
HandleCompletedPollCalls gets all the calls that were made to HandleCompletedPoll. Check the length with:
len(mockedVoteHandler.HandleCompletedPollCalls())
func (*VoteHandlerMock) HandleExpiredPoll ¶ added in v0.18.0
func (mock *VoteHandlerMock) HandleExpiredPoll(ctx github_com_cosmos_cosmos_sdk_types.Context, poll exported.Poll) error
HandleExpiredPoll calls HandleExpiredPollFunc.
func (*VoteHandlerMock) HandleExpiredPollCalls ¶ added in v0.18.0
func (mock *VoteHandlerMock) HandleExpiredPollCalls() []struct { Ctx github_com_cosmos_cosmos_sdk_types.Context Poll exported.Poll }
HandleExpiredPollCalls gets all the calls that were made to HandleExpiredPoll. Check the length with:
len(mockedVoteHandler.HandleExpiredPollCalls())
func (*VoteHandlerMock) HandleResult ¶ added in v0.18.0
func (mock *VoteHandlerMock) HandleResult(ctx github_com_cosmos_cosmos_sdk_types.Context, result codec.ProtoMarshaler) error
HandleResult calls HandleResultFunc.
func (*VoteHandlerMock) HandleResultCalls ¶ added in v0.18.0
func (mock *VoteHandlerMock) HandleResultCalls() []struct { Ctx github_com_cosmos_cosmos_sdk_types.Context Result codec.ProtoMarshaler }
HandleResultCalls gets all the calls that were made to HandleResult. Check the length with:
len(mockedVoteHandler.HandleResultCalls())
func (*VoteHandlerMock) IsFalsyResult ¶ added in v0.18.0
func (mock *VoteHandlerMock) IsFalsyResult(result codec.ProtoMarshaler) bool
IsFalsyResult calls IsFalsyResultFunc.
func (*VoteHandlerMock) IsFalsyResultCalls ¶ added in v0.18.0
func (mock *VoteHandlerMock) IsFalsyResultCalls() []struct { Result codec.ProtoMarshaler }
IsFalsyResultCalls gets all the calls that were made to IsFalsyResult. Check the length with:
len(mockedVoteHandler.IsFalsyResultCalls())