forked from crypto-com/chain-indexing
/
messages_mock.go
33 lines (27 loc) · 1.03 KB
/
messages_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 (
testify_mock "github.com/stretchr/testify/mock"
pagination_interface "github.com/WilliamXieCrypto/chain-indexing/appinterface/pagination"
)
type MockMessagesView struct {
testify_mock.Mock
}
func (messagesView *MockMessagesView) Insert(row *MessageRow) error {
mockArgs := messagesView.Called(row)
return mockArgs.Error(0)
}
func (messagesView *MockMessagesView) List(
filter MessagesListFilter,
order MessagesListOrder,
pagination *pagination_interface.Pagination,
) ([]MessageRow, *pagination_interface.PaginationResult, error) {
mockArgs := messagesView.Called(filter, order, pagination)
rows, _ := mockArgs.Get(0).([]MessageRow)
paginationResult, _ := mockArgs.Get(1).(*pagination_interface.PaginationResult)
return rows, paginationResult, mockArgs.Error(2)
}
func (messagesView *MockMessagesView) DeleteAllByDenomTokenIds(denomId string, tokenId string) (int64, error) {
mockArgs := messagesView.Called(denomId, tokenId)
rowsAffected, _ := mockArgs.Get(0).(int64)
return rowsAffected, mockArgs.Error(1)
}