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

Commit2af17f0

Browse files
committed
Minor refactoring and renaming
1 parent542c84a commit2af17f0

File tree

5 files changed

+14
-34
lines changed

5 files changed

+14
-34
lines changed

‎pom.xml‎

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,12 @@
77
<artifactId>etherscan</artifactId>
88
<version>1.0.0</version>
99

10-
<name>etherscan-api</name>
10+
<name>java-etherscan-api</name>
1111

1212
<properties>
1313
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
1414
<maven.compiler.source>1.8</maven.compiler.source>
1515
<maven.compiler.target>1.8</maven.compiler.target>
16-
<apache.http>4.5.6</apache.http>
1716
</properties>
1817

1918
<dependencies>
@@ -24,12 +23,6 @@
2423
<scope>test</scope>
2524
</dependency>
2625

27-
<dependency>
28-
<groupId>org.apache.httpcomponents</groupId>
29-
<artifactId>httpclient</artifactId>
30-
<version>${apache.http}</version>
31-
</dependency>
32-
3326
<dependency>
3427
<groupId>com.google.code.gson</groupId>
3528
<artifactId>gson</artifactId>
@@ -41,12 +34,6 @@
4134
<artifactId>annotations</artifactId>
4235
<version>13.0</version>
4336
</dependency>
44-
45-
<dependency>
46-
<groupId>com.jsoniter</groupId>
47-
<artifactId>jsoniter</artifactId>
48-
<version>0.9.23</version>
49-
</dependency>
5037
</dependencies>
5138

5239
<build>

‎src/main/java/io/api/etherscan/executor/impl/HttpExecutor.java‎

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,10 @@
1717
importstaticjava.net.HttpURLConnection.HTTP_MOVED_TEMP;
1818

1919
/**
20-
*@author GoodforGod
20+
*Http client implementation
2121
* @see IHttpExecutor
22+
*
23+
* @author GoodforGod
2224
* @since 28.10.2018
2325
*/
2426
publicclassHttpExecutorimplementsIHttpExecutor {
@@ -29,7 +31,7 @@ public class HttpExecutor implements IHttpExecutor {
2931
DEFAULT_HEADERS.put("accept-language","en,ru;q=0.9");
3032
DEFAULT_HEADERS.put("accept-encoding","gzip, deflate, br");
3133
DEFAULT_HEADERS.put("user-agent","Mozilla/5.0 (Windows NT 10.0; WOW64) Chrome/68.0.3440.106");
32-
DEFAULT_HEADERS.put("content-Type","application/x-www-form-urlencoded");
34+
DEFAULT_HEADERS.put("content-type","application/x-www-form-urlencoded");
3335
}
3436

3537
privatefinalMap<String,String>headers;
@@ -43,6 +45,11 @@ public HttpExecutor(final int timeout) {
4345
this(timeout,DEFAULT_HEADERS);
4446
}
4547

48+
/**
49+
*
50+
* @param timeout custom timeout in millis
51+
* @param headers custom HTTP headers
52+
*/
4653
publicHttpExecutor(finalinttimeout,
4754
finalMap<String,String>headers) {
4855
this.timeout =timeout;
@@ -82,7 +89,7 @@ public String post(final String urlAsString, final String dataToPost) {
8289
headers.forEach(connection::setRequestProperty);
8390

8491
finalStringcontentLength = (BasicUtils.isEmpty(dataToPost)) ?"0" :String.valueOf(dataToPost.length());
85-
connection.setRequestProperty("Content-Length",contentLength);
92+
connection.setRequestProperty("content-length",contentLength);
8693

8794
connection.setDoOutput(true);
8895
DataOutputStreamwr =newDataOutputStream(connection.getOutputStream());

‎src/main/java/io/api/etherscan/model/utility/BalanceTO.java‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,6 @@ public class BalanceTO {
1111
privateStringaccount;
1212
privateStringbalance;
1313

14-
publicBalanceTO(Stringaccount,Stringbalance) {
15-
this.account =account;
16-
this.balance =balance;
17-
}
18-
1914
publicStringgetAccount() {
2015
returnaccount;
2116
}

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
importio.api.etherscan.core.impl.EtherScanApi;
44
importio.api.etherscan.error.InvalidTxHashException;
55
importio.api.etherscan.model.TxInternal;
6+
importio.api.etherscan.util.BasicUtils;
67
importorg.junit.Assert;
78
importorg.junit.Test;
89

@@ -27,7 +28,8 @@ public void correct() {
2728
assertNotNull(txs.get(0).getFrom());
2829
assertNotNull(txs.get(0).getTimeStamp());
2930
assertNotNull(txs.get(0).getGas());
30-
assertNotNull(txs.get(0).getHash());
31+
assertNotNull(txs.get(0).getValue());
32+
assertTrue(BasicUtils.isEmpty(txs.get(0).getErrCode()));
3133
}
3234

3335
@Test(expected =InvalidTxHashException.class)

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

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp