Skip to content

Commit 1150c6b

Browse files
committed
extension
Signed-off-by: Angelo De Caro <adc@zurich.ibm.com>
1 parent 03fcbdc commit 1150c6b

File tree

2 files changed

+20
-0
lines changed
  • integration/nwo/token/fabric/cc
  • token/services/network/fabric/tcc

2 files changed

+20
-0
lines changed

integration/nwo/token/fabric/cc/tcc.go

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ type GenericBackend struct {
4646
TokenChaincodePath string
4747
TokenChaincodeParamsReplaceSuffix string
4848
TokenPlatform common2.TokenPlatform
49+
50+
// SkipPaths is a list of substrings that if contained in a path will make that path to be skipped
51+
SkipPaths []string
4952
}
5053

5154
func NewDefaultGenericBackend(tokenPlatform common2.TokenPlatform) *GenericBackend {
@@ -142,6 +145,14 @@ func (p *GenericBackend) UpdatePublicParams(tms *topology3.TMS, ppRaw []byte) {
142145
logger.Debugf("replace [%s:%s]? Yes, this is tcc params", filePath, fileName)
143146
return "", paramsFile.Bytes()
144147
}
148+
149+
for _, skipPath := range p.SkipPaths {
150+
if strings.Contains(filePath, skipPath) {
151+
logger.Debugf("skipping [%s:%s]? Yes", filePath, fileName)
152+
return "", []byte{0}
153+
}
154+
}
155+
145156
return "", nil
146157
},
147158
)
@@ -175,6 +186,7 @@ func (p *GenericBackend) tccSetup(tms *topology3.TMS, cc *topology.ChannelChainc
175186
gomega.Expect(os.MkdirAll(packageDir, 0766)).ToNot(gomega.HaveOccurred())
176187
paramsFile := PublicParamsTemplate(ppRaw)
177188
port := p.TokenPlatform.GetContext().ReservePort()
189+
178190
err = packager.New().PackageChaincode(
179191
cc.Chaincode.Path,
180192
cc.Chaincode.Lang,
@@ -188,6 +200,13 @@ func (p *GenericBackend) tccSetup(tms *topology3.TMS, cc *topology.ChannelChainc
188200
return "", paramsFile.Bytes()
189201
}
190202

203+
for _, skipPath := range p.SkipPaths {
204+
if strings.Contains(filePath, skipPath) {
205+
logger.Debugf("skipping [%s:%s]? Yes", filePath, fileName)
206+
return "", []byte{0}
207+
}
208+
}
209+
191210
// Is connection.json?
192211
if filePath == fileName && filePath == "connection.json" {
193212
// Connection holds the path and type for a chaincode package

token/services/network/fabric/tcc/params.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ Copyright IBM Corp. All Rights Reserved.
33
44
SPDX-License-Identifier: Apache-2.0
55
*/
6+
67
package tcc
78

89
var Params = ``

0 commit comments

Comments
 (0)