github.com/fnagchunpeng/fabric@v2.1.1+incompatible/core/endorser/mocks/plugin.go (about) 1 /* 2 Copyright IBM Corp. All Rights Reserved. 3 4 SPDX-License-Identifier: Apache-2.0 5 */ 6 7 // Code generated by mockery v1.0.0 8 package mocks 9 10 import endorsement "github.com/hyperledger/fabric/core/handlers/endorsement/api" 11 import mock "github.com/stretchr/testify/mock" 12 import peer "github.com/hyperledger/fabric-protos-go/peer" 13 14 // Plugin is an autogenerated mock type for the Plugin type 15 type Plugin struct { 16 mock.Mock 17 } 18 19 // Endorse provides a mock function with given fields: payload, sp 20 func (_m *Plugin) Endorse(payload []byte, sp *peer.SignedProposal) (*peer.Endorsement, []byte, error) { 21 ret := _m.Called(payload, sp) 22 23 var r0 *peer.Endorsement 24 if rf, ok := ret.Get(0).(func([]byte, *peer.SignedProposal) *peer.Endorsement); ok { 25 r0 = rf(payload, sp) 26 } else { 27 if ret.Get(0) != nil { 28 r0 = ret.Get(0).(*peer.Endorsement) 29 } 30 } 31 32 var r1 []byte 33 if rf, ok := ret.Get(1).(func([]byte, *peer.SignedProposal) []byte); ok { 34 r1 = rf(payload, sp) 35 } else { 36 if ret.Get(1) != nil { 37 r1 = ret.Get(1).([]byte) 38 } 39 } 40 41 var r2 error 42 if rf, ok := ret.Get(2).(func([]byte, *peer.SignedProposal) error); ok { 43 r2 = rf(payload, sp) 44 } else { 45 r2 = ret.Error(2) 46 } 47 48 return r0, r1, r2 49 } 50 51 // Init provides a mock function with given fields: dependencies 52 func (_m *Plugin) Init(dependencies ...endorsement.Dependency) error { 53 _va := make([]interface{}, len(dependencies)) 54 for _i := range dependencies { 55 _va[_i] = dependencies[_i] 56 } 57 var _ca []interface{} 58 _ca = append(_ca, _va...) 59 ret := _m.Called(_ca...) 60 61 var r0 error 62 if rf, ok := ret.Get(0).(func(...endorsement.Dependency) error); ok { 63 r0 = rf(dependencies...) 64 } else { 65 r0 = ret.Error(0) 66 } 67 68 return r0 69 }