Skip to content

Commit 4bf6c19

Browse files
modify tvmnewCommand Case
1 parent fdc85c8 commit 4bf6c19

59 files changed

Lines changed: 2585 additions & 729 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎src/test/java/stest/tron/wallet/common/client/utils/PublicMethed.java‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1678,16 +1678,16 @@ public static boolean waitProduceNextBlock(WalletGrpc.WalletBlockingStub
16781678
Integer wait = 0;
16791679
logger.info("Block num is " + Long.toString(currentBlock
16801680
.getBlockHeader().getRawData().getNumber()));
1681-
while (nextNum <= currentNum + 1 && wait <= 15) {
1681+
while (nextNum <= currentNum + 1 && wait <= 45) {
16821682
try {
1683-
Thread.sleep(3000);
1683+
Thread.sleep(1000);
16841684
} catch (InterruptedException e) {
16851685
e.printStackTrace();
16861686
}
16871687
logger.info("Wait to produce next block");
16881688
nextBlock = blockingStubFull.getNowBlock(GrpcAPI.EmptyMessage.newBuilder().build());
16891689
nextNum = nextBlock.getBlockHeader().getRawData().getNumber();
1690-
if (wait == 15) {
1690+
if (wait == 45) {
16911691
logger.info("These 45 second didn't produce a block,please check.");
16921692
return false;
16931693
}

‎src/test/java/stest/tron/wallet/dailybuild/trctoken/ContractTrcToken014.java‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,7 @@ public void test03TriggerContract() {
355355
1000000000L, assetAccountId.toStringUtf8(), 2, user001Address, user001Key,
356356
blockingStubFull);
357357

358+
PublicMethed.waitProduceNextBlock(blockingStubFull);
358359
infoById = PublicMethed
359360
.getTransactionInfoById(triggerTxid, blockingStubFull);
360361
Assert.assertTrue(infoById.get().getResultValue() != 0);
@@ -407,6 +408,7 @@ public void test03TriggerContract() {
407408
1000000000L, assetAccountId.toStringUtf8(), 2, user001Address, user001Key,
408409
blockingStubFull);
409410

411+
PublicMethed.waitProduceNextBlock(blockingStubFull);
410412
infoById = PublicMethed.getTransactionInfoById(triggerTxid, blockingStubFull);
411413
Assert.assertTrue(infoById.get().getResultValue() != 0);
412414
Assert.assertEquals(FAILED, infoById.get().getResult());
@@ -527,7 +529,7 @@ public void test03TriggerContract() {
527529
"transferTokenTest(address,uint256,trcToken)", param, false, callValue,
528530
1000000000L, assetAccountId.toStringUtf8(), 2, user001Address, user001Key,
529531
blockingStubFull);
530-
532+
PublicMethed.waitProduceNextBlock(blockingStubFull);
531533
infoById = PublicMethed
532534
.getTransactionInfoById(triggerTxid, blockingStubFull);
533535
Assert.assertTrue(infoById.get().getResultValue() != 0);

‎src/test/java/stest/tron/wallet/dailybuild/trctoken/ContractTrcToken064.java‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,7 @@ public void test03TriggerContract() {
320320
1000000000L, assetAccountId.toStringUtf8(), 2, user001Address, user001Key,
321321
blockingStubFull);
322322

323+
PublicMethed.waitProduceNextBlock(blockingStubFull);
323324
infoById = PublicMethed
324325
.getTransactionInfoById(triggerTxid, blockingStubFull);
325326
Assert.assertTrue(infoById.get().getResultValue() != 0);

‎src/test/java/stest/tron/wallet/dailybuild/trctoken/ContractTrcToken075.java‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,7 @@ public void testTokenBalanceContract() {
230230
.getTransactionInfoById(triggerTxid, blockingStubFull);
231231
logger.info("Trigger energytotal is " + infoById.get().getReceipt().getEnergyUsageTotal());
232232

233+
PublicMethed.waitProduceNextBlock(blockingStubFull);
233234
Assert.assertTrue(infoById.get().getResultValue() != 0);
234235
Assert.assertEquals(FAILED, infoById.get().getResult());
235236
Assert.assertEquals("REVERT opcode executed",

‎src/test/java/stest/tron/wallet/dailybuild/trctoken/ContractTrcToken076.java‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ public void testDeployTransferTokenContract() {
8080
.sendcoin(grammarAddress, 100000000000L, testNetAccountAddress, testNetAccountKey,
8181
blockingStubFull);
8282
PublicMethed.waitProduceNextBlock(blockingStubFull);
83-
PublicMethed.waitProduceNextBlock(blockingStubFull);
8483

8584
String filePath = "./src/test/resources/soliditycode/contractTrcToken076.sol";
8685
String contractName = "Test";
@@ -98,19 +97,16 @@ public void testDeployTransferTokenContract() {
9897

9998
contractAddress = infoById.get().getContractAddress().toByteArray();
10099

101-
PublicMethed.waitProduceNextBlock(blockingStubFull);
102100
PublicMethed.waitProduceNextBlock(blockingStubFull);
103101
PublicMethed.triggerContract(contractAddress,
104102
"test()", "#", false,
105103
0, maxFeeLimit, grammarAddress, testKeyForGrammarAddress, blockingStubFull);
106104
PublicMethed.waitProduceNextBlock(blockingStubFull);
107-
PublicMethed.waitProduceNextBlock(blockingStubFull);
108105

109106
txid = PublicMethed.triggerContract(contractAddress,
110107
"getResult1()", "#", false,
111108
0, maxFeeLimit, grammarAddress, testKeyForGrammarAddress, blockingStubFull);
112109
PublicMethed.waitProduceNextBlock(blockingStubFull);
113-
PublicMethed.waitProduceNextBlock(blockingStubFull);
114110

115111
infoById = PublicMethed.getTransactionInfoById(txid, blockingStubFull);
116112
logger.info("Deploy energytotal is " + infoById.get().getReceipt().getEnergyUsageTotal());
@@ -125,7 +121,6 @@ public void testDeployTransferTokenContract() {
125121
"getResult2()", "#", false,
126122
0, maxFeeLimit, grammarAddress, testKeyForGrammarAddress, blockingStubFull);
127123
PublicMethed.waitProduceNextBlock(blockingStubFull);
128-
PublicMethed.waitProduceNextBlock(blockingStubFull);
129124

130125
infoById = PublicMethed.getTransactionInfoById(txid, blockingStubFull);
131126
logger.info("Deploy energytotal is " + infoById.get().getReceipt().getEnergyUsageTotal());

‎src/test/java/stest/tron/wallet/dailybuild/trctoken/ContractTrcToken077.java‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,6 @@ public void testAddress002() {
113113
.sendcoin(grammarAddress, 100000000000L, testNetAccountAddress, testNetAccountKey,
114114
blockingStubFull);
115115
PublicMethed.waitProduceNextBlock(blockingStubFull);
116-
PublicMethed.waitProduceNextBlock(blockingStubFull);
117116

118117
String filePath = "./src/test/resources/soliditycode/contractTrcToken077.sol";
119118
String contractName = "trcToken077";
@@ -131,14 +130,12 @@ public void testAddress002() {
131130
contractAddress = deployById.get().getContractAddress().toByteArray();
132131
logger.info("infoById:" + deployById);
133132
PublicMethed.waitProduceNextBlock(blockingStubFull);
134-
PublicMethed.waitProduceNextBlock(blockingStubFull);
135133

136134
String txid = "";
137135
txid = PublicMethed.triggerContract(contractAddress,
138136
"addressTest()", "#", false,
139137
0, maxFeeLimit, grammarAddress, testKeyForGrammarAddress, blockingStubFull);
140138
PublicMethed.waitProduceNextBlock(blockingStubFull);
141-
PublicMethed.waitProduceNextBlock(blockingStubFull);
142139

143140
Optional<TransactionInfo> infoById = null;
144141
infoById = PublicMethed.getTransactionInfoById(txid, blockingStubFull);

‎src/test/java/stest/tron/wallet/dailybuild/trctoken/ContractTrcToken078.java‎

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,6 @@ public void testOriginCall001() {
8888
.sendcoin(internalTxsAddress, 100000000000L, testNetAccountAddress, testNetAccountKey,
8989
blockingStubFull);
9090
PublicMethed.waitProduceNextBlock(blockingStubFull);
91-
PublicMethed
92-
.freezeBalanceGetEnergy(internalTxsAddress, 10000000000L, 0L, 1, priKey, blockingStubFull);
93-
PublicMethed.waitProduceNextBlock(blockingStubFull);
9491

9592
String filePath = "./src/test/resources/soliditycode/contractTrcToken078.sol";
9693
String contractName = "callerContract";
@@ -104,7 +101,6 @@ public void testOriginCall001() {
104101
1000000L, 100, null, testKeyForinternalTxsAddress,
105102
internalTxsAddress, blockingStubFull);
106103
PublicMethed.waitProduceNextBlock(blockingStubFull);
107-
PublicMethed.waitProduceNextBlock(blockingStubFull);
108104
Optional<TransactionInfo> infoById = PublicMethed
109105
.getTransactionInfoById(txid, blockingStubFull);
110106
logger.info("infoById : " + infoById);
@@ -127,8 +123,6 @@ public void testOriginCall001() {
127123
byte[] contractAddress1;
128124
contractAddress1 = infoById.get().getContractAddress().toByteArray();
129125

130-
PublicMethed.waitProduceNextBlock(blockingStubFull);
131-
PublicMethed.waitProduceNextBlock(blockingStubFull);
132126
PublicMethed.waitProduceNextBlock(blockingStubFull);
133127

134128
String filePath2 = "./src/test/resources/soliditycode/contractTrcToken078.sol";
@@ -143,8 +137,6 @@ public void testOriginCall001() {
143137
1000000L, 100, null, testKeyForinternalTxsAddress,
144138
internalTxsAddress, blockingStubFull);
145139
PublicMethed.waitProduceNextBlock(blockingStubFull);
146-
PublicMethed.waitProduceNextBlock(blockingStubFull);
147-
PublicMethed.waitProduceNextBlock(blockingStubFull);
148140

149141
infoById = PublicMethed
150142
.getTransactionInfoById(txid, blockingStubFull);
@@ -159,8 +151,6 @@ public void testOriginCall001() {
159151
"sendToB2(address,address)", initParmes, false,
160152
0, maxFeeLimit, internalTxsAddress, testKeyForinternalTxsAddress, blockingStubFull);
161153
PublicMethed.waitProduceNextBlock(blockingStubFull);
162-
PublicMethed.waitProduceNextBlock(blockingStubFull);
163-
PublicMethed.waitProduceNextBlock(blockingStubFull);
164154
Optional<TransactionInfo> infoById2 = null;
165155
infoById2 = PublicMethed.getTransactionInfoById(txid2, blockingStubFull);
166156
logger.info("Trigger InfobyId: " + infoById2);
@@ -180,7 +170,6 @@ public void testOriginDelegatecall001() {
180170
.sendcoin(internalTxsAddress, 100000000000L, testNetAccountAddress, testNetAccountKey,
181171
blockingStubFull);
182172
PublicMethed.waitProduceNextBlock(blockingStubFull);
183-
PublicMethed.waitProduceNextBlock(blockingStubFull);
184173

185174
String filePath = "./src/test/resources/soliditycode/contractTrcToken078.sol";
186175
String contractName = "callerContract";
@@ -198,8 +187,6 @@ public void testOriginDelegatecall001() {
198187
logger.info("infoById : " + infoById);
199188
contractAddress = infoById.get().getContractAddress().toByteArray();
200189

201-
PublicMethed.waitProduceNextBlock(blockingStubFull);
202-
PublicMethed.waitProduceNextBlock(blockingStubFull);
203190
PublicMethed.waitProduceNextBlock(blockingStubFull);
204191
String filePath1 = "./src/test/resources/soliditycode/contractTrcToken078.sol";
205192
String contractName1 = "calledContract";
@@ -212,8 +199,6 @@ public void testOriginDelegatecall001() {
212199
1000000L, 100, null, testKeyForinternalTxsAddress,
213200
internalTxsAddress, blockingStubFull);
214201
PublicMethed.waitProduceNextBlock(blockingStubFull);
215-
PublicMethed.waitProduceNextBlock(blockingStubFull);
216-
PublicMethed.waitProduceNextBlock(blockingStubFull);
217202
infoById = PublicMethed
218203
.getTransactionInfoById(txid, blockingStubFull);
219204
logger.info("infoById : " + infoById);
@@ -231,8 +216,6 @@ public void testOriginDelegatecall001() {
231216
1000000L, 100, null, testKeyForinternalTxsAddress,
232217
internalTxsAddress, blockingStubFull);
233218
PublicMethed.waitProduceNextBlock(blockingStubFull);
234-
PublicMethed.waitProduceNextBlock(blockingStubFull);
235-
PublicMethed.waitProduceNextBlock(blockingStubFull);
236219
infoById = PublicMethed
237220
.getTransactionInfoById(txid, blockingStubFull);
238221
logger.info("infoById : " + infoById);
@@ -246,8 +229,6 @@ public void testOriginDelegatecall001() {
246229
"sendToB(address,address)", initParmes, false,
247230
0, maxFeeLimit, internalTxsAddress, testKeyForinternalTxsAddress, blockingStubFull);
248231
PublicMethed.waitProduceNextBlock(blockingStubFull);
249-
PublicMethed.waitProduceNextBlock(blockingStubFull);
250-
PublicMethed.waitProduceNextBlock(blockingStubFull);
251232
Optional<TransactionInfo> infoById2 = null;
252233
infoById2 = PublicMethed.getTransactionInfoById(txid2, blockingStubFull);
253234
logger.info("infoById : " + infoById2);

0 commit comments

Comments
 (0)