76
76
* <p>
77
77
* It first examines the "foo" channel and checks that CHAIN_CODE_NAME has been instantiated on the channel,
78
78
* and if not it deploys the chaincode with that name.
79
- *
80
79
*/
81
80
public class NetworkConfigIT {
82
81
@@ -98,8 +97,6 @@ public class NetworkConfigIT {
98
97
99
98
private static NetworkConfig networkConfig ;
100
99
101
-
102
-
103
100
@ BeforeClass
104
101
public static void doMainSetup () throws Exception {
105
102
out ("\n \n \n RUNNING: NetworkConfigIT.\n " );
@@ -108,13 +105,12 @@ public static void doMainSetup() throws Exception {
108
105
configHelper .customizeConfig ();
109
106
110
107
// Use the appropriate TLS/non-TLS network config file
111
- networkConfig = NetworkConfig .fromYamlFile (testConfig .getTestNetworkConfigFileYAML ());
108
+ networkConfig = NetworkConfig .fromYamlFile (testConfig .getTestNetworkConfigFileYAML ());
112
109
113
110
// Ensure the chaincode required for these tests is deployed
114
111
deployChaincodeIfRequired ();
115
112
}
116
113
117
-
118
114
// Determines whether or not the chaincode has been deployed and deploys it if necessary
119
115
private static void deployChaincodeIfRequired () throws Exception {
120
116
@@ -146,7 +142,6 @@ private static HFClient getTheClient() throws Exception {
146
142
return client ;
147
143
}
148
144
149
-
150
145
private static User getAdminUser (String orgName ) throws Exception {
151
146
152
147
NetworkConfig .UserInfo userInfo = networkConfig .getPeerAdmin (orgName );
@@ -155,7 +150,6 @@ private static User getAdminUser(String orgName) throws Exception {
155
150
String userName = userInfo .getEnrollId ();
156
151
String mspId = userInfo .getMspId ();
157
152
158
-
159
153
PrivateKey privateKey = userInfo .getPrivateKey ();
160
154
String signedCert = userInfo .getSignedCert ();
161
155
@@ -165,8 +159,6 @@ private static User getAdminUser(String orgName) throws Exception {
165
159
return admin ;
166
160
}
167
161
168
-
169
-
170
162
@ Test
171
163
public void testUpdate1 () throws Exception {
172
164
@@ -178,7 +170,6 @@ public void testUpdate1() throws Exception {
178
170
.setVersion (CHAIN_CODE_VERSION )
179
171
.setPath (CHAIN_CODE_PATH ).build ();
180
172
181
-
182
173
final String channelName = channel .getName ();
183
174
184
175
out ("Running testUpdate1 - Channel %s" , channelName );
@@ -233,7 +224,6 @@ public void testUpdate1() throws Exception {
233
224
out ("testUpdate1 - done" );
234
225
}
235
226
236
-
237
227
private static void queryChaincodeForExpectedValue (HFClient client , Channel channel , final String expect , ChaincodeID chaincodeID ) {
238
228
239
229
out ("Now query chaincode on channel %s for the value of b expecting to see: %s" , channel .getName (), expect );
@@ -333,7 +323,6 @@ private static CompletableFuture<BlockEvent.TransactionEvent> moveAmount(HFClien
333
323
return channel .sendTransaction (successful );
334
324
}
335
325
336
-
337
326
private static ChaincodeID deployChaincode (HFClient client , Channel channel , String ccName , String ccPath , String ccVersion ) throws Exception {
338
327
339
328
out ("deployChaincode - enter" );
@@ -385,8 +374,6 @@ private static ChaincodeID deployChaincode(HFClient client, Channel channel, Str
385
374
}
386
375
}
387
376
388
- SDKUtils .getProposalConsistencySets (responses );
389
- // }
390
377
out ("Received %d install proposal responses. Successful+verified: %d . Failed: %d" , numInstallProposal , successful .size (), failed .size ());
391
378
392
379
if (failed .size () > 0 ) {
@@ -452,7 +439,6 @@ policy OR(Org1MSP.member, Org2MSP.member) meaning 1 signature from someone in ei
452
439
assertTrue (event .isValid ()); // must be valid to be here.
453
440
out ("Finished instantiate transaction with transaction id %s" , event .getTransactionID ());
454
441
455
-
456
442
} catch (Exception e ) {
457
443
e .printStackTrace ();
458
444
out ("Caught an exception running channel %s" , channel .getName ());
@@ -462,8 +448,6 @@ policy OR(Org1MSP.member, Org2MSP.member) meaning 1 signature from someone in ei
462
448
return chaincodeID ;
463
449
}
464
450
465
-
466
-
467
451
private static Channel constructChannel (HFClient client , String channelName ) throws Exception {
468
452
469
453
//Channel newChannel = client.getChannel(channelName);
@@ -475,7 +459,6 @@ private static Channel constructChannel(HFClient client, String channelName) thr
475
459
return newChannel .initialize ();
476
460
}
477
461
478
-
479
462
// Determines if the specified chaincode has been instantiated on the channel
480
463
private static boolean checkInstantiatedChaincode (Channel channel , Peer peer , String ccName , String ccPath , String ccVersion ) throws InvalidArgumentException , ProposalException {
481
464
out ("Checking instantiated chaincode: %s, at version: %s, on peer: %s" , ccName , ccVersion , peer .getName ());
@@ -494,7 +477,6 @@ private static boolean checkInstantiatedChaincode(Channel channel, Peer peer, St
494
477
return found ;
495
478
}
496
479
497
-
498
480
private static void out (String format , Object ... args ) {
499
481
500
482
System .err .flush ();
@@ -506,5 +488,4 @@ private static void out(String format, Object... args) {
506
488
507
489
}
508
490
509
-
510
491
}
0 commit comments