Documentation ¶
Index ¶
- type SnapshotterMock
- func (mock *SnapshotterMock) CreateSnapshot(ctx sdk.Context, threshold utils.Threshold) (snapshot.Snapshot, error)
- func (mock *SnapshotterMock) CreateSnapshotCalls() []struct{ ... }
- func (mock *SnapshotterMock) GetOperator(ctx sdk.Context, proxy sdk.AccAddress) sdk.ValAddress
- func (mock *SnapshotterMock) GetOperatorCalls() []struct{ ... }
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SnapshotterMock ¶
type SnapshotterMock struct { // CreateSnapshotFunc mocks the CreateSnapshot method. CreateSnapshotFunc func(ctx sdk.Context, threshold utils.Threshold) (snapshot.Snapshot, error) // GetOperatorFunc mocks the GetOperator method. GetOperatorFunc func(ctx sdk.Context, proxy sdk.AccAddress) sdk.ValAddress // contains filtered or unexported fields }
SnapshotterMock is a mock implementation of keeper.Snapshotter.
func TestSomethingThatUsesSnapshotter(t *testing.T) { // make and configure a mocked keeper.Snapshotter mockedSnapshotter := &SnapshotterMock{ CreateSnapshotFunc: func(ctx sdk.Context, threshold utils.Threshold) (snapshot.Snapshot, error) { panic("mock out the CreateSnapshot method") }, GetOperatorFunc: func(ctx sdk.Context, proxy sdk.AccAddress) sdk.ValAddress { panic("mock out the GetOperator method") }, } // use mockedSnapshotter in code that requires keeper.Snapshotter // and then make assertions. }
func (*SnapshotterMock) CreateSnapshot ¶
func (mock *SnapshotterMock) CreateSnapshot(ctx sdk.Context, threshold utils.Threshold) (snapshot.Snapshot, error)
CreateSnapshot calls CreateSnapshotFunc.
func (*SnapshotterMock) CreateSnapshotCalls ¶
func (mock *SnapshotterMock) CreateSnapshotCalls() []struct { Ctx sdk.Context Threshold utils.Threshold }
CreateSnapshotCalls gets all the calls that were made to CreateSnapshot. Check the length with:
len(mockedSnapshotter.CreateSnapshotCalls())
func (*SnapshotterMock) GetOperator ¶
func (mock *SnapshotterMock) GetOperator(ctx sdk.Context, proxy sdk.AccAddress) sdk.ValAddress
GetOperator calls GetOperatorFunc.
func (*SnapshotterMock) GetOperatorCalls ¶
func (mock *SnapshotterMock) GetOperatorCalls() []struct { Ctx sdk.Context Proxy sdk.AccAddress }
GetOperatorCalls gets all the calls that were made to GetOperator. Check the length with:
len(mockedSnapshotter.GetOperatorCalls())
Click to show internal directories.
Click to hide internal directories.