1
1
/*
2
2
Copyright IBM Corp. 2016 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 txvalidator
@@ -403,9 +393,9 @@ func (v *vsccValidatorImpl) GetInfoForValidate(txid, chID, ccID string) (*sysccp
403
393
vscc := & sysccprovider.ChaincodeInstance {ChainID : chID }
404
394
var policy []byte
405
395
var err error
406
- if ccID != "lscc" {
407
- // when we are validating any chaincode other than
408
- // LSCC , we need to ask LSCC to give us the name
396
+ if ! sysccprovider . GetSystemChaincodeProvider (). IsSysCC ( ccID ) {
397
+ // when we are validating a chaincode that is not a
398
+ // system CC , we need to ask the CC to give us the name
409
399
// of VSCC and of the policy that should be used
410
400
411
401
// obtain name of the VSCC and the policy from LSCC
@@ -420,10 +410,10 @@ func (v *vsccValidatorImpl) GetInfoForValidate(txid, chID, ccID string) (*sysccp
420
410
vscc .ChaincodeName = cd .Vscc
421
411
policy = cd .Policy
422
412
} else {
423
- // when we are validating LSCC , we use the default
413
+ // when we are validating a system CC , we use the default
424
414
// VSCC and a default policy that requires one signature
425
415
// from any of the members of the channel
426
- cc .ChaincodeName = "lscc"
416
+ cc .ChaincodeName = ccID
427
417
cc .ChaincodeVersion = coreUtil .GetSysCCVersion ()
428
418
vscc .ChaincodeName = "vscc"
429
419
p := cauthdsl .SignedByAnyMember (v .support .GetMSPIDs (chID ))
0 commit comments