/
validator_block_commitments_mock.go
33 lines (30 loc) · 1.29 KB
/
validator_block_commitments_mock.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package view
import (
"github.com/crypto-com/chain-indexing/appinterface/pagination"
pagination_interface "github.com/crypto-com/chain-indexing/appinterface/pagination"
"github.com/crypto-com/chain-indexing/appinterface/rdb"
"github.com/stretchr/testify/mock"
)
type MockValidatorBlockCommitmentsView struct {
mock.Mock
}
func NewMockValidatorBlockCommitmentsView(_ *rdb.Handle) ValidatorBlockCommitments {
return &MockValidatorBlockCommitmentsView{}
}
func (commitmentsView *MockValidatorBlockCommitmentsView) InsertAll(commitments []ValidatorBlockCommitmentRow) error {
mockArgs := commitmentsView.Called(commitments)
return mockArgs.Error(0)
}
func (commitmentsView *MockValidatorBlockCommitmentsView) Insert(commitment ValidatorBlockCommitmentRow) error {
mockArgs := commitmentsView.Called(commitment)
return mockArgs.Error(0)
}
func (commitmentsView *MockValidatorBlockCommitmentsView) List(
filter ValidatorBlockCommitmentsListFilter,
pagination *pagination_interface.Pagination,
) ([]ListValidatorBlockCommitmentRow, *pagination.PaginationResult, error) {
mockArgs := commitmentsView.Called(filter, pagination)
result0, _ := mockArgs.Get(0).([]ListValidatorBlockCommitmentRow)
result1, _ := mockArgs.Get(1).(*pagination_interface.PaginationResult)
return result0, result1, mockArgs.Error(2)
}