-
Notifications
You must be signed in to change notification settings - Fork 0
/
mock_q_trades.go
53 lines (41 loc) · 1.52 KB
/
mock_q_trades.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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
package history
import (
"context"
"github.com/shantanu-hashcash/go/support/db"
"github.com/shantanu-hashcash/go/xdr"
"github.com/stretchr/testify/mock"
)
type MockQTrades struct {
mock.Mock
}
func (m *MockQTrades) CreateAccounts(ctx context.Context, addresses []string, maxBatchSize int) (map[string]int64, error) {
a := m.Called(ctx, addresses, maxBatchSize)
return a.Get(0).(map[string]int64), a.Error(1)
}
func (m *MockQTrades) CreateAssets(ctx context.Context, assets []xdr.Asset, maxBatchSize int) (map[string]Asset, error) {
a := m.Called(ctx, assets, maxBatchSize)
return a.Get(0).(map[string]Asset), a.Error(1)
}
func (m *MockQTrades) CreateHistoryLiquidityPools(ctx context.Context, poolIDs []string, maxBatchSize int) (map[string]int64, error) {
a := m.Called(ctx, poolIDs, maxBatchSize)
return a.Get(0).(map[string]int64), a.Error(1)
}
func (m *MockQTrades) NewTradeBatchInsertBuilder() TradeBatchInsertBuilder {
a := m.Called()
return a.Get(0).(TradeBatchInsertBuilder)
}
func (m *MockQTrades) RebuildTradeAggregationBuckets(ctx context.Context, fromLedger, toLedger uint32, roundingSlippageFilter int) error {
a := m.Called(ctx, fromLedger, toLedger, roundingSlippageFilter)
return a.Error(0)
}
type MockTradeBatchInsertBuilder struct {
mock.Mock
}
func (m *MockTradeBatchInsertBuilder) Add(entries ...InsertTrade) error {
a := m.Called(entries)
return a.Error(0)
}
func (m *MockTradeBatchInsertBuilder) Exec(ctx context.Context, session db.SessionInterface) error {
a := m.Called(ctx, session)
return a.Error(0)
}