@@ -251,18 +251,6 @@ func (lccc *LifeCycleSysCC) getChaincode(stub shim.ChaincodeStubInterface, ccnam
251
251
return nil , nil , NotFoundErr (ccname )
252
252
}
253
253
254
- //getChaincodeDeploymentSpec returns a ChaincodeDeploymentSpec given args
255
- func (lccc * LifeCycleSysCC ) getChaincodeDeploymentSpec (code []byte ) (* pb.ChaincodeDeploymentSpec , error ) {
256
- cds := & pb.ChaincodeDeploymentSpec {}
257
-
258
- err := proto .Unmarshal (code , cds )
259
- if err != nil {
260
- return nil , InvalidDeploymentSpecErr (err .Error ())
261
- }
262
-
263
- return cds , nil
264
- }
265
-
266
254
// getChaincodes returns all chaincodes instantiated on this LCCC's channel
267
255
func (lccc * LifeCycleSysCC ) getChaincodes (stub shim.ChaincodeStubInterface ) pb.Response {
268
256
// get all rows from LCCC
@@ -343,7 +331,7 @@ func (lccc *LifeCycleSysCC) isValidChaincodeName(chaincodename string) bool {
343
331
344
332
//this implements "install" Invoke transaction
345
333
func (lccc * LifeCycleSysCC ) executeInstall (stub shim.ChaincodeStubInterface , depSpec []byte ) error {
346
- cds , err := lccc . getChaincodeDeploymentSpec (depSpec )
334
+ cds , err := utils . GetChaincodeDeploymentSpec (depSpec )
347
335
348
336
if err != nil {
349
337
return err
@@ -366,7 +354,7 @@ func (lccc *LifeCycleSysCC) executeInstall(stub shim.ChaincodeStubInterface, dep
366
354
367
355
//this implements "deploy" Invoke transaction
368
356
func (lccc * LifeCycleSysCC ) executeDeploy (stub shim.ChaincodeStubInterface , chainname string , depSpec []byte , policy []byte , escc []byte , vscc []byte ) error {
369
- cds , err := lccc . getChaincodeDeploymentSpec (depSpec )
357
+ cds , err := utils . GetChaincodeDeploymentSpec (depSpec )
370
358
371
359
if err != nil {
372
360
return err
@@ -420,7 +408,7 @@ func (lccc *LifeCycleSysCC) getUpgradeVersion(cd *ccprovider.ChaincodeData, cds
420
408
421
409
//this implements "upgrade" Invoke transaction
422
410
func (lccc * LifeCycleSysCC ) executeUpgrade (stub shim.ChaincodeStubInterface , chainName string , depSpec []byte , policy []byte , escc []byte , vscc []byte ) ([]byte , error ) {
423
- cds , err := lccc . getChaincodeDeploymentSpec (depSpec )
411
+ cds , err := utils . GetChaincodeDeploymentSpec (depSpec )
424
412
if err != nil {
425
413
return nil , err
426
414
}
0 commit comments