forked from coinbase/mesh-sdk-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
helper.go
215 lines (174 loc) · 6.21 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
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
// Code generated by mockery v2.13.1. DO NOT EDIT.
package worker
import (
context "context"
mock "github.com/stretchr/testify/mock"
keys "github.com/findoranetwork/rosetta-sdk-go/keys"
database "github.com/findoranetwork/rosetta-sdk-go/storage/database"
types "github.com/findoranetwork/rosetta-sdk-go/types"
)
// Helper is an autogenerated mock type for the Helper type
type Helper struct {
mock.Mock
}
// AllAccounts provides a mock function with given fields: _a0, _a1
func (_m *Helper) AllAccounts(_a0 context.Context, _a1 database.Transaction) ([]*types.AccountIdentifier, error) {
ret := _m.Called(_a0, _a1)
var r0 []*types.AccountIdentifier
if rf, ok := ret.Get(0).(func(context.Context, database.Transaction) []*types.AccountIdentifier); ok {
r0 = rf(_a0, _a1)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]*types.AccountIdentifier)
}
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, database.Transaction) error); ok {
r1 = rf(_a0, _a1)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// Balance provides a mock function with given fields: _a0, _a1, _a2, _a3
func (_m *Helper) Balance(_a0 context.Context, _a1 database.Transaction, _a2 *types.AccountIdentifier, _a3 *types.Currency) (*types.Amount, error) {
ret := _m.Called(_a0, _a1, _a2, _a3)
var r0 *types.Amount
if rf, ok := ret.Get(0).(func(context.Context, database.Transaction, *types.AccountIdentifier, *types.Currency) *types.Amount); ok {
r0 = rf(_a0, _a1, _a2, _a3)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*types.Amount)
}
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, database.Transaction, *types.AccountIdentifier, *types.Currency) error); ok {
r1 = rf(_a0, _a1, _a2, _a3)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// Coins provides a mock function with given fields: _a0, _a1, _a2, _a3
func (_m *Helper) Coins(_a0 context.Context, _a1 database.Transaction, _a2 *types.AccountIdentifier, _a3 *types.Currency) ([]*types.Coin, error) {
ret := _m.Called(_a0, _a1, _a2, _a3)
var r0 []*types.Coin
if rf, ok := ret.Get(0).(func(context.Context, database.Transaction, *types.AccountIdentifier, *types.Currency) []*types.Coin); ok {
r0 = rf(_a0, _a1, _a2, _a3)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]*types.Coin)
}
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, database.Transaction, *types.AccountIdentifier, *types.Currency) error); ok {
r1 = rf(_a0, _a1, _a2, _a3)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// Derive provides a mock function with given fields: _a0, _a1, _a2, _a3
func (_m *Helper) Derive(_a0 context.Context, _a1 *types.NetworkIdentifier, _a2 *types.PublicKey, _a3 map[string]interface{}) (*types.AccountIdentifier, map[string]interface{}, error) {
ret := _m.Called(_a0, _a1, _a2, _a3)
var r0 *types.AccountIdentifier
if rf, ok := ret.Get(0).(func(context.Context, *types.NetworkIdentifier, *types.PublicKey, map[string]interface{}) *types.AccountIdentifier); ok {
r0 = rf(_a0, _a1, _a2, _a3)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*types.AccountIdentifier)
}
}
var r1 map[string]interface{}
if rf, ok := ret.Get(1).(func(context.Context, *types.NetworkIdentifier, *types.PublicKey, map[string]interface{}) map[string]interface{}); ok {
r1 = rf(_a0, _a1, _a2, _a3)
} else {
if ret.Get(1) != nil {
r1 = ret.Get(1).(map[string]interface{})
}
}
var r2 error
if rf, ok := ret.Get(2).(func(context.Context, *types.NetworkIdentifier, *types.PublicKey, map[string]interface{}) error); ok {
r2 = rf(_a0, _a1, _a2, _a3)
} else {
r2 = ret.Error(2)
}
return r0, r1, r2
}
// GetBlob provides a mock function with given fields: ctx, dbTx, key
func (_m *Helper) GetBlob(ctx context.Context, dbTx database.Transaction, key string) (bool, []byte, error) {
ret := _m.Called(ctx, dbTx, key)
var r0 bool
if rf, ok := ret.Get(0).(func(context.Context, database.Transaction, string) bool); ok {
r0 = rf(ctx, dbTx, key)
} else {
r0 = ret.Get(0).(bool)
}
var r1 []byte
if rf, ok := ret.Get(1).(func(context.Context, database.Transaction, string) []byte); ok {
r1 = rf(ctx, dbTx, key)
} else {
if ret.Get(1) != nil {
r1 = ret.Get(1).([]byte)
}
}
var r2 error
if rf, ok := ret.Get(2).(func(context.Context, database.Transaction, string) error); ok {
r2 = rf(ctx, dbTx, key)
} else {
r2 = ret.Error(2)
}
return r0, r1, r2
}
// LockedAccounts provides a mock function with given fields: _a0, _a1
func (_m *Helper) LockedAccounts(_a0 context.Context, _a1 database.Transaction) ([]*types.AccountIdentifier, error) {
ret := _m.Called(_a0, _a1)
var r0 []*types.AccountIdentifier
if rf, ok := ret.Get(0).(func(context.Context, database.Transaction) []*types.AccountIdentifier); ok {
r0 = rf(_a0, _a1)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]*types.AccountIdentifier)
}
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, database.Transaction) error); ok {
r1 = rf(_a0, _a1)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// SetBlob provides a mock function with given fields: ctx, dbTx, key, value
func (_m *Helper) SetBlob(ctx context.Context, dbTx database.Transaction, key string, value []byte) error {
ret := _m.Called(ctx, dbTx, key, value)
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, database.Transaction, string, []byte) error); ok {
r0 = rf(ctx, dbTx, key, value)
} else {
r0 = ret.Error(0)
}
return r0
}
// StoreKey provides a mock function with given fields: _a0, _a1, _a2, _a3
func (_m *Helper) StoreKey(_a0 context.Context, _a1 database.Transaction, _a2 *types.AccountIdentifier, _a3 *keys.KeyPair) error {
ret := _m.Called(_a0, _a1, _a2, _a3)
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, database.Transaction, *types.AccountIdentifier, *keys.KeyPair) error); ok {
r0 = rf(_a0, _a1, _a2, _a3)
} else {
r0 = ret.Error(0)
}
return r0
}
type mockConstructorTestingTNewHelper interface {
mock.TestingT
Cleanup(func())
}
// NewHelper creates a new instance of Helper. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
func NewHelper(t mockConstructorTestingTNewHelper) *Helper {
mock := &Helper{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}