Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitea81c28

Browse files
committed
This codecov coverage.. It kills me.
1 parent9d1fa02 commitea81c28

File tree

5 files changed

+96
-46
lines changed

5 files changed

+96
-46
lines changed

‎src/test/java/io/api/etherscan/account/AccountTxTokenTest.java‎

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,12 @@ public class AccountTxTokenTest extends Assert {
2020

2121
@Test
2222
publicvoidcorrect() {
23-
List<TxToken>txs =api.account().txsToken("0x36ec53A8fBa6358d59B3C4476D82cc60A2B0FaD7");
23+
List<TxToken>txs =api.account().txsToken("0x05fBf1E3f105df6a4553f3C7f2ed93070A4BAB46");
2424
assertNotNull(txs);
25-
assertEquals(8,txs.size());
25+
assertEquals(106,txs.size());
2626
assertTxs(txs);
27+
assertNotEquals(0,txs.get(0).getGasPrice());
28+
assertNotEquals(-1,txs.get(0).getNonce());
2729
assertNotNull(txs.get(0).toString());
2830
assertNotEquals(txs.get(0),txs.get(1));
2931
assertNotEquals(txs.get(0).hashCode(),txs.get(1).hashCode());
@@ -33,7 +35,7 @@ public void correct() {
3335
publicvoidcorrectStartBlock() {
3436
List<TxToken>txs =api.account().txsToken("0x36ec53A8fBa6358d59B3C4476D82cc60A2B0FaD7",5578167);
3537
assertNotNull(txs);
36-
assertEquals(6,txs.size());
38+
assertEquals(9,txs.size());
3739
assertTxs(txs);
3840
}
3941

@@ -47,7 +49,7 @@ public void correctStartBlockEndBlock() {
4749

4850
@Test(expected =InvalidAddressException.class)
4951
publicvoidinvalidParamWithError() {
50-
List<TxToken>txs =api.account().txsToken("0x6ec53A8fBa6358d59B3C4476D82cc60A2B0FaD7");
52+
api.account().txsToken("0x6ec53A8fBa6358d59B3C4476D82cc60A2B0FaD7");
5153
}
5254

5355
@Test
@@ -66,10 +68,10 @@ private void assertTxs(List<TxToken> txs) {
6668
assertNotNull(tx.getTo());
6769
assertNotNull(tx.getTimeStamp());
6870
assertNotNull(tx.getTokenDecimal());
69-
assertNotEquals(0,(tx.getConfirmations()));
71+
assertNotEquals(-1,(tx.getConfirmations()));
7072
assertNotNull(tx.getGasUsed());
71-
assertNotEquals(0,(tx.getCumulativeGasUsed()));
72-
assertNotEquals(0,tx.getTransactionIndex());
73+
assertNotEquals(-1 ,tx.getCumulativeGasUsed());
74+
assertNotEquals(-1,tx.getTransactionIndex());
7375
}
7476
}
7577
}

‎src/test/java/io/api/etherscan/block/BlockApiTest.java‎

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,20 @@ public class BlockApiTest extends Assert {
1919

2020
@Test
2121
publicvoidcorrect() {
22-
Optional<UncleBlock>uncles =api.block().uncles(2165403);
23-
assertTrue(uncles.isPresent());
24-
assertFalse(uncles.get().isEmpty());
25-
assertNotNull(uncles.get().getBlockMiner());
26-
assertNotNull(uncles.get().getUncleInclusionReward());
27-
assertNotNull(uncles.get().getUncles());
28-
assertFalse(uncles.get().getUncles().isEmpty());
29-
assertNotNull(uncles.get().getUncles().get(0).getBlockreward());
30-
assertNotNull(uncles.get().getUncles().get(0).getMiner());
31-
assertNotNull(uncles.get().toString());
22+
Optional<UncleBlock>uncle =api.block().uncles(2165403);
23+
assertTrue(uncle.isPresent());
24+
assertFalse(uncle.get().isEmpty());
25+
assertNotNull(uncle.get().getBlockMiner());
26+
assertNotNull(uncle.get().getUncleInclusionReward());
27+
assertNotNull(uncle.get().getUncles());
28+
assertFalse(uncle.get().getUncles().isEmpty());
29+
assertNotNull(uncle.get().getUncles().get(0).getBlockreward());
30+
assertNotNull(uncle.get().getUncles().get(0).getMiner());
31+
assertNotNull(uncle.get().toString());
3232

3333
UncleBlockempty =newUncleBlock();
34-
assertNotEquals(empty.hashCode(),uncles.get().hashCode());
35-
assertNotEquals(uncles,empty);
34+
assertNotEquals(uncle.get().hashCode(),empty.hashCode());
35+
assertNotEquals(uncle.get(),empty);
3636
assertTrue(empty.isEmpty());
3737
}
3838

‎src/test/java/io/api/etherscan/logs/LogQueryBuilderTest.java‎

Lines changed: 74 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,24 @@ public void tupleInCorrectOp() {
6161
.build();
6262
}
6363

64+
@Test(expected =LogQueryException.class)
65+
publicvoidtupleIncorrectTopic2() {
66+
LogQueryBuilder.with("0x33990122638b9132ca29c723bdf037f1a891a70c")
67+
.topic("0xf63780e752c6a54a94fc52715dbc5518a3b4c3c2833d301a204226548a2a8545",
68+
null)
69+
.setOpTopic0_1(LogOp.AND)
70+
.build();
71+
}
72+
73+
@Test(expected =LogQueryException.class)
74+
publicvoidtupleIncorrectTopic1() {
75+
LogQueryBuilder.with("0x33990122638b9132ca29c723bdf037f1a891a70c")
76+
.topic(null,
77+
"0xf63780e752c6a54a94fc52715dbc5518a3b4c3c2833d301a204226548a2a8545")
78+
.setOpTopic0_1(LogOp.AND)
79+
.build();
80+
}
81+
6482
@Test
6583
publicvoidtripleCorrect() {
6684
LogQuerytriple =LogQueryBuilder.with("0x33990122638b9132ca29c723bdf037f1a891a70c",379224,400000)
@@ -104,7 +122,7 @@ public void tripleInCorrectTopic1() {
104122
publicvoidtripleInCorrectTopic2() {
105123
LogQueryBuilder.with("0x33990122638b9132ca29c723bdf037f1a891a70c",379224,400000)
106124
.topic("0xf63780e752c6a54a94fc52715dbc5518a3b4c3c2833d301a204226548a2a8545",
107-
"null",
125+
null,
108126
"0x72657075746174696f6e00000000000000000000000000000000000000000000")
109127
.setOpTopic0_1(LogOp.AND)
110128
.setOpTopic0_2(null)
@@ -117,13 +135,49 @@ public void tripleInCorrectTopic3() {
117135
LogQueryBuilder.with("0x33990122638b9132ca29c723bdf037f1a891a70c",379224,400000)
118136
.topic("0xf63780e752c6a54a94fc52715dbc5518a3b4c3c2833d301a204226548a2a8545",
119137
"0x72657075746174696f6e00000000000000000000000000000000000000000000",
120-
"null")
138+
null)
139+
.setOpTopic0_1(LogOp.AND)
140+
.setOpTopic0_2(null)
141+
.setOpTopic1_2(LogOp.AND)
142+
.build();
143+
}
144+
145+
@Test(expected =LogQueryException.class)
146+
publicvoidtripleInCorrectOp1() {
147+
LogQueryBuilder.with("0x33990122638b9132ca29c723bdf037f1a891a70c",379224,400000)
148+
.topic("0xf63780e752c6a54a94fc52715dbc5518a3b4c3c2833d301a204226548a2a8545",
149+
"0x72657075746174696f6e00000000000000000000000000000000000000000000",
150+
"0x72657075746174696f6e00000000000000000000000000000000000000000000")
151+
.setOpTopic0_1(null)
152+
.setOpTopic0_2(LogOp.AND)
153+
.setOpTopic1_2(LogOp.AND)
154+
.build();
155+
}
156+
157+
@Test(expected =LogQueryException.class)
158+
publicvoidtripleInCorrectOp2() {
159+
LogQueryBuilder.with("0x33990122638b9132ca29c723bdf037f1a891a70c",379224,400000)
160+
.topic("0xf63780e752c6a54a94fc52715dbc5518a3b4c3c2833d301a204226548a2a8545",
161+
"0x72657075746174696f6e00000000000000000000000000000000000000000000",
162+
"0x72657075746174696f6e00000000000000000000000000000000000000000000")
121163
.setOpTopic0_1(LogOp.AND)
122164
.setOpTopic0_2(null)
123165
.setOpTopic1_2(LogOp.AND)
124166
.build();
125167
}
126168

169+
@Test(expected =LogQueryException.class)
170+
publicvoidtripleInCorrectOp3() {
171+
LogQueryBuilder.with("0x33990122638b9132ca29c723bdf037f1a891a70c",379224,400000)
172+
.topic("0xf63780e752c6a54a94fc52715dbc5518a3b4c3c2833d301a204226548a2a8545",
173+
"0x72657075746174696f6e00000000000000000000000000000000000000000000",
174+
"0x72657075746174696f6e00000000000000000000000000000000000000000000")
175+
.setOpTopic0_1(LogOp.AND)
176+
.setOpTopic0_2(LogOp.AND)
177+
.setOpTopic1_2(null)
178+
.build();
179+
}
180+
127181
@Test
128182
publicvoidquadroCorrect() {
129183
LogQueryquadro =LogQueryBuilder.with("0x33990122638b9132ca29c723bdf037f1a891a70c")
@@ -160,28 +214,26 @@ public void quadroIncorrectTopic2() {
160214
}
161215

162216
@Test(expected =LogQueryException.class)
163-
publicvoidtupleIncorrectTopic2() {
164-
LogQueryBuilder.with("0x33990122638b9132ca29c723bdf037f1a891a70c")
165-
.topic("0xf63780e752c6a54a94fc52715dbc5518a3b4c3c2833d301a204226548a2a8545",
166-
null)
167-
.setOpTopic0_1(LogOp.AND)
168-
.build();
169-
}
170-
171-
@Test(expected =LogQueryException.class)
172-
publicvoidtupleIncorrectTopic1() {
217+
publicvoidquadroIncorrectTopic1() {
173218
LogQueryBuilder.with("0x33990122638b9132ca29c723bdf037f1a891a70c")
174219
.topic(null,
175-
"0xf63780e752c6a54a94fc52715dbc5518a3b4c3c2833d301a204226548a2a8545")
220+
"0xf63780e752c6a54a94fc52715dbc5518a3b4c3c2833d301a204226548a2a8545",
221+
"0x72657075746174696f6e00000000000000000000000000000000000000000000",
222+
"0x72657075746174696f6e00000000000000000000000000000000000000000000")
176223
.setOpTopic0_1(LogOp.AND)
224+
.setOpTopic0_2(LogOp.OR)
225+
.setOpTopic0_3(LogOp.AND)
226+
.setOpTopic1_2(LogOp.OR)
227+
.setOpTopic1_3(LogOp.OR)
228+
.setOpTopic2_3(LogOp.OR)
177229
.build();
178230
}
179231

180232
@Test(expected =LogQueryException.class)
181233
publicvoidquadroIncorrectOp1() {
182234
LogQueryBuilder.with("0x33990122638b9132ca29c723bdf037f1a891a70c")
183235
.topic("0xf63780e752c6a54a94fc52715dbc5518a3b4c3c2833d301a204226548a2a8545",
184-
null,
236+
"0xf63780e752c6a54a94fc52715dbc5518a3b4c3c2833d301a204226548a2a8545",
185237
"0x72657075746174696f6e00000000000000000000000000000000000000000000",
186238
"0x72657075746174696f6e00000000000000000000000000000000000000000000")
187239
.setOpTopic0_1(null)
@@ -197,7 +249,7 @@ public void quadroIncorrectOp1() {
197249
publicvoidquadroIncorrectOp2() {
198250
LogQueryBuilder.with("0x33990122638b9132ca29c723bdf037f1a891a70c")
199251
.topic("0xf63780e752c6a54a94fc52715dbc5518a3b4c3c2833d301a204226548a2a8545",
200-
null,
252+
"0xf63780e752c6a54a94fc52715dbc5518a3b4c3c2833d301a204226548a2a8545",
201253
"0x72657075746174696f6e00000000000000000000000000000000000000000000",
202254
"0x72657075746174696f6e00000000000000000000000000000000000000000000")
203255
.setOpTopic0_1(LogOp.AND)
@@ -213,7 +265,7 @@ public void quadroIncorrectOp2() {
213265
publicvoidquadroIncorrectOp3() {
214266
LogQueryBuilder.with("0x33990122638b9132ca29c723bdf037f1a891a70c")
215267
.topic("0xf63780e752c6a54a94fc52715dbc5518a3b4c3c2833d301a204226548a2a8545",
216-
null,
268+
"0xf63780e752c6a54a94fc52715dbc5518a3b4c3c2833d301a204226548a2a8545",
217269
"0x72657075746174696f6e00000000000000000000000000000000000000000000",
218270
"0x72657075746174696f6e00000000000000000000000000000000000000000000")
219271
.setOpTopic0_1(LogOp.AND)
@@ -246,8 +298,8 @@ public void quadroInCorrectOp4() {
246298
LogQueryBuilder.with("0x33990122638b9132ca29c723bdf037f1a891a70c")
247299
.topic("0xf63780e752c6a54a94fc52715dbc5518a3b4c3c2833d301a204226548a2a8545",
248300
"0x72657075746174696f6e00000000000000000000000000000000000000000000",
249-
"",
250-
"")
301+
"0xf63780e752c6a54a94fc52715dbc5518a3b4c3c2833d301a204226548a2a8545",
302+
"0xf63780e752c6a54a94fc52715dbc5518a3b4c3c2833d301a204226548a2a8545")
251303
.setOpTopic0_1(LogOp.AND)
252304
.setOpTopic0_2(LogOp.OR)
253305
.setOpTopic0_3(LogOp.AND)
@@ -262,8 +314,8 @@ public void quadroInCorrectOp5() {
262314
LogQueryBuilder.with("0x33990122638b9132ca29c723bdf037f1a891a70c")
263315
.topic("0xf63780e752c6a54a94fc52715dbc5518a3b4c3c2833d301a204226548a2a8545",
264316
"0x72657075746174696f6e00000000000000000000000000000000000000000000",
265-
"",
266-
"")
317+
"0xf63780e752c6a54a94fc52715dbc5518a3b4c3c2833d301a204226548a2a8545",
318+
"0xf63780e752c6a54a94fc52715dbc5518a3b4c3c2833d301a204226548a2a8545")
267319
.setOpTopic0_1(LogOp.AND)
268320
.setOpTopic0_2(LogOp.OR)
269321
.setOpTopic0_3(LogOp.AND)
@@ -278,8 +330,8 @@ public void quadroInCorrectOp6() {
278330
LogQueryBuilder.with("0x33990122638b9132ca29c723bdf037f1a891a70c")
279331
.topic("0xf63780e752c6a54a94fc52715dbc5518a3b4c3c2833d301a204226548a2a8545",
280332
"0x72657075746174696f6e00000000000000000000000000000000000000000000",
281-
"",
282-
"")
333+
"0xf63780e752c6a54a94fc52715dbc5518a3b4c3c2833d301a204226548a2a8545",
334+
"0xf63780e752c6a54a94fc52715dbc5518a3b4c3c2833d301a204226548a2a8545")
283335
.setOpTopic0_1(LogOp.AND)
284336
.setOpTopic0_2(LogOp.OR)
285337
.setOpTopic0_3(LogOp.AND)

‎src/test/java/io/api/etherscan/proxy/ProxyTxApiTest.java‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ public void correctByHash() {
2727
assertNotNull(tx.get().getTo());
2828
assertNotNull(tx.get().getHash());
2929
assertNotNull(tx.get().getNonce());
30+
assertNotNull(tx.get().getBlockNumber());
3031
assertNotNull(tx.get().toString());
3132

3233
TxProxyempty =newTxProxy();

‎src/test/java/io/api/util/UtilTests.java‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,6 @@ public void responseValidateEmpty() {
2828
validateTxResponse(responseTO);
2929
}
3030

31-
@Test(expected =EtherScanException.class)
32-
publicvoidresponseValidateNullable() {
33-
validateTxResponse(null);
34-
}
35-
3631
@Test
3732
publicvoidpartitionEmpty() {
3833
ArrayList<String>list =newArrayList<>();

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp