@@ -56,7 +56,7 @@ public void test1ConsensusService() throws ConfigException, ContractException {
56
56
try {
57
57
BcosSDK sdk = new BcosSDK (configFile );
58
58
Client client = sdk .getClient (Integer .valueOf (1 ));
59
- ConsensusService consensusService = new ConsensusService (client , sdk .getCryptoInterface ());
59
+ ConsensusService consensusService = new ConsensusService (client , client .getCryptoInterface ());
60
60
// get the current sealerList
61
61
List <String > sealerList = client .getSealerList ().getResult ();
62
62
@@ -118,11 +118,11 @@ public void test2CnsService() throws ConfigException {
118
118
try {
119
119
BcosSDK sdk = new BcosSDK (configFile );
120
120
Client client = sdk .getClient (Integer .valueOf (1 ));
121
- HelloWorld helloWorld = HelloWorld .deploy (client , sdk .getCryptoInterface ());
121
+ HelloWorld helloWorld = HelloWorld .deploy (client , client .getCryptoInterface ());
122
122
String contractAddress = helloWorld .getContractAddress ();
123
123
String contractName = "HelloWorld" ;
124
124
String contractVersion = "1.0" ;
125
- CnsService cnsService = new CnsService (client , sdk .getCryptoInterface ());
125
+ CnsService cnsService = new CnsService (client , client .getCryptoInterface ());
126
126
RetCode retCode = cnsService .registerCNS (contractName , contractVersion , contractAddress , "" );
127
127
// query the cns information
128
128
List <CnsInfo > cnsInfos = cnsService .selectByName (contractName );
@@ -161,7 +161,7 @@ public void test2CnsService() throws ConfigException {
161
161
Assert .assertTrue (cnsService .getContractAddress (contractName , contractVersion2 ).equals (contractAddress ));
162
162
}
163
163
// insert anther cns for other contract
164
- HelloWorld helloWorld2 = HelloWorld .deploy (client , sdk .getCryptoInterface ());
164
+ HelloWorld helloWorld2 = HelloWorld .deploy (client , client .getCryptoInterface ());
165
165
String contractAddress2 = helloWorld2 .getContractAddress ();
166
166
String contractName2 = "hello" ;
167
167
retCode = cnsService .registerCNS (contractName2 , contractVersion , contractAddress2 , "" );
@@ -183,7 +183,7 @@ public void test3SystemConfigService() throws ConfigException, ContractException
183
183
{
184
184
BcosSDK sdk = new BcosSDK (configFile );
185
185
Client client = sdk .getClient (Integer .valueOf (1 ));
186
- SystemConfigService systemConfigService = new SystemConfigService (client , sdk .getCryptoInterface ());
186
+ SystemConfigService systemConfigService = new SystemConfigService (client , client .getCryptoInterface ());
187
187
testSystemConfigService (client , systemConfigService , "tx_count_limit" );
188
188
testSystemConfigService (client , systemConfigService ,"tx_gas_limit" );
189
189
}
@@ -209,7 +209,7 @@ public void test5CRUDService() throws ConfigException, ContractException {
209
209
try {
210
210
BcosSDK sdk = new BcosSDK (configFile );
211
211
Client client = sdk .getClient (Integer .valueOf (1 ));
212
- TableCRUDService tableCRUDService = new TableCRUDService (client , sdk .getCryptoInterface ());
212
+ TableCRUDService tableCRUDService = new TableCRUDService (client , client .getCryptoInterface ());
213
213
// create a user table
214
214
String tableName = "test" ;
215
215
String key = "key" ;
@@ -256,14 +256,14 @@ public void test6PermissionService() throws ConfigException, ContractException {
256
256
try {
257
257
BcosSDK sdk = new BcosSDK (configFile );
258
258
Client client = sdk .getClient (Integer .valueOf (1 ));
259
- CryptoInterface cryptoInterface = sdk .getCryptoInterface ();
259
+ CryptoInterface cryptoInterface = client .getCryptoInterface ();
260
260
PermissionService permissionService = new PermissionService (client , cryptoInterface );
261
261
262
262
String tableName = "test" ;
263
263
permissionService .grantPermission (tableName , cryptoInterface .getCryptoKeyPair ().getAddress ());
264
264
265
265
// insert data to the table with the account without permission
266
- CryptoInterface invalidCryptoInterface = new CryptoInterface (sdk .getCryptoInterface ().getCryptoTypeConfig ());
266
+ CryptoInterface invalidCryptoInterface = new CryptoInterface (client .getCryptoInterface ().getCryptoTypeConfig ());
267
267
TableCRUDService tableCRUDService = new TableCRUDService (client , invalidCryptoInterface );
268
268
String key = "key2" ;
269
269
Map <String , String > value = new HashMap <>(5 );
@@ -295,7 +295,7 @@ public void test7ContractLifeCycleService() throws ConfigException {
295
295
try {
296
296
BcosSDK sdk = new BcosSDK (configFile );
297
297
Client client = sdk .getClient (Integer .valueOf (1 ));
298
- CryptoInterface cryptoInterface = sdk .getCryptoInterface ();
298
+ CryptoInterface cryptoInterface = client .getCryptoInterface ();
299
299
ContractLifeCycleService contractLifeCycleService = new ContractLifeCycleService (client , cryptoInterface );
300
300
// deploy a helloWorld
301
301
HelloWorld helloWorld = HelloWorld .deploy (client , cryptoInterface );
@@ -318,7 +318,7 @@ public void test7ContractLifeCycleService() throws ConfigException {
318
318
value = helloWorld .get ();
319
319
Assert .assertTrue ("Hello, Fisco1" .equals (value ));
320
320
// grant Manager
321
- CryptoInterface cryptoInterface1 = new CryptoInterface (sdk .getCryptoInterface ().getCryptoTypeConfig ());
321
+ CryptoInterface cryptoInterface1 = new CryptoInterface (client .getCryptoInterface ().getCryptoTypeConfig ());
322
322
ContractLifeCycleService contractLifeCycleService1 = new ContractLifeCycleService (client , cryptoInterface1 );
323
323
// freeze contract without grant manager
324
324
RetCode retCode = contractLifeCycleService1 .freeze (helloWorld .getContractAddress ());
@@ -345,7 +345,7 @@ public void test8GovernanceService() throws ConfigException {
345
345
try {
346
346
BcosSDK sdk = new BcosSDK (configFile );
347
347
Client client = sdk .getClient (Integer .valueOf (1 ));
348
- CryptoInterface cryptoInterface = sdk .getCryptoInterface ();
348
+ CryptoInterface cryptoInterface = client .getCryptoInterface ();
349
349
ChainGovernanceService chainGovernanceService = new ChainGovernanceService (client , cryptoInterface );
350
350
351
351
List <PermissionInfo > orgPermissionInfos = chainGovernanceService .listCommitteeMembers ();
@@ -360,12 +360,12 @@ public void test8GovernanceService() throws ConfigException {
360
360
361
361
// create a new account and grantOperator
362
362
int orgOperatorSize = chainGovernanceService .listOperators ().size ();
363
- CryptoInterface cryptoInterface1 = new CryptoInterface (sdk .getCryptoInterface ().getCryptoTypeConfig ());
363
+ CryptoInterface cryptoInterface1 = new CryptoInterface (client .getCryptoInterface ().getCryptoTypeConfig ());
364
364
chainGovernanceService .grantOperator (cryptoInterface1 .getCryptoKeyPair ().getAddress ());
365
365
Assert .assertTrue (chainGovernanceService .listOperators ().size () == orgOperatorSize + 1 );
366
366
367
367
// only the committeeMember can freeze account
368
- CryptoInterface cryptoInterface2 = new CryptoInterface (sdk .getCryptoInterface ().getCryptoTypeConfig ());
368
+ CryptoInterface cryptoInterface2 = new CryptoInterface (client .getCryptoInterface ().getCryptoTypeConfig ());
369
369
chainGovernanceService .grantOperator (cryptoInterface2 .getCryptoKeyPair ().getAddress ());
370
370
// create the account
371
371
HelloWorld helloWorld = HelloWorld .deploy (client , cryptoInterface2 );
0 commit comments