@@ -101,6 +101,8 @@ public void test1HelloWorld() throws Exception {
101
101
transactionProcessor .sendTransactionAndGetResponseByContractLoader (
102
102
"HelloWorld" , helloWorldAddrss , "set" , params );
103
103
Assert .assertEquals ("0x0" , res .getTransactionReceipt ().getStatus ());
104
+ Assert .assertEquals ("test" , res .getInputObject ().get (0 ));
105
+ // System.out.println(JsonUtils.toJson(res));
104
106
105
107
// test call by contract loader
106
108
CallResponse callResponse2 =
@@ -293,7 +295,6 @@ public void onResponse(TransactionReceipt receipt) {
293
295
abi ,
294
296
"getUint256" ,
295
297
Lists .newArrayList ());
296
- // System.out.println(JsonUtils.toJson(callResponse3));
297
298
Assert .assertEquals ("Success" , callResponse3 .getReturnMessage ());
298
299
} catch (TransactionBaseException | ABICodecException e ) {
299
300
System .out .println (e .getMessage ());
@@ -313,6 +314,7 @@ public void test6ComplexSetValues() throws Exception {
313
314
params .add ("test2" );
314
315
TransactionResponse response =
315
316
transactionProcessor .deployByContractLoader ("ComplexSol" , params );
317
+ // System.out.println(JsonUtils.toJson(response));
316
318
if (!response .getTransactionReceipt ().getStatus ().equals ("0x0" )) {
317
319
return ;
318
320
}
@@ -322,14 +324,14 @@ public void test6ComplexSetValues() throws Exception {
322
324
String [] o = {"0x1" , "0x2" , "0x3" };
323
325
List <String > a = Arrays .asList (o );
324
326
paramsSetValues .add (a );
325
- paramsSetValues .add ("set values 字符串 " );
327
+ paramsSetValues .add ("set values 字符 " );
326
328
TransactionResponse transactionResponse =
327
329
transactionProcessor .sendTransactionAndGetResponse (
328
330
contractAddress , abi , "setValues" , paramsSetValues );
329
331
// System.out.println(JsonUtils.toJson(transactionResponse));
330
332
Map <String , List <List <Object >>> eventsMap = transactionResponse .getEventResultMap ();
331
333
Assert .assertEquals (1 , eventsMap .size ());
332
- Assert .assertEquals ("set values 字符串 " , eventsMap .get ("LogSetValues" ).get (0 ).get (2 ));
334
+ Assert .assertEquals ("set values 字符 " , eventsMap .get ("LogSetValues" ).get (0 ).get (2 ));
333
335
}
334
336
335
337
@ Test
@@ -401,4 +403,31 @@ public void test8ComplexSetBytesFuture() throws Exception {
401
403
Assert .assertEquals ("0x0" , response .getTransactionReceipt ().getStatus ());
402
404
});
403
405
}
406
+
407
+ @ Test
408
+ public void test9ComplexIncrementInputParser () throws Exception {
409
+ AssembleTransactionProcessor transactionProcessor =
410
+ TransactionProcessorFactory .createAssembleTransactionProcessor (
411
+ client , cryptoKeyPair , abiFile , binFile );
412
+ // deploy
413
+ List <Object > params = Lists .newArrayList ();
414
+ params .add (1 );
415
+ params .add ("test2" );
416
+ TransactionResponse response =
417
+ transactionProcessor .deployByContractLoader ("ComplexSol" , params );
418
+ if (!response .getTransactionReceipt ().getStatus ().equals ("0x0" )) {
419
+ return ;
420
+ }
421
+ Assert .assertEquals (2 , response .getInputABIObject ().size ());
422
+ Assert .assertEquals ("test2" , response .getInputObject ().get (1 ));
423
+ String contractAddress = response .getContractAddress ();
424
+ // increment v
425
+ TransactionResponse transactionResponse =
426
+ transactionProcessor .sendTransactionAndGetResponse (
427
+ contractAddress ,
428
+ abi ,
429
+ "incrementUint256" ,
430
+ Lists .newArrayList (BigInteger .valueOf (10 )));
431
+ Assert .assertEquals (BigInteger .valueOf (10 ), transactionResponse .getInputObject ().get (0 ));
432
+ }
404
433
}
0 commit comments