2626import org .tron .common .utils .Utils ;
2727import org .tron .core .Wallet ;
2828import org .tron .protos .Protocol ;
29- import org .tron .protos .contract .SmartContractOuterClass ;
3029import stest .tron .wallet .common .client .Configuration ;
3130import stest .tron .wallet .common .client .Parameter .CommonConstant ;
3231import stest .tron .wallet .common .client .utils .PublicMethed ;
@@ -123,7 +122,7 @@ public void beforeClass() {
123122 public void test01DeployContractEnergyFeeToSr () {
124123 Assert .assertTrue (PublicMethed .sendcoin (deployAddress , 20000000000L , fromAddress ,
125124 testKey002 , blockingStubFull ));
126- PublicMethed .waitSolidityNodeSynFullNodeData (blockingStubFull , blockingStubSolidity );
125+ PublicMethed .waitProduceNextBlock (blockingStubFull );
127126 String filePath = "src/test/resources/soliditycode//contractLinkage003.sol" ;
128127 String contractName = "divideIHaveArgsReturnStorage" ;
129128 HashMap retMap = null ;
@@ -141,13 +140,13 @@ public void test01DeployContractEnergyFeeToSr() {
141140 .getAllowance ();
142141 blackHoleBalance1 = PublicMethed .queryAccount (Commons .decode58Check (blackHoleAdd ),
143142 blockingStubFull ).getBalance ();
144- beforeBurnTrxAmount = blockingStubSolidity
143+ beforeBurnTrxAmount = blockingStubFull
145144 .getBurnTrx (EmptyMessage .newBuilder ().build ()).getNum ();
146145
147146 txid = PublicMethed .deployContractAndGetTransactionInfoById (contractName , abi , code ,
148147 "" , maxFeeLimit , 0L , 0 , null ,
149148 deployKey , deployAddress , blockingStubFull );
150- PublicMethed .waitSolidityNodeSynFullNodeData (blockingStubFull , blockingStubSolidity );
149+ PublicMethed .waitProduceNextBlock (blockingStubFull );
151150
152151 endNum = blockingStubFull .getNowBlock (GrpcAPI .EmptyMessage .newBuilder ().build ())
153152 .getBlockHeader ().getRawData ().getNumber ();
@@ -177,7 +176,7 @@ public void test01DeployContractEnergyFeeToSr() {
177176 Optional <Protocol .TransactionInfo > infoById =
178177 PublicMethed .getTransactionInfoById (txid , blockingStubFull );
179178 Assert .assertEquals (infoById .get ().getFee (),infoById .get ().getPackingFee ());
180- afterBurnTrxAmount = blockingStubSolidity
179+ afterBurnTrxAmount = blockingStubFull
181180 .getBurnTrx (EmptyMessage .newBuilder ().build ()).getNum ();
182181 Assert .assertEquals (beforeBurnTrxAmount ,afterBurnTrxAmount );
183182 }
@@ -196,7 +195,7 @@ public void test02UpdateAccountPermissionAndMultiSiginTrans() {
196195
197196 Assert .assertTrue (PublicMethed .sendcoin (ownerAddress , needCoin + 1_000_000 , fromAddress ,
198197 testKey002 , blockingStubFull ));
199- PublicMethed .waitSolidityNodeSynFullNodeData (blockingStubFull , blockingStubSolidity );
198+ PublicMethed .waitProduceNextBlock (blockingStubFull );
200199 Long balanceBefore = PublicMethed .queryAccount (ownerAddress , blockingStubFull )
201200 .getBalance ();
202201 logger .info ("balanceBefore: " + balanceBefore );
@@ -240,7 +239,6 @@ public void test02UpdateAccountPermissionAndMultiSiginTrans() {
240239 ownerAddress , ownerKey , blockingStubFull ,
241240 ownerPermissionKeys .toArray (new String [ownerPermissionKeys .size ()]));
242241
243- //PublicMethed.waitSolidityNodeSynFullNodeData(blockingStubFull,blockingStubSolidity);
244242 PublicMethed .waitProduceNextBlock (blockingStubFull );
245243 Optional <Protocol .TransactionInfo > infoById =
246244 PublicMethed .getTransactionInfoById (txid , blockingStubFull );
@@ -288,7 +286,6 @@ public void test02UpdateAccountPermissionAndMultiSiginTrans() {
288286 logger .info (PublicMethedForMutiSign .printPermission (PublicMethed .queryAccount (ownerAddress ,
289287 blockingStubFull ).getOwnerPermission ()));
290288
291- //PublicMethed.waitSolidityNodeSynFullNodeData(blockingStubFull,blockingStubSolidity);
292289
293290 startNum = blockingStubFull .getNowBlock (GrpcAPI .EmptyMessage .newBuilder ().build ())
294291 .getBlockHeader ().getRawData ().getNumber ();
@@ -372,6 +369,7 @@ public void test03OutOfTimeEnergyFeeToBlackHole() {
372369
373370 Assert .assertTrue (PublicMethed .sendcoin (deployAddress , maxFeeLimit * 10 , fromAddress ,
374371 testKey002 , blockingStubFull ));
372+ PublicMethed .waitProduceNextBlock (blockingStubFull );
375373
376374 String contractName = "StorageAndCpu" + Integer .toString (randNum );
377375 String code = Configuration .getByPath ("testng.conf" )
@@ -382,7 +380,7 @@ public void test03OutOfTimeEnergyFeeToBlackHole() {
382380 contractAddress = PublicMethed .deployContract (contractName , abi , code ,
383381 "" , maxFeeLimit ,
384382 0L , 100 , null , deployKey , deployAddress , blockingStubFull );
385- PublicMethed .waitSolidityNodeSynFullNodeData (blockingStubFull , blockingStubSolidity );
383+ PublicMethed .waitProduceNextBlock (blockingStubFull );
386384
387385 startNum = blockingStubFull .getNowBlock (GrpcAPI .EmptyMessage .newBuilder ().build ())
388386 .getBlockHeader ().getRawData ().getNumber ();
@@ -392,12 +390,12 @@ public void test03OutOfTimeEnergyFeeToBlackHole() {
392390 PublicMethed .queryAccount (witnessAddress02 , blockingStubFull ).getAllowance ();
393391 blackHoleBalance1 = PublicMethed .queryAccount (Commons .decode58Check (blackHoleAdd ),
394392 blockingStubFull ).getBalance ();
395- beforeBurnTrxAmount = blockingStubSolidity
393+ beforeBurnTrxAmount = blockingStubFull
396394 .getBurnTrx (EmptyMessage .newBuilder ().build ()).getNum ();
397395 txid = PublicMethed .triggerContract (contractAddress ,
398396 "testUseCpu(uint256)" , "90100" , false ,
399397 0 , maxFeeLimit , deployAddress , deployKey , blockingStubFull );
400- PublicMethed .waitSolidityNodeSynFullNodeData (blockingStubFull , blockingStubSolidity );
398+ PublicMethed .waitProduceNextBlock (blockingStubFull );
401399 endNum = blockingStubFull .getNowBlock (GrpcAPI .EmptyMessage .newBuilder ().build ())
402400 .getBlockHeader ().getRawData ().getNumber ();
403401 witness01Allowance2 =
@@ -430,7 +428,7 @@ public void test03OutOfTimeEnergyFeeToBlackHole() {
430428 logger .info ("receipt:" + infoById .get ().getReceipt ());
431429 Assert .assertTrue (packingFee == 0L );
432430 Assert .assertTrue (infoById .get ().getFee () >= maxFeeLimit );
433- afterBurnTrxAmount = blockingStubSolidity
431+ afterBurnTrxAmount = blockingStubFull
434432 .getBurnTrx (EmptyMessage .newBuilder ().build ()).getNum ();
435433 Assert .assertTrue (afterBurnTrxAmount - beforeBurnTrxAmount == maxFeeLimit );
436434 }
@@ -445,15 +443,15 @@ public void test04AccountCreate() {
445443 PublicMethed .queryAccount (witnessAddress02 , blockingStubFull ).getAllowance ();
446444 blackHoleBalance1 = PublicMethed .queryAccount (Commons .decode58Check (blackHoleAdd ),
447445 blockingStubFull ).getBalance ();
448- beforeBurnTrxAmount = blockingStubSolidity
446+ beforeBurnTrxAmount = blockingStubFull
449447 .getBurnTrx (EmptyMessage .newBuilder ().build ()).getNum ();
450448 ECKey ecKey = new ECKey (Utils .getRandom ());
451449 byte [] lowBalAddress = ecKey .getAddress ();
452450 txid = PublicMethed .createAccountGetTxid (fromAddress , lowBalAddress ,
453451 testKey002 , blockingStubFull );
454452
455453
456- PublicMethed .waitSolidityNodeSynFullNodeData (blockingStubFull , blockingStubSolidity );
454+ PublicMethed .waitProduceNextBlock (blockingStubFull );
457455 endNum = blockingStubFull .getNowBlock (GrpcAPI .EmptyMessage .newBuilder ().build ())
458456 .getBlockHeader ().getRawData ().getNumber ();
459457 witness01Allowance2 =
@@ -482,7 +480,7 @@ public void test04AccountCreate() {
482480 PublicMethed .getTransactionInfoById (txid , blockingStubFull );
483481 Assert .assertTrue (infoById .get ().getPackingFee () == 0L );
484482 Assert .assertTrue (infoById .get ().getFee () == 100000L );
485- afterBurnTrxAmount = blockingStubSolidity
483+ afterBurnTrxAmount = blockingStubFull
486484 .getBurnTrx (EmptyMessage .newBuilder ().build ()).getNum ();
487485 Assert .assertTrue (afterBurnTrxAmount - beforeBurnTrxAmount == 100000L );
488486 }
@@ -495,6 +493,7 @@ public void test05NetFeeAndEnergyFee2Sr() {
495493
496494 Assert .assertTrue (PublicMethed .sendcoin (deployAddress , maxFeeLimit * 10 , fromAddress ,
497495 testKey002 , blockingStubFull ));
496+ PublicMethed .waitProduceNextBlock (blockingStubFull );
498497
499498 String contractName = "StorageAndCpu" + Integer .toString (randNum );
500499 String code = Configuration .getByPath ("testng.conf" )
@@ -511,7 +510,7 @@ public void test05NetFeeAndEnergyFee2Sr() {
511510 0 , maxFeeLimit , deployAddress , deployKey , blockingStubFull );
512511 }
513512
514- PublicMethed .waitSolidityNodeSynFullNodeData (blockingStubFull , blockingStubSolidity );
513+ PublicMethed .waitProduceNextBlock (blockingStubFull );
515514
516515 startNum = blockingStubFull .getNowBlock (GrpcAPI .EmptyMessage .newBuilder ().build ())
517516 .getBlockHeader ().getRawData ().getNumber ();
@@ -521,13 +520,13 @@ public void test05NetFeeAndEnergyFee2Sr() {
521520 PublicMethed .queryAccount (witnessAddress02 , blockingStubFull ).getAllowance ();
522521 blackHoleBalance1 = PublicMethed .queryAccount (Commons .decode58Check (blackHoleAdd ),
523522 blockingStubFull ).getBalance ();
524- beforeBurnTrxAmount = blockingStubSolidity
523+ beforeBurnTrxAmount = blockingStubFull
525524 .getBurnTrx (EmptyMessage .newBuilder ().build ()).getNum ();
526525 txid = PublicMethed .triggerContract (contractAddress ,
527526 "testUseCpu(uint256)" , "700" , false ,
528527 0 , maxFeeLimit , deployAddress , deployKey , blockingStubFull );
529528 // PublicMethed.waitProduceNextBlock(blockingStubFull);
530- PublicMethed .waitSolidityNodeSynFullNodeData (blockingStubFull , blockingStubSolidity );
529+ PublicMethed .waitProduceNextBlock (blockingStubFull );
531530 endNum = blockingStubFull .getNowBlock (GrpcAPI .EmptyMessage .newBuilder ().build ())
532531 .getBlockHeader ().getRawData ().getNumber ();
533532 witness01Allowance2 =
@@ -554,7 +553,7 @@ public void test05NetFeeAndEnergyFee2Sr() {
554553 Assert .assertTrue ((Math .abs (witnessAllowance .get (ByteArray .toHexString (witnessAddress02 ))
555554 - witness02Increase )) <= 2 );
556555 Assert .assertEquals (blackHoleBalance1 ,blackHoleBalance2 );
557- afterBurnTrxAmount = blockingStubSolidity
556+ afterBurnTrxAmount = blockingStubFull
558557 .getBurnTrx (EmptyMessage .newBuilder ().build ()).getNum ();
559558 Assert .assertEquals (beforeBurnTrxAmount ,afterBurnTrxAmount );
560559 }
@@ -575,7 +574,7 @@ public void test06CreateAssetIssue() {
575574 Assert .assertTrue (PublicMethed
576575 .sendcoin (tokenAccountAddress , 1028000000L , fromAddress , testKey002 , blockingStubFull ));
577576
578- PublicMethed .waitSolidityNodeSynFullNodeData (blockingStubFull , blockingStubSolidity );
577+ PublicMethed .waitProduceNextBlock (blockingStubFull );
579578 startNum = blockingStubFull .getNowBlock (GrpcAPI .EmptyMessage .newBuilder ().build ())
580579 .getBlockHeader ().getRawData ().getNumber ();
581580 witness01Allowance1 =
@@ -584,7 +583,7 @@ public void test06CreateAssetIssue() {
584583 PublicMethed .queryAccount (witnessAddress02 , blockingStubFull ).getAllowance ();
585584 blackHoleBalance1 = PublicMethed .queryAccount (Commons .decode58Check (blackHoleAdd ),
586585 blockingStubFull ).getBalance ();
587- beforeBurnTrxAmount = blockingStubSolidity
586+ beforeBurnTrxAmount = blockingStubFull
588587 .getBurnTrx (EmptyMessage .newBuilder ().build ()).getNum ();
589588 Long start = System .currentTimeMillis () + 2000 ;
590589 Long end = System .currentTimeMillis () + 1000000000 ;
@@ -597,7 +596,7 @@ public void test06CreateAssetIssue() {
597596 1 , 1 , start , end , 1 , description , url , 0L ,
598597 0L , 1L , 1L , tokenAccountKey ,
599598 blockingStubFull );
600- PublicMethed .waitSolidityNodeSynFullNodeData (blockingStubFull , blockingStubSolidity );
599+ PublicMethed .waitProduceNextBlock (blockingStubFull );
601600
602601 endNum = blockingStubFull .getNowBlock (GrpcAPI .EmptyMessage .newBuilder ().build ())
603602 .getBlockHeader ().getRawData ().getNumber ();
@@ -627,16 +626,26 @@ public void test06CreateAssetIssue() {
627626 PublicMethed .getTransactionInfoById (txid , blockingStubFull );
628627 Assert .assertTrue (infoById .get ().getPackingFee () == 0L );
629628 Assert .assertTrue (infoById .get ().getFee () == 1024000000L );
630- afterBurnTrxAmount = blockingStubSolidity
629+ afterBurnTrxAmount = blockingStubFull
631630 .getBurnTrx (EmptyMessage .newBuilder ().build ()).getNum ();
632631 Assert .assertTrue (afterBurnTrxAmount - beforeBurnTrxAmount == 1024000000L );
633632
633+
634+ }
635+
636+ /**
637+ * constructor.
638+ */
639+
640+ @ Test (enabled = true , description = "Test getburntrx api from solidity or pbft" )
641+ public void test07GetBurnTrxFromSolidityOrPbft () {
642+ PublicMethed .waitSolidityNodeSynFullNodeData (blockingStubFull ,blockingStubSolidity );
634643 Assert .assertEquals (blockingStubFull
635644 .getBurnTrx (EmptyMessage .newBuilder ().build ()),blockingStubSolidity .getBurnTrx (
636645 EmptyMessage .newBuilder ().build ()));
637646 Assert .assertEquals (blockingStubFull .getBurnTrx (EmptyMessage .newBuilder ().build ()),
638647 blockingStubPbft .getBurnTrx (
639- EmptyMessage .newBuilder ().build ()));
648+ EmptyMessage .newBuilder ().build ()));
640649 }
641650 /**
642651 * constructor.
0 commit comments