@@ -169,19 +169,19 @@ func (cs *ChaincodeSupport) Stop(ctx context.Context, cccid *ccprovider.CCContex
169
169
}
170
170
171
171
// Launch will launch the chaincode if not running (if running return nil) and will wait for handler of the chaincode to get into ready state.
172
- func (cs * ChaincodeSupport ) Launch (context context.Context , cccid * ccprovider.CCContext , spec ccprovider.ChaincodeSpecGetter ) (* pb.ChaincodeID , * pb. ChaincodeInput , error ) {
172
+ func (cs * ChaincodeSupport ) Launch (context context.Context , cccid * ccprovider.CCContext , spec ccprovider.ChaincodeSpecGetter ) (* pb.ChaincodeInput , error ) {
173
173
cname := cccid .GetCanonicalName ()
174
174
cID := spec .GetChaincodeSpec ().ChaincodeId
175
175
cMsg := spec .GetChaincodeSpec ().Input
176
176
177
177
if cs .HandlerRegistry .Handler (cname ) != nil {
178
- return cID , cMsg , nil
178
+ return cMsg , nil
179
179
}
180
180
181
181
cds , _ := spec .(* pb.ChaincodeDeploymentSpec )
182
182
if cds == nil {
183
183
if cccid .Syscc {
184
- return cID , cMsg , errors .Errorf ("a syscc should be running (it cannot be launched) %s" , cname )
184
+ return cMsg , errors .Errorf ("a syscc should be running (it cannot be launched) %s" , cname )
185
185
}
186
186
187
187
if cs .userRunsCC {
@@ -192,18 +192,18 @@ func (cs *ChaincodeSupport) Launch(context context.Context, cccid *ccprovider.CC
192
192
//(this will also validate the ID from the LSCC if we're not using the config-tree approach)
193
193
depPayload , err := cs .GetCDS (context , cccid .TxID , cccid .SignedProposal , cccid .Proposal , cccid .ChainID , cID .Name )
194
194
if err != nil {
195
- return cID , cMsg , errors .WithMessage (err , fmt .Sprintf ("could not get ChaincodeDeploymentSpec for %s" , cname ))
195
+ return cMsg , errors .WithMessage (err , fmt .Sprintf ("could not get ChaincodeDeploymentSpec for %s" , cname ))
196
196
}
197
197
if depPayload == nil {
198
- return cID , cMsg , errors .WithMessage (err , fmt .Sprintf ("nil ChaincodeDeploymentSpec for %s" , cname ))
198
+ return cMsg , errors .WithMessage (err , fmt .Sprintf ("nil ChaincodeDeploymentSpec for %s" , cname ))
199
199
}
200
200
201
201
cds = & pb.ChaincodeDeploymentSpec {}
202
202
203
203
//Get lang from original deployment
204
204
err = proto .Unmarshal (depPayload , cds )
205
205
if err != nil {
206
- return cID , cMsg , errors .Wrap (err , fmt .Sprintf ("failed to unmarshal deployment transactions for %s" , cname ))
206
+ return cMsg , errors .Wrap (err , fmt .Sprintf ("failed to unmarshal deployment transactions for %s" , cname ))
207
207
}
208
208
}
209
209
@@ -225,7 +225,7 @@ func (cs *ChaincodeSupport) Launch(context context.Context, cccid *ccprovider.CC
225
225
if ! (cs .userRunsCC || cds .ExecEnv == pb .ChaincodeDeploymentSpec_SYSTEM ) {
226
226
ccpack , err := cs .PackageProvider .GetChaincode (cID .Name , cID .Version )
227
227
if err != nil {
228
- return cID , cMsg , err
228
+ return cMsg , err
229
229
}
230
230
231
231
cds = ccpack .GetDepSpec ()
@@ -236,13 +236,13 @@ func (cs *ChaincodeSupport) Launch(context context.Context, cccid *ccprovider.CC
236
236
err := cs .launchAndWaitForReady (context , cccid , cds )
237
237
if err != nil {
238
238
chaincodeLogger .Errorf ("launchAndWaitForReady failed: %+v" , err )
239
- return cID , cMsg , err
239
+ return cMsg , err
240
240
}
241
241
}
242
242
243
- chaincodeLogger .Debug ("LaunchChaincode complete" )
243
+ chaincodeLogger .Debug ("launch complete" )
244
244
245
- return cID , cMsg , nil
245
+ return cMsg , nil
246
246
}
247
247
248
248
// HandleChaincodeStream implements ccintf.HandleChaincodeStream for all vms to call with appropriate stream
@@ -302,7 +302,7 @@ func (cs *ChaincodeSupport) ExecuteSpec(ctxt context.Context, cccid *ccprovider.
302
302
cctyp = pb .ChaincodeMessage_TRANSACTION
303
303
}
304
304
305
- _ , cMsg , err := cs .Launch (ctxt , cccid , spec )
305
+ cMsg , err := cs .Launch (ctxt , cccid , spec )
306
306
if err != nil {
307
307
return nil , nil , err
308
308
}
0 commit comments