/
plugin.go
689 lines (554 loc) · 20.8 KB
/
plugin.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
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
// Code generated by mockery v2.42.1. DO NOT EDIT.
package blockchainmocks
import (
cache "github.com/hyperledger/firefly/internal/cache"
blockchain "github.com/hyperledger/firefly/pkg/blockchain"
config "github.com/hyperledger/firefly-common/pkg/config"
context "context"
core "github.com/hyperledger/firefly/pkg/core"
fftypes "github.com/hyperledger/firefly-common/pkg/fftypes"
metrics "github.com/hyperledger/firefly/internal/metrics"
mock "github.com/stretchr/testify/mock"
)
// Plugin is an autogenerated mock type for the Plugin type
type Plugin struct {
mock.Mock
}
// AddContractListener provides a mock function with given fields: ctx, subscription
func (_m *Plugin) AddContractListener(ctx context.Context, subscription *core.ContractListener) error {
ret := _m.Called(ctx, subscription)
if len(ret) == 0 {
panic("no return value specified for AddContractListener")
}
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, *core.ContractListener) error); ok {
r0 = rf(ctx, subscription)
} else {
r0 = ret.Error(0)
}
return r0
}
// AddFireflySubscription provides a mock function with given fields: ctx, namespace, contract
func (_m *Plugin) AddFireflySubscription(ctx context.Context, namespace *core.Namespace, contract *blockchain.MultipartyContract) (string, error) {
ret := _m.Called(ctx, namespace, contract)
if len(ret) == 0 {
panic("no return value specified for AddFireflySubscription")
}
var r0 string
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, *core.Namespace, *blockchain.MultipartyContract) (string, error)); ok {
return rf(ctx, namespace, contract)
}
if rf, ok := ret.Get(0).(func(context.Context, *core.Namespace, *blockchain.MultipartyContract) string); ok {
r0 = rf(ctx, namespace, contract)
} else {
r0 = ret.Get(0).(string)
}
if rf, ok := ret.Get(1).(func(context.Context, *core.Namespace, *blockchain.MultipartyContract) error); ok {
r1 = rf(ctx, namespace, contract)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// Capabilities provides a mock function with given fields:
func (_m *Plugin) Capabilities() *blockchain.Capabilities {
ret := _m.Called()
if len(ret) == 0 {
panic("no return value specified for Capabilities")
}
var r0 *blockchain.Capabilities
if rf, ok := ret.Get(0).(func() *blockchain.Capabilities); ok {
r0 = rf()
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*blockchain.Capabilities)
}
}
return r0
}
// DeleteContractListener provides a mock function with given fields: ctx, subscription, okNotFound
func (_m *Plugin) DeleteContractListener(ctx context.Context, subscription *core.ContractListener, okNotFound bool) error {
ret := _m.Called(ctx, subscription, okNotFound)
if len(ret) == 0 {
panic("no return value specified for DeleteContractListener")
}
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, *core.ContractListener, bool) error); ok {
r0 = rf(ctx, subscription, okNotFound)
} else {
r0 = ret.Error(0)
}
return r0
}
// DeployContract provides a mock function with given fields: ctx, nsOpID, signingKey, definition, contract, input, options
func (_m *Plugin) DeployContract(ctx context.Context, nsOpID string, signingKey string, definition *fftypes.JSONAny, contract *fftypes.JSONAny, input []interface{}, options map[string]interface{}) (bool, error) {
ret := _m.Called(ctx, nsOpID, signingKey, definition, contract, input, options)
if len(ret) == 0 {
panic("no return value specified for DeployContract")
}
var r0 bool
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, string, string, *fftypes.JSONAny, *fftypes.JSONAny, []interface{}, map[string]interface{}) (bool, error)); ok {
return rf(ctx, nsOpID, signingKey, definition, contract, input, options)
}
if rf, ok := ret.Get(0).(func(context.Context, string, string, *fftypes.JSONAny, *fftypes.JSONAny, []interface{}, map[string]interface{}) bool); ok {
r0 = rf(ctx, nsOpID, signingKey, definition, contract, input, options)
} else {
r0 = ret.Get(0).(bool)
}
if rf, ok := ret.Get(1).(func(context.Context, string, string, *fftypes.JSONAny, *fftypes.JSONAny, []interface{}, map[string]interface{}) error); ok {
r1 = rf(ctx, nsOpID, signingKey, definition, contract, input, options)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// GenerateErrorSignature provides a mock function with given fields: ctx, errorDef
func (_m *Plugin) GenerateErrorSignature(ctx context.Context, errorDef *fftypes.FFIErrorDefinition) string {
ret := _m.Called(ctx, errorDef)
if len(ret) == 0 {
panic("no return value specified for GenerateErrorSignature")
}
var r0 string
if rf, ok := ret.Get(0).(func(context.Context, *fftypes.FFIErrorDefinition) string); ok {
r0 = rf(ctx, errorDef)
} else {
r0 = ret.Get(0).(string)
}
return r0
}
// GenerateEventSignature provides a mock function with given fields: ctx, event
func (_m *Plugin) GenerateEventSignature(ctx context.Context, event *fftypes.FFIEventDefinition) string {
ret := _m.Called(ctx, event)
if len(ret) == 0 {
panic("no return value specified for GenerateEventSignature")
}
var r0 string
if rf, ok := ret.Get(0).(func(context.Context, *fftypes.FFIEventDefinition) string); ok {
r0 = rf(ctx, event)
} else {
r0 = ret.Get(0).(string)
}
return r0
}
// GenerateFFI provides a mock function with given fields: ctx, generationRequest
func (_m *Plugin) GenerateFFI(ctx context.Context, generationRequest *fftypes.FFIGenerationRequest) (*fftypes.FFI, error) {
ret := _m.Called(ctx, generationRequest)
if len(ret) == 0 {
panic("no return value specified for GenerateFFI")
}
var r0 *fftypes.FFI
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, *fftypes.FFIGenerationRequest) (*fftypes.FFI, error)); ok {
return rf(ctx, generationRequest)
}
if rf, ok := ret.Get(0).(func(context.Context, *fftypes.FFIGenerationRequest) *fftypes.FFI); ok {
r0 = rf(ctx, generationRequest)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*fftypes.FFI)
}
}
if rf, ok := ret.Get(1).(func(context.Context, *fftypes.FFIGenerationRequest) error); ok {
r1 = rf(ctx, generationRequest)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// GetAndConvertDeprecatedContractConfig provides a mock function with given fields: ctx
func (_m *Plugin) GetAndConvertDeprecatedContractConfig(ctx context.Context) (*fftypes.JSONAny, string, error) {
ret := _m.Called(ctx)
if len(ret) == 0 {
panic("no return value specified for GetAndConvertDeprecatedContractConfig")
}
var r0 *fftypes.JSONAny
var r1 string
var r2 error
if rf, ok := ret.Get(0).(func(context.Context) (*fftypes.JSONAny, string, error)); ok {
return rf(ctx)
}
if rf, ok := ret.Get(0).(func(context.Context) *fftypes.JSONAny); ok {
r0 = rf(ctx)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*fftypes.JSONAny)
}
}
if rf, ok := ret.Get(1).(func(context.Context) string); ok {
r1 = rf(ctx)
} else {
r1 = ret.Get(1).(string)
}
if rf, ok := ret.Get(2).(func(context.Context) error); ok {
r2 = rf(ctx)
} else {
r2 = ret.Error(2)
}
return r0, r1, r2
}
// GetContractListenerStatus provides a mock function with given fields: ctx, namespace, subID, okNotFound
func (_m *Plugin) GetContractListenerStatus(ctx context.Context, namespace string, subID string, okNotFound bool) (bool, interface{}, error) {
ret := _m.Called(ctx, namespace, subID, okNotFound)
if len(ret) == 0 {
panic("no return value specified for GetContractListenerStatus")
}
var r0 bool
var r1 interface{}
var r2 error
if rf, ok := ret.Get(0).(func(context.Context, string, string, bool) (bool, interface{}, error)); ok {
return rf(ctx, namespace, subID, okNotFound)
}
if rf, ok := ret.Get(0).(func(context.Context, string, string, bool) bool); ok {
r0 = rf(ctx, namespace, subID, okNotFound)
} else {
r0 = ret.Get(0).(bool)
}
if rf, ok := ret.Get(1).(func(context.Context, string, string, bool) interface{}); ok {
r1 = rf(ctx, namespace, subID, okNotFound)
} else {
if ret.Get(1) != nil {
r1 = ret.Get(1).(interface{})
}
}
if rf, ok := ret.Get(2).(func(context.Context, string, string, bool) error); ok {
r2 = rf(ctx, namespace, subID, okNotFound)
} else {
r2 = ret.Error(2)
}
return r0, r1, r2
}
// GetFFIParamValidator provides a mock function with given fields: ctx
func (_m *Plugin) GetFFIParamValidator(ctx context.Context) (fftypes.FFIParamValidator, error) {
ret := _m.Called(ctx)
if len(ret) == 0 {
panic("no return value specified for GetFFIParamValidator")
}
var r0 fftypes.FFIParamValidator
var r1 error
if rf, ok := ret.Get(0).(func(context.Context) (fftypes.FFIParamValidator, error)); ok {
return rf(ctx)
}
if rf, ok := ret.Get(0).(func(context.Context) fftypes.FFIParamValidator); ok {
r0 = rf(ctx)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(fftypes.FFIParamValidator)
}
}
if rf, ok := ret.Get(1).(func(context.Context) error); ok {
r1 = rf(ctx)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// GetNetworkVersion provides a mock function with given fields: ctx, location
func (_m *Plugin) GetNetworkVersion(ctx context.Context, location *fftypes.JSONAny) (int, error) {
ret := _m.Called(ctx, location)
if len(ret) == 0 {
panic("no return value specified for GetNetworkVersion")
}
var r0 int
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, *fftypes.JSONAny) (int, error)); ok {
return rf(ctx, location)
}
if rf, ok := ret.Get(0).(func(context.Context, *fftypes.JSONAny) int); ok {
r0 = rf(ctx, location)
} else {
r0 = ret.Get(0).(int)
}
if rf, ok := ret.Get(1).(func(context.Context, *fftypes.JSONAny) error); ok {
r1 = rf(ctx, location)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// GetTransactionStatus provides a mock function with given fields: ctx, operation
func (_m *Plugin) GetTransactionStatus(ctx context.Context, operation *core.Operation) (interface{}, error) {
ret := _m.Called(ctx, operation)
if len(ret) == 0 {
panic("no return value specified for GetTransactionStatus")
}
var r0 interface{}
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, *core.Operation) (interface{}, error)); ok {
return rf(ctx, operation)
}
if rf, ok := ret.Get(0).(func(context.Context, *core.Operation) interface{}); ok {
r0 = rf(ctx, operation)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(interface{})
}
}
if rf, ok := ret.Get(1).(func(context.Context, *core.Operation) error); ok {
r1 = rf(ctx, operation)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// Init provides a mock function with given fields: ctx, cancelCtx, _a2, _a3, cacheManager
func (_m *Plugin) Init(ctx context.Context, cancelCtx context.CancelFunc, _a2 config.Section, _a3 metrics.Manager, cacheManager cache.Manager) error {
ret := _m.Called(ctx, cancelCtx, _a2, _a3, cacheManager)
if len(ret) == 0 {
panic("no return value specified for Init")
}
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, context.CancelFunc, config.Section, metrics.Manager, cache.Manager) error); ok {
r0 = rf(ctx, cancelCtx, _a2, _a3, cacheManager)
} else {
r0 = ret.Error(0)
}
return r0
}
// InitConfig provides a mock function with given fields: _a0
func (_m *Plugin) InitConfig(_a0 config.Section) {
_m.Called(_a0)
}
// InvokeContract provides a mock function with given fields: ctx, nsOpID, signingKey, location, parsedMethod, input, options, batch
func (_m *Plugin) InvokeContract(ctx context.Context, nsOpID string, signingKey string, location *fftypes.JSONAny, parsedMethod interface{}, input map[string]interface{}, options map[string]interface{}, batch *blockchain.BatchPin) (bool, error) {
ret := _m.Called(ctx, nsOpID, signingKey, location, parsedMethod, input, options, batch)
if len(ret) == 0 {
panic("no return value specified for InvokeContract")
}
var r0 bool
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, string, string, *fftypes.JSONAny, interface{}, map[string]interface{}, map[string]interface{}, *blockchain.BatchPin) (bool, error)); ok {
return rf(ctx, nsOpID, signingKey, location, parsedMethod, input, options, batch)
}
if rf, ok := ret.Get(0).(func(context.Context, string, string, *fftypes.JSONAny, interface{}, map[string]interface{}, map[string]interface{}, *blockchain.BatchPin) bool); ok {
r0 = rf(ctx, nsOpID, signingKey, location, parsedMethod, input, options, batch)
} else {
r0 = ret.Get(0).(bool)
}
if rf, ok := ret.Get(1).(func(context.Context, string, string, *fftypes.JSONAny, interface{}, map[string]interface{}, map[string]interface{}, *blockchain.BatchPin) error); ok {
r1 = rf(ctx, nsOpID, signingKey, location, parsedMethod, input, options, batch)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// Name provides a mock function with given fields:
func (_m *Plugin) Name() string {
ret := _m.Called()
if len(ret) == 0 {
panic("no return value specified for Name")
}
var r0 string
if rf, ok := ret.Get(0).(func() string); ok {
r0 = rf()
} else {
r0 = ret.Get(0).(string)
}
return r0
}
// NormalizeContractLocation provides a mock function with given fields: ctx, ntype, location
func (_m *Plugin) NormalizeContractLocation(ctx context.Context, ntype blockchain.NormalizeType, location *fftypes.JSONAny) (*fftypes.JSONAny, error) {
ret := _m.Called(ctx, ntype, location)
if len(ret) == 0 {
panic("no return value specified for NormalizeContractLocation")
}
var r0 *fftypes.JSONAny
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, blockchain.NormalizeType, *fftypes.JSONAny) (*fftypes.JSONAny, error)); ok {
return rf(ctx, ntype, location)
}
if rf, ok := ret.Get(0).(func(context.Context, blockchain.NormalizeType, *fftypes.JSONAny) *fftypes.JSONAny); ok {
r0 = rf(ctx, ntype, location)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*fftypes.JSONAny)
}
}
if rf, ok := ret.Get(1).(func(context.Context, blockchain.NormalizeType, *fftypes.JSONAny) error); ok {
r1 = rf(ctx, ntype, location)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// ParseInterface provides a mock function with given fields: ctx, method, errors
func (_m *Plugin) ParseInterface(ctx context.Context, method *fftypes.FFIMethod, errors []*fftypes.FFIError) (interface{}, error) {
ret := _m.Called(ctx, method, errors)
if len(ret) == 0 {
panic("no return value specified for ParseInterface")
}
var r0 interface{}
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, *fftypes.FFIMethod, []*fftypes.FFIError) (interface{}, error)); ok {
return rf(ctx, method, errors)
}
if rf, ok := ret.Get(0).(func(context.Context, *fftypes.FFIMethod, []*fftypes.FFIError) interface{}); ok {
r0 = rf(ctx, method, errors)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(interface{})
}
}
if rf, ok := ret.Get(1).(func(context.Context, *fftypes.FFIMethod, []*fftypes.FFIError) error); ok {
r1 = rf(ctx, method, errors)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// QueryContract provides a mock function with given fields: ctx, signingKey, location, parsedMethod, input, options
func (_m *Plugin) QueryContract(ctx context.Context, signingKey string, location *fftypes.JSONAny, parsedMethod interface{}, input map[string]interface{}, options map[string]interface{}) (interface{}, error) {
ret := _m.Called(ctx, signingKey, location, parsedMethod, input, options)
if len(ret) == 0 {
panic("no return value specified for QueryContract")
}
var r0 interface{}
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, string, *fftypes.JSONAny, interface{}, map[string]interface{}, map[string]interface{}) (interface{}, error)); ok {
return rf(ctx, signingKey, location, parsedMethod, input, options)
}
if rf, ok := ret.Get(0).(func(context.Context, string, *fftypes.JSONAny, interface{}, map[string]interface{}, map[string]interface{}) interface{}); ok {
r0 = rf(ctx, signingKey, location, parsedMethod, input, options)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(interface{})
}
}
if rf, ok := ret.Get(1).(func(context.Context, string, *fftypes.JSONAny, interface{}, map[string]interface{}, map[string]interface{}) error); ok {
r1 = rf(ctx, signingKey, location, parsedMethod, input, options)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// RemoveFireflySubscription provides a mock function with given fields: ctx, subID
func (_m *Plugin) RemoveFireflySubscription(ctx context.Context, subID string) {
_m.Called(ctx, subID)
}
// ResolveSigningKey provides a mock function with given fields: ctx, keyRef, intent
func (_m *Plugin) ResolveSigningKey(ctx context.Context, keyRef string, intent blockchain.ResolveKeyIntent) (string, error) {
ret := _m.Called(ctx, keyRef, intent)
if len(ret) == 0 {
panic("no return value specified for ResolveSigningKey")
}
var r0 string
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, string, blockchain.ResolveKeyIntent) (string, error)); ok {
return rf(ctx, keyRef, intent)
}
if rf, ok := ret.Get(0).(func(context.Context, string, blockchain.ResolveKeyIntent) string); ok {
r0 = rf(ctx, keyRef, intent)
} else {
r0 = ret.Get(0).(string)
}
if rf, ok := ret.Get(1).(func(context.Context, string, blockchain.ResolveKeyIntent) error); ok {
r1 = rf(ctx, keyRef, intent)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// SetHandler provides a mock function with given fields: namespace, handler
func (_m *Plugin) SetHandler(namespace string, handler blockchain.Callbacks) {
_m.Called(namespace, handler)
}
// SetOperationHandler provides a mock function with given fields: namespace, handler
func (_m *Plugin) SetOperationHandler(namespace string, handler core.OperationCallbacks) {
_m.Called(namespace, handler)
}
// StartNamespace provides a mock function with given fields: ctx, namespace
func (_m *Plugin) StartNamespace(ctx context.Context, namespace string) error {
ret := _m.Called(ctx, namespace)
if len(ret) == 0 {
panic("no return value specified for StartNamespace")
}
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, string) error); ok {
r0 = rf(ctx, namespace)
} else {
r0 = ret.Error(0)
}
return r0
}
// StopNamespace provides a mock function with given fields: ctx, namespace
func (_m *Plugin) StopNamespace(ctx context.Context, namespace string) error {
ret := _m.Called(ctx, namespace)
if len(ret) == 0 {
panic("no return value specified for StopNamespace")
}
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, string) error); ok {
r0 = rf(ctx, namespace)
} else {
r0 = ret.Error(0)
}
return r0
}
// SubmitBatchPin provides a mock function with given fields: ctx, nsOpID, networkNamespace, signingKey, batch, location
func (_m *Plugin) SubmitBatchPin(ctx context.Context, nsOpID string, networkNamespace string, signingKey string, batch *blockchain.BatchPin, location *fftypes.JSONAny) error {
ret := _m.Called(ctx, nsOpID, networkNamespace, signingKey, batch, location)
if len(ret) == 0 {
panic("no return value specified for SubmitBatchPin")
}
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, string, string, string, *blockchain.BatchPin, *fftypes.JSONAny) error); ok {
r0 = rf(ctx, nsOpID, networkNamespace, signingKey, batch, location)
} else {
r0 = ret.Error(0)
}
return r0
}
// SubmitNetworkAction provides a mock function with given fields: ctx, nsOpID, signingKey, action, location
func (_m *Plugin) SubmitNetworkAction(ctx context.Context, nsOpID string, signingKey string, action fftypes.FFEnum, location *fftypes.JSONAny) error {
ret := _m.Called(ctx, nsOpID, signingKey, action, location)
if len(ret) == 0 {
panic("no return value specified for SubmitNetworkAction")
}
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, string, string, fftypes.FFEnum, *fftypes.JSONAny) error); ok {
r0 = rf(ctx, nsOpID, signingKey, action, location)
} else {
r0 = ret.Error(0)
}
return r0
}
// ValidateInvokeRequest provides a mock function with given fields: ctx, parsedMethod, input, hasMessage
func (_m *Plugin) ValidateInvokeRequest(ctx context.Context, parsedMethod interface{}, input map[string]interface{}, hasMessage bool) error {
ret := _m.Called(ctx, parsedMethod, input, hasMessage)
if len(ret) == 0 {
panic("no return value specified for ValidateInvokeRequest")
}
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, interface{}, map[string]interface{}, bool) error); ok {
r0 = rf(ctx, parsedMethod, input, hasMessage)
} else {
r0 = ret.Error(0)
}
return r0
}
// VerifierType provides a mock function with given fields:
func (_m *Plugin) VerifierType() fftypes.FFEnum {
ret := _m.Called()
if len(ret) == 0 {
panic("no return value specified for VerifierType")
}
var r0 fftypes.FFEnum
if rf, ok := ret.Get(0).(func() fftypes.FFEnum); ok {
r0 = rf()
} else {
r0 = ret.Get(0).(fftypes.FFEnum)
}
return r0
}
// NewPlugin creates a new instance of Plugin. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
// The first argument is typically a *testing.T value.
func NewPlugin(t interface {
mock.TestingT
Cleanup(func())
}) *Plugin {
mock := &Plugin{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}