@@ -49,8 +49,8 @@ public class ContractGrammar001 {
49
49
byte [] contractAddress = null ;
50
50
51
51
ECKey ecKey1 = new ECKey (Utils .getRandom ());
52
- byte [] asset016Address = ecKey1 .getAddress ();
53
- String testKeyForAssetIssue016 = ByteArray .toHexString (ecKey1 .getPrivKeyBytes ());
52
+ byte [] grammarAddress = ecKey1 .getAddress ();
53
+ String testKeyForGrammarAddress = ByteArray .toHexString (ecKey1 .getPrivKeyBytes ());
54
54
55
55
56
56
@ BeforeSuite
@@ -61,7 +61,7 @@ public void beforeSuite() {
61
61
62
62
@ BeforeClass (enabled = true )
63
63
public void beforeClass () {
64
- PublicMethed .printAddress (testKeyForAssetIssue016 );
64
+ PublicMethed .printAddress (testKeyForGrammarAddress );
65
65
channelFull = ManagedChannelBuilder .forTarget (fullnode )
66
66
.usePlaintext (true )
67
67
.build ();
@@ -78,7 +78,7 @@ public void beforeClass() {
78
78
@ Test (enabled = true )
79
79
public void testGrammar001 () {
80
80
PublicMethed
81
- .sendcoin (asset016Address , 100000000000L , testNetAccountAddress , testNetAccountKey ,
81
+ .sendcoin (grammarAddress , 100000000000L , testNetAccountAddress , testNetAccountKey ,
82
82
blockingStubFull );
83
83
String contractName = "FunctionSelector" ;
84
84
String code = "608060405234801561001057600080fd5b50610105806100206000396000f30060806040526004"
@@ -98,13 +98,13 @@ public void testGrammar001() {
98
98
+ ",\" type\" :\" uint256\" }],\" payable\" :false,\" stateMutability\" :\" nonpayable\" ,\" type\" "
99
99
+ ":\" function\" }]" ;
100
100
contractAddress = PublicMethed .deployContract (contractName , abi , code , "" , maxFeeLimit ,
101
- 0L , 100 , null , testKeyForAssetIssue016 ,
102
- asset016Address , blockingStubFull );
101
+ 0L , 100 , null , testKeyForGrammarAddress ,
102
+ grammarAddress , blockingStubFull );
103
103
String txid = "" ;
104
104
String num = "true" + "," + "10" ;
105
105
txid = PublicMethed .triggerContract (contractAddress ,
106
106
"select(bool,uint256)" , num , false ,
107
- 0 , maxFeeLimit , asset016Address , testKeyForAssetIssue016 , blockingStubFull );
107
+ 0 , maxFeeLimit , grammarAddress , testKeyForGrammarAddress , blockingStubFull );
108
108
Optional <TransactionInfo > infoById = null ;
109
109
infoById = PublicMethed .getTransactionInfoById (txid , blockingStubFull );
110
110
Long returnnumber = ByteArray .toLong (ByteArray .fromHexString (ByteArray .toHexString (
@@ -115,7 +115,7 @@ public void testGrammar001() {
115
115
String num2 = "false" + "," + "10" ;
116
116
txid = PublicMethed .triggerContract (contractAddress ,
117
117
"select(bool,uint256)" , num2 , false ,
118
- 0 , maxFeeLimit , asset016Address , testKeyForAssetIssue016 , blockingStubFull );
118
+ 0 , maxFeeLimit , grammarAddress , testKeyForGrammarAddress , blockingStubFull );
119
119
infoById = PublicMethed .getTransactionInfoById (txid , blockingStubFull );
120
120
Long returnnumber2 = ByteArray .toLong (ByteArray .fromHexString (
121
121
ByteArray .toHexString (infoById .get ().getContractResult (0 ).toByteArray ())));
@@ -148,8 +148,8 @@ public void testGrammar002() {
148
148
+ "\" insert\" ,\" outputs\" :[{\" name\" :\" \" ,\" type\" :\" bool\" }],\" payable\" :false,\" "
149
149
+ "stateMutability\" :\" nonpayable\" ,\" type\" :\" function\" }]" ;
150
150
contractAddress = PublicMethed .deployContract (contractName , abi , code , "" , maxFeeLimit ,
151
- 0L , 100 , null , testKeyForAssetIssue016 ,
152
- asset016Address , blockingStubFull );
151
+ 0L , 100 , null , testKeyForGrammarAddress ,
152
+ grammarAddress , blockingStubFull );
153
153
String txid = "" ;
154
154
String num = "1" ;
155
155
byte [] contractAddress1 = null ;
@@ -169,11 +169,11 @@ public void testGrammar002() {
169
169
String libraryAddress =
170
170
"browser/TvmTest_p1_Grammar_002.sol:S:" + Base58 .encode58Check (contractAddress );
171
171
contractAddress1 = PublicMethed .deployContract (contractName1 , abi1 , code1 , "" , maxFeeLimit ,
172
- 0L , 100 , libraryAddress , testKeyForAssetIssue016 ,
173
- asset016Address , blockingStubFull );
172
+ 0L , 100 , libraryAddress , testKeyForGrammarAddress ,
173
+ grammarAddress , blockingStubFull );
174
174
txid = PublicMethed .triggerContract (contractAddress1 ,
175
175
"register(uint256)" , num , false ,
176
- 0 , maxFeeLimit , asset016Address , testKeyForAssetIssue016 , blockingStubFull );
176
+ 0 , maxFeeLimit , grammarAddress , testKeyForGrammarAddress , blockingStubFull );
177
177
Optional <TransactionInfo > infoById = null ;
178
178
infoById = PublicMethed .getTransactionInfoById (txid , blockingStubFull1 );
179
179
@@ -205,8 +205,8 @@ public void testGrammar003() {
205
205
+ ":\" insert\" ,\" outputs\" :[{\" name\" :\" \" ,\" type\" :\" bool\" }],\" payable\" :false,\" "
206
206
+ "stateMutability\" :\" nonpayable\" ,\" type\" :\" function\" }]" ;
207
207
contractAddress = PublicMethed .deployContract (contractName , abi , code , "" , maxFeeLimit ,
208
- 0L , 100 , null , testKeyForAssetIssue016 ,
209
- asset016Address , blockingStubFull );
208
+ 0L , 100 , null , testKeyForGrammarAddress ,
209
+ grammarAddress , blockingStubFull );
210
210
String txid = "" ;
211
211
String num = "1" ;
212
212
byte [] contractAddress1 = null ;
@@ -225,11 +225,11 @@ public void testGrammar003() {
225
225
String libraryAddress =
226
226
"browser/TvmTest_p1_Grammar_003.sol:S:" + Base58 .encode58Check (contractAddress );
227
227
contractAddress1 = PublicMethed .deployContract (contractName1 , abi1 , code1 , "" , maxFeeLimit ,
228
- 0L , 100 , libraryAddress , testKeyForAssetIssue016 ,
229
- asset016Address , blockingStubFull );
228
+ 0L , 100 , libraryAddress , testKeyForGrammarAddress ,
229
+ grammarAddress , blockingStubFull );
230
230
txid = PublicMethed .triggerContract (contractAddress1 ,
231
231
"register(uint256)" , num , false ,
232
- 0 , maxFeeLimit , asset016Address , testKeyForAssetIssue016 , blockingStubFull );
232
+ 0 , maxFeeLimit , grammarAddress , testKeyForGrammarAddress , blockingStubFull );
233
233
Optional <TransactionInfo > infoById = null ;
234
234
infoById = PublicMethed .getTransactionInfoById (txid , blockingStubFull1 );
235
235
@@ -252,8 +252,8 @@ public void testGrammar004() {
252
252
+ "[{\" name\" :\" \" ,\" type\" :\" uint256\" }],\" payable\" :false,\" stateMutability\" :\" "
253
253
+ "nonpayable\" ,\" type\" :\" function\" }]" ;
254
254
contractAddress = PublicMethed .deployContract (contractName , abi , code , "" , maxFeeLimit ,
255
- 0L , 100 , null , testKeyForAssetIssue016 ,
256
- asset016Address , blockingStubFull );
255
+ 0L , 100 , null , testKeyForGrammarAddress ,
256
+ grammarAddress , blockingStubFull );
257
257
String txid = "" ;
258
258
String num = "1" ;
259
259
byte [] contractAddress1 = null ;
@@ -289,15 +289,15 @@ public void testGrammar004() {
289
289
libraryAddress =
290
290
"browser/TvmTest_p1_Grammar_004.sol:S:" + Base58 .encode58Check (contractAddress );
291
291
contractAddress1 = PublicMethed .deployContract (contractName1 , abi1 , code1 , "" , maxFeeLimit ,
292
- 0L , 100 , libraryAddress , testKeyForAssetIssue016 ,
293
- asset016Address , blockingStubFull );
292
+ 0L , 100 , libraryAddress , testKeyForGrammarAddress ,
293
+ grammarAddress , blockingStubFull );
294
294
txid = PublicMethed .triggerContract (contractAddress1 ,
295
295
"append(uint256)" , num , false ,
296
- 0 , maxFeeLimit , asset016Address , testKeyForAssetIssue016 , blockingStubFull );
296
+ 0 , maxFeeLimit , grammarAddress , testKeyForGrammarAddress , blockingStubFull );
297
297
String num1 = "0" ;
298
298
String txid1 = PublicMethed .triggerContract (contractAddress1 ,
299
299
"getData(uint256)" , num1 , false ,
300
- 0 , maxFeeLimit , asset016Address , testKeyForAssetIssue016 , blockingStubFull );
300
+ 0 , maxFeeLimit , grammarAddress , testKeyForGrammarAddress , blockingStubFull );
301
301
Optional <TransactionInfo > infoById = null ;
302
302
infoById = PublicMethed .getTransactionInfoById (txid1 , blockingStubFull );
303
303
Long returnnumber = ByteArray .toLong (ByteArray
@@ -308,13 +308,13 @@ public void testGrammar004() {
308
308
String num2 = "1" + "," + "2" ;
309
309
String txid2 = PublicMethed .triggerContract (contractAddress1 ,
310
310
"replace(uint256,uint256)" , num2 , false ,
311
- 0 , maxFeeLimit , asset016Address , testKeyForAssetIssue016 , blockingStubFull );
311
+ 0 , maxFeeLimit , grammarAddress , testKeyForGrammarAddress , blockingStubFull );
312
312
Optional <TransactionInfo > infoById2 = null ;
313
313
infoById2 = PublicMethed .getTransactionInfoById (txid2 , blockingStubFull );
314
314
Assert .assertTrue (infoById2 .get ().getResultValue () == 0 );
315
315
String txid3 = PublicMethed .triggerContract (contractAddress1 ,
316
316
"getData(uint256)" , num1 , false ,
317
- 0 , maxFeeLimit , asset016Address , testKeyForAssetIssue016 , blockingStubFull );
317
+ 0 , maxFeeLimit , grammarAddress , testKeyForGrammarAddress , blockingStubFull );
318
318
Optional <TransactionInfo > infoById1 = null ;
319
319
infoById1 = PublicMethed .getTransactionInfoById (txid3 , blockingStubFull );
320
320
Long returnnumber1 = ByteArray .toLong (ByteArray
@@ -352,67 +352,67 @@ public void testGrammar006() {
352
352
+ "\" :[{\" name\" :\" x\" ,\" type\" :\" uint256\" }],\" name\" :\" d2\" ,\" outputs\" :[],\" payable"
353
353
+ "\" :false,\" stateMutability\" :\" nonpayable\" ,\" type\" :\" function\" }]" ;
354
354
contractAddress = PublicMethed .deployContract (contractName , abi , code , "" , maxFeeLimit ,
355
- 0L , 100 , null , testKeyForAssetIssue016 ,
356
- asset016Address , blockingStubFull );
355
+ 0L , 100 , null , testKeyForGrammarAddress ,
356
+ grammarAddress , blockingStubFull );
357
357
String txid = "" ;
358
358
String number = "1" ;
359
359
String txid1 = PublicMethed .triggerContract (contractAddress ,
360
360
"f(uint256)" , number , false ,
361
- 0 , maxFeeLimit , asset016Address , testKeyForAssetIssue016 , blockingStubFull );
361
+ 0 , maxFeeLimit , grammarAddress , testKeyForGrammarAddress , blockingStubFull );
362
362
Optional <TransactionInfo > infoById1 = PublicMethed
363
363
.getTransactionInfoById (txid1 , blockingStubFull1 );
364
364
365
365
Assert .assertTrue (infoById1 .get ().getResultValue () == 0 );
366
366
367
367
String txid2 = PublicMethed .triggerContract (contractAddress ,
368
368
"d(bytes32)" , number , false ,
369
- 0 , maxFeeLimit , asset016Address , testKeyForAssetIssue016 , blockingStubFull );
369
+ 0 , maxFeeLimit , grammarAddress , testKeyForGrammarAddress , blockingStubFull );
370
370
Optional <TransactionInfo > infoById2 = PublicMethed
371
371
.getTransactionInfoById (txid2 , blockingStubFull1 );
372
372
373
373
Assert .assertTrue (infoById2 .get ().getResultValue () == 0 );
374
374
375
375
String txid3 = PublicMethed .triggerContract (contractAddress ,
376
376
"d1(bytes32)" , number , false ,
377
- 0 , maxFeeLimit , asset016Address , testKeyForAssetIssue016 , blockingStubFull );
377
+ 0 , maxFeeLimit , grammarAddress , testKeyForGrammarAddress , blockingStubFull );
378
378
Optional <TransactionInfo > infoById3 = PublicMethed
379
379
.getTransactionInfoById (txid3 , blockingStubFull1 );
380
380
381
381
Assert .assertTrue (infoById3 .get ().getResultValue () == 0 );
382
382
383
383
String txid4 = PublicMethed .triggerContract (contractAddress ,
384
384
"d2(bytes32)" , number , false ,
385
- 0 , maxFeeLimit , asset016Address , testKeyForAssetIssue016 , blockingStubFull );
385
+ 0 , maxFeeLimit , grammarAddress , testKeyForGrammarAddress , blockingStubFull );
386
386
Optional <TransactionInfo > infoById4 = PublicMethed
387
387
.getTransactionInfoById (txid4 , blockingStubFull1 );
388
388
389
389
Assert .assertTrue (infoById4 .get ().getResultValue () == 0 );
390
390
391
391
String txid5 = PublicMethed .triggerContract (contractAddress ,
392
392
"d3(bytes32)" , number , false ,
393
- 0 , maxFeeLimit , asset016Address , testKeyForAssetIssue016 , blockingStubFull );
393
+ 0 , maxFeeLimit , grammarAddress , testKeyForGrammarAddress , blockingStubFull );
394
394
Optional <TransactionInfo > infoById5 = PublicMethed
395
395
.getTransactionInfoById (txid5 , blockingStubFull1 );
396
396
397
397
Assert .assertTrue (infoById5 .get ().getResultValue () == 0 );
398
398
399
399
String txid6 = PublicMethed .triggerContract (contractAddress ,
400
400
"d4(bytes32)" , number , false ,
401
- 0 , maxFeeLimit , asset016Address , testKeyForAssetIssue016 , blockingStubFull );
401
+ 0 , maxFeeLimit , grammarAddress , testKeyForGrammarAddress , blockingStubFull );
402
402
Optional <TransactionInfo > infoById6 = PublicMethed
403
403
.getTransactionInfoById (txid6 , blockingStubFull1 );
404
404
405
405
Assert .assertTrue (infoById6 .get ().getResultValue () == 0 );
406
406
407
407
String txid7 = PublicMethed .triggerContract (contractAddress ,
408
408
"d7(bytes32)" , number , false ,
409
- 0 , maxFeeLimit , asset016Address , testKeyForAssetIssue016 , blockingStubFull );
409
+ 0 , maxFeeLimit , grammarAddress , testKeyForGrammarAddress , blockingStubFull );
410
410
Optional <TransactionInfo > infoById7 = PublicMethed
411
411
.getTransactionInfoById (txid7 , blockingStubFull1 );
412
412
Assert .assertTrue (infoById7 .get ().getResultValue () == 0 );
413
413
String txid8 = PublicMethed .triggerContract (contractAddress ,
414
414
"d6(bytes32)" , number , false ,
415
- 0 , maxFeeLimit , asset016Address , testKeyForAssetIssue016 , blockingStubFull );
415
+ 0 , maxFeeLimit , grammarAddress , testKeyForGrammarAddress , blockingStubFull );
416
416
Optional <TransactionInfo > infoById8 = PublicMethed
417
417
.getTransactionInfoById (txid8 , blockingStubFull1 );
418
418
Assert .assertTrue (infoById8 .get ().getResultValue () == 0 );
0 commit comments