Documentation ¶
Index ¶
- type KeyMock
- func (mock *KeyMock) GetBondedWeight() sdk.Uint
- func (mock *KeyMock) GetBondedWeightCalls() []struct{}
- func (mock *KeyMock) GetHeight() int64
- func (mock *KeyMock) GetHeightCalls() []struct{}
- func (mock *KeyMock) GetMinPassingWeight() sdk.Uint
- func (mock *KeyMock) GetMinPassingWeightCalls() []struct{}
- func (mock *KeyMock) GetParticipants() []sdk.ValAddress
- func (mock *KeyMock) GetParticipantsCalls() []struct{}
- func (mock *KeyMock) GetPubKey(valAddress sdk.ValAddress) (multisigexported.PublicKey, bool)
- func (mock *KeyMock) GetPubKeyCalls() []struct{ ... }
- func (mock *KeyMock) GetSnapshot() snapshotexported.Snapshot
- func (mock *KeyMock) GetSnapshotCalls() []struct{}
- func (mock *KeyMock) GetState() multisigexported.KeyState
- func (mock *KeyMock) GetStateCalls() []struct{}
- func (mock *KeyMock) GetTimestamp() time.Time
- func (mock *KeyMock) GetTimestampCalls() []struct{}
- func (mock *KeyMock) GetWeight(valAddress sdk.ValAddress) sdk.Uint
- func (mock *KeyMock) GetWeightCalls() []struct{ ... }
- type SigHandlerMock
- func (mock *SigHandlerMock) HandleCompleted(ctx sdk.Context, sig codec.ProtoMarshaler, moduleMetadata codec.ProtoMarshaler) error
- func (mock *SigHandlerMock) HandleCompletedCalls() []struct{ ... }
- func (mock *SigHandlerMock) HandleFailed(ctx sdk.Context, moduleMetadata codec.ProtoMarshaler) error
- func (mock *SigHandlerMock) HandleFailedCalls() []struct{ ... }
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type KeyMock ¶
type KeyMock struct { // GetBondedWeightFunc mocks the GetBondedWeight method. GetBondedWeightFunc func() sdk.Uint // GetHeightFunc mocks the GetHeight method. GetHeightFunc func() int64 // GetMinPassingWeightFunc mocks the GetMinPassingWeight method. GetMinPassingWeightFunc func() sdk.Uint // GetParticipantsFunc mocks the GetParticipants method. GetParticipantsFunc func() []sdk.ValAddress // GetPubKeyFunc mocks the GetPubKey method. GetPubKeyFunc func(valAddress sdk.ValAddress) (multisigexported.PublicKey, bool) // GetSnapshotFunc mocks the GetSnapshot method. GetSnapshotFunc func() snapshotexported.Snapshot // GetStateFunc mocks the GetState method. GetStateFunc func() multisigexported.KeyState // GetTimestampFunc mocks the GetTimestamp method. GetTimestampFunc func() time.Time // GetWeightFunc mocks the GetWeight method. GetWeightFunc func(valAddress sdk.ValAddress) sdk.Uint // contains filtered or unexported fields }
KeyMock is a mock implementation of multisigexported.Key.
func TestSomethingThatUsesKey(t *testing.T) { // make and configure a mocked multisigexported.Key mockedKey := &KeyMock{ GetBondedWeightFunc: func() sdk.Uint { panic("mock out the GetBondedWeight method") }, GetHeightFunc: func() int64 { panic("mock out the GetHeight method") }, GetMinPassingWeightFunc: func() sdk.Uint { panic("mock out the GetMinPassingWeight method") }, GetParticipantsFunc: func() []sdk.ValAddress { panic("mock out the GetParticipants method") }, GetPubKeyFunc: func(valAddress sdk.ValAddress) (multisigexported.PublicKey, bool) { panic("mock out the GetPubKey method") }, GetSnapshotFunc: func() snapshotexported.Snapshot { panic("mock out the GetSnapshot method") }, GetStateFunc: func() multisigexported.KeyState { panic("mock out the GetState method") }, GetTimestampFunc: func() time.Time { panic("mock out the GetTimestamp method") }, GetWeightFunc: func(valAddress sdk.ValAddress) sdk.Uint { panic("mock out the GetWeight method") }, } // use mockedKey in code that requires multisigexported.Key // and then make assertions. }
func (*KeyMock) GetBondedWeight ¶
GetBondedWeight calls GetBondedWeightFunc.
func (*KeyMock) GetBondedWeightCalls ¶
func (mock *KeyMock) GetBondedWeightCalls() []struct { }
GetBondedWeightCalls gets all the calls that were made to GetBondedWeight. Check the length with:
len(mockedKey.GetBondedWeightCalls())
func (*KeyMock) GetHeightCalls ¶
func (mock *KeyMock) GetHeightCalls() []struct { }
GetHeightCalls gets all the calls that were made to GetHeight. Check the length with:
len(mockedKey.GetHeightCalls())
func (*KeyMock) GetMinPassingWeight ¶
GetMinPassingWeight calls GetMinPassingWeightFunc.
func (*KeyMock) GetMinPassingWeightCalls ¶
func (mock *KeyMock) GetMinPassingWeightCalls() []struct { }
GetMinPassingWeightCalls gets all the calls that were made to GetMinPassingWeight. Check the length with:
len(mockedKey.GetMinPassingWeightCalls())
func (*KeyMock) GetParticipants ¶
func (mock *KeyMock) GetParticipants() []sdk.ValAddress
GetParticipants calls GetParticipantsFunc.
func (*KeyMock) GetParticipantsCalls ¶
func (mock *KeyMock) GetParticipantsCalls() []struct { }
GetParticipantsCalls gets all the calls that were made to GetParticipants. Check the length with:
len(mockedKey.GetParticipantsCalls())
func (*KeyMock) GetPubKey ¶
func (mock *KeyMock) GetPubKey(valAddress sdk.ValAddress) (multisigexported.PublicKey, bool)
GetPubKey calls GetPubKeyFunc.
func (*KeyMock) GetPubKeyCalls ¶
func (mock *KeyMock) GetPubKeyCalls() []struct { ValAddress sdk.ValAddress }
GetPubKeyCalls gets all the calls that were made to GetPubKey. Check the length with:
len(mockedKey.GetPubKeyCalls())
func (*KeyMock) GetSnapshot ¶ added in v0.21.1
func (mock *KeyMock) GetSnapshot() snapshotexported.Snapshot
GetSnapshot calls GetSnapshotFunc.
func (*KeyMock) GetSnapshotCalls ¶ added in v0.21.1
func (mock *KeyMock) GetSnapshotCalls() []struct { }
GetSnapshotCalls gets all the calls that were made to GetSnapshot. Check the length with:
len(mockedKey.GetSnapshotCalls())
func (*KeyMock) GetState ¶
func (mock *KeyMock) GetState() multisigexported.KeyState
GetState calls GetStateFunc.
func (*KeyMock) GetStateCalls ¶
func (mock *KeyMock) GetStateCalls() []struct { }
GetStateCalls gets all the calls that were made to GetState. Check the length with:
len(mockedKey.GetStateCalls())
func (*KeyMock) GetTimestamp ¶
GetTimestamp calls GetTimestampFunc.
func (*KeyMock) GetTimestampCalls ¶
func (mock *KeyMock) GetTimestampCalls() []struct { }
GetTimestampCalls gets all the calls that were made to GetTimestamp. Check the length with:
len(mockedKey.GetTimestampCalls())
func (*KeyMock) GetWeight ¶
func (mock *KeyMock) GetWeight(valAddress sdk.ValAddress) sdk.Uint
GetWeight calls GetWeightFunc.
func (*KeyMock) GetWeightCalls ¶
func (mock *KeyMock) GetWeightCalls() []struct { ValAddress sdk.ValAddress }
GetWeightCalls gets all the calls that were made to GetWeight. Check the length with:
len(mockedKey.GetWeightCalls())
type SigHandlerMock ¶
type SigHandlerMock struct { // HandleCompletedFunc mocks the HandleCompleted method. HandleCompletedFunc func(ctx sdk.Context, sig codec.ProtoMarshaler, moduleMetadata codec.ProtoMarshaler) error // HandleFailedFunc mocks the HandleFailed method. HandleFailedFunc func(ctx sdk.Context, moduleMetadata codec.ProtoMarshaler) error // contains filtered or unexported fields }
SigHandlerMock is a mock implementation of multisigexported.SigHandler.
func TestSomethingThatUsesSigHandler(t *testing.T) { // make and configure a mocked multisigexported.SigHandler mockedSigHandler := &SigHandlerMock{ HandleCompletedFunc: func(ctx sdk.Context, sig codec.ProtoMarshaler, moduleMetadata codec.ProtoMarshaler) error { panic("mock out the HandleCompleted method") }, HandleFailedFunc: func(ctx sdk.Context, moduleMetadata codec.ProtoMarshaler) error { panic("mock out the HandleFailed method") }, } // use mockedSigHandler in code that requires multisigexported.SigHandler // and then make assertions. }
func (*SigHandlerMock) HandleCompleted ¶
func (mock *SigHandlerMock) HandleCompleted(ctx sdk.Context, sig codec.ProtoMarshaler, moduleMetadata codec.ProtoMarshaler) error
HandleCompleted calls HandleCompletedFunc.
func (*SigHandlerMock) HandleCompletedCalls ¶
func (mock *SigHandlerMock) HandleCompletedCalls() []struct { Ctx sdk.Context Sig codec.ProtoMarshaler ModuleMetadata codec.ProtoMarshaler }
HandleCompletedCalls gets all the calls that were made to HandleCompleted. Check the length with:
len(mockedSigHandler.HandleCompletedCalls())
func (*SigHandlerMock) HandleFailed ¶
func (mock *SigHandlerMock) HandleFailed(ctx sdk.Context, moduleMetadata codec.ProtoMarshaler) error
HandleFailed calls HandleFailedFunc.
func (*SigHandlerMock) HandleFailedCalls ¶
func (mock *SigHandlerMock) HandleFailedCalls() []struct { Ctx sdk.Context ModuleMetadata codec.ProtoMarshaler }
HandleFailedCalls gets all the calls that were made to HandleFailed. Check the length with:
len(mockedSigHandler.HandleFailedCalls())