1
1
/*
2
- Copyright IBM Corp. 2016 All Rights Reserved.
2
+ Copyright IBM Corp. All Rights Reserved.
3
3
4
- Licensed under the Apache License, Version 2.0 (the "License");
5
- you may not use this file except in compliance with the License.
6
- You may obtain a copy of the License at
7
-
8
- http://www.apache.org/licenses/LICENSE-2.0
9
-
10
- Unless required by applicable law or agreed to in writing, software
11
- distributed under the License is distributed on an "AS IS" BASIS,
12
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- See the License for the specific language governing permissions and
14
- limitations under the License.
4
+ SPDX-License-Identifier: Apache-2.0
15
5
*/
16
6
17
7
package inproccontroller
@@ -38,9 +28,11 @@ type inprocContainer struct {
38
28
}
39
29
40
30
var (
41
- inprocLogger = flogging .MustGetLogger ("inproccontroller" )
42
- typeRegistry = make (map [string ]* inprocContainer )
43
- instRegistry = make (map [string ]* inprocContainer )
31
+ inprocLogger = flogging .MustGetLogger ("inproccontroller" )
32
+ typeRegistry = make (map [string ]* inprocContainer )
33
+ instRegistry = make (map [string ]* inprocContainer )
34
+ _shimStartInProc = shim .StartInProc
35
+ _inprocLoggerErrorf = inprocLogger .Errorf
44
36
)
45
37
46
38
// errors
@@ -117,10 +109,10 @@ func (ipc *inprocContainer) launchInProc(ctxt context.Context, id string, args [
117
109
if env == nil {
118
110
env = ipc .env
119
111
}
120
- err := shim . StartInProc (env , args , ipc .chaincode , ccRcvPeerSend , peerRcvCCSend )
112
+ err := _shimStartInProc (env , args , ipc .chaincode , ccRcvPeerSend , peerRcvCCSend )
121
113
if err != nil {
122
114
err = fmt .Errorf ("chaincode-support ended with err: %s" , err )
123
- inprocLogger . Errorf ("%s" , err )
115
+ _inprocLoggerErrorf ("%s" , err )
124
116
}
125
117
inprocLogger .Debugf ("chaincode ended with for %s with err: %s" , id , err )
126
118
}()
@@ -132,7 +124,7 @@ func (ipc *inprocContainer) launchInProc(ctxt context.Context, id string, args [
132
124
err := ccSupport .HandleChaincodeStream (ctxt , inprocStream )
133
125
if err != nil {
134
126
err = fmt .Errorf ("chaincode ended with err: %s" , err )
135
- inprocLogger . Errorf ("%s" , err )
127
+ _inprocLoggerErrorf ("%s" , err )
136
128
}
137
129
inprocLogger .Debugf ("chaincode-support ended with for %s with err: %s" , id , err )
138
130
}()
@@ -149,7 +141,6 @@ func (ipc *inprocContainer) launchInProc(ctxt context.Context, id string, args [
149
141
close (peerRcvCCSend )
150
142
inprocLogger .Debugf ("chaincode %s stopped" , id )
151
143
}
152
-
153
144
return err
154
145
}
155
146
0 commit comments