File tree Expand file tree Collapse file tree 1 file changed +21
-5
lines changed
Expand file tree Collapse file tree 1 file changed +21
-5
lines changed Original file line number Diff line number Diff line change @@ -185,18 +185,34 @@ describe("extend config", () => {
185185
186186 it ( "should throw an error for duplicate chaincode names across different channels" , ( ) => {
187187 // Given
188- commands . fabloExec ( "init node " ) ;
188+ commands . fabloExec ( "init" ) ;
189189 const configPath = `${ commands . workdir } /fablo-config.json` ;
190- const config = JSON . parse ( fs . readFileSync ( configPath , "utf8" ) ) as FabloConfigJson ;
190+ // const config = JSON.parse(fs.readFileSync(configPath, "utf8")) as FabloConfigJson;
191+ const config = JSON . parse ( commands . getFileContent ( "fablo-config.json" ) ) as FabloConfigJson ;
191192
192193 config . channels . push ( {
193194 name : "my-channel2" ,
194195 orgs : [ { name : "Org1" , peers : [ "peer0" ] } ] ,
195196 } ) ;
196197
197- const existingChaincode = JSON . parse ( JSON . stringify ( config . chaincodes [ 0 ] ) ) ;
198- existingChaincode . channel = "my-channel2" ;
199- config . chaincodes . push ( existingChaincode ) ;
198+ config . chaincodes . push (
199+ {
200+ name : "chaincode1" ,
201+ version : "1.0" ,
202+ channel : "my-channel" ,
203+ lang : "node" ,
204+ directory : "./samples/chaincodes/chaincode-kv-node" ,
205+ privateData : [ ] ,
206+ } ,
207+ {
208+ name : "chaincode1" ,
209+ version : "1.0" ,
210+ channel : "my-channel2" ,
211+ lang : "node" ,
212+ directory : "./samples/chaincodes/chaincode-kv-node" ,
213+ privateData : [ ] ,
214+ } ,
215+ ) ;
200216
201217 fs . writeFileSync ( configPath , JSON . stringify ( config , null , 2 ) ) ;
202218
You can’t perform that action at this time.
0 commit comments