forked from coinbase/mesh-sdk-go
/
helper.go
168 lines (135 loc) · 4.89 KB
/
helper.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
// Code generated by mockery v1.0.0. DO NOT EDIT.
package reconciler
import (
context "context"
mock "github.com/stretchr/testify/mock"
storage "github.com/HelloKashif/rosetta-sdk-go/storage"
types "github.com/HelloKashif/rosetta-sdk-go/types"
)
// Helper is an autogenerated mock type for the Helper type
type Helper struct {
mock.Mock
}
// CanonicalBlock provides a mock function with given fields: ctx, dbTx, block
func (_m *Helper) CanonicalBlock(ctx context.Context, dbTx storage.DatabaseTransaction, block *types.BlockIdentifier) (bool, error) {
ret := _m.Called(ctx, dbTx, block)
var r0 bool
if rf, ok := ret.Get(0).(func(context.Context, storage.DatabaseTransaction, *types.BlockIdentifier) bool); ok {
r0 = rf(ctx, dbTx, block)
} else {
r0 = ret.Get(0).(bool)
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, storage.DatabaseTransaction, *types.BlockIdentifier) error); ok {
r1 = rf(ctx, dbTx, block)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// ComputedBalance provides a mock function with given fields: ctx, dbTx, account, currency, index
func (_m *Helper) ComputedBalance(ctx context.Context, dbTx storage.DatabaseTransaction, account *types.AccountIdentifier, currency *types.Currency, index int64) (*types.Amount, error) {
ret := _m.Called(ctx, dbTx, account, currency, index)
var r0 *types.Amount
if rf, ok := ret.Get(0).(func(context.Context, storage.DatabaseTransaction, *types.AccountIdentifier, *types.Currency, int64) *types.Amount); ok {
r0 = rf(ctx, dbTx, account, currency, index)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*types.Amount)
}
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, storage.DatabaseTransaction, *types.AccountIdentifier, *types.Currency, int64) error); ok {
r1 = rf(ctx, dbTx, account, currency, index)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// CurrentBlock provides a mock function with given fields: ctx, dbTx
func (_m *Helper) CurrentBlock(ctx context.Context, dbTx storage.DatabaseTransaction) (*types.BlockIdentifier, error) {
ret := _m.Called(ctx, dbTx)
var r0 *types.BlockIdentifier
if rf, ok := ret.Get(0).(func(context.Context, storage.DatabaseTransaction) *types.BlockIdentifier); ok {
r0 = rf(ctx, dbTx)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*types.BlockIdentifier)
}
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, storage.DatabaseTransaction) error); ok {
r1 = rf(ctx, dbTx)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// DatabaseTransaction provides a mock function with given fields: ctx
func (_m *Helper) DatabaseTransaction(ctx context.Context) storage.DatabaseTransaction {
ret := _m.Called(ctx)
var r0 storage.DatabaseTransaction
if rf, ok := ret.Get(0).(func(context.Context) storage.DatabaseTransaction); ok {
r0 = rf(ctx)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(storage.DatabaseTransaction)
}
}
return r0
}
// IndexAtTip provides a mock function with given fields: ctx, index
func (_m *Helper) IndexAtTip(ctx context.Context, index int64) (bool, error) {
ret := _m.Called(ctx, index)
var r0 bool
if rf, ok := ret.Get(0).(func(context.Context, int64) bool); ok {
r0 = rf(ctx, index)
} else {
r0 = ret.Get(0).(bool)
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, int64) error); ok {
r1 = rf(ctx, index)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// LiveBalance provides a mock function with given fields: ctx, account, currency, index
func (_m *Helper) LiveBalance(ctx context.Context, account *types.AccountIdentifier, currency *types.Currency, index int64) (*types.Amount, *types.BlockIdentifier, error) {
ret := _m.Called(ctx, account, currency, index)
var r0 *types.Amount
if rf, ok := ret.Get(0).(func(context.Context, *types.AccountIdentifier, *types.Currency, int64) *types.Amount); ok {
r0 = rf(ctx, account, currency, index)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*types.Amount)
}
}
var r1 *types.BlockIdentifier
if rf, ok := ret.Get(1).(func(context.Context, *types.AccountIdentifier, *types.Currency, int64) *types.BlockIdentifier); ok {
r1 = rf(ctx, account, currency, index)
} else {
if ret.Get(1) != nil {
r1 = ret.Get(1).(*types.BlockIdentifier)
}
}
var r2 error
if rf, ok := ret.Get(2).(func(context.Context, *types.AccountIdentifier, *types.Currency, int64) error); ok {
r2 = rf(ctx, account, currency, index)
} else {
r2 = ret.Error(2)
}
return r0, r1, r2
}
// PruneBalances provides a mock function with given fields: ctx, account, currency, index
func (_m *Helper) PruneBalances(ctx context.Context, account *types.AccountIdentifier, currency *types.Currency, index int64) error {
ret := _m.Called(ctx, account, currency, index)
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, *types.AccountIdentifier, *types.Currency, int64) error); ok {
r0 = rf(ctx, account, currency, index)
} else {
r0 = ret.Error(0)
}
return r0
}