Skip to content
This repository was archived by the owner on Jun 7, 2023. It is now read-only.

Commit b2b49f4

Browse files
authored
Merge pull request #131 from iotaledger/dev
1.0.0-beta2 pre-release
2 parents a7165b2 + f2eccc8 commit b2b49f4

30 files changed

+1028
-336
lines changed

README.md

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
![IOTA Logo][iota-logo]
22

33
# IOTA Java Library
4-
4+
[![Codacy Badge][codacy-badge]][codacy]
55
[![JitPack][jitpack-badge]][jitpack]
66
[![Build Status][travis-badge]][travis]
77
[![License][license-badge]][license]
@@ -36,7 +36,7 @@ All the boilerplate code for connecting to the node REST interface has been hidd
3636
1. [Disclaimer](#disclaimer)
3737
1. [Supporting the project](#supporting-the-project)
3838
1. [Join the Discussion](#join-the-discussion)
39-
1. [License](#license)
39+
1. [License](codacity#license)
4040

4141
## Installation
4242

@@ -56,7 +56,7 @@ allprojects {
5656
Add this in your module `build.gradle` file:
5757
```gradle
5858
dependencies {
59-
compile 'com.github.iotaledger:iota-java:1.0.0-beta1'
59+
compile 'com.github.iotaledger:iota-java:1.0.0-beta2'
6060
}
6161
```
6262

@@ -82,7 +82,7 @@ Add this in your module `pom.xml` file:
8282
</dependency>
8383
```
8484
For the [VERSION_INFORMATION], you can choose to set it to a release number, or the first 10 characters of a commit hash.
85-
`<version>17e0de8ed5</version>` or `<version>1.0.0-beta1</version>`
85+
`<version>f3200c8380</version>` or `<version>1.0.0-beta2</version>`
8686

8787
Or check it out at [Jitpack](https://jitpack.io/#iotaledger/iota-java) for more specific information
8888

@@ -96,7 +96,7 @@ Reference your new project to the "jota" project.
9696

9797
##### Linking jar
9898
In order to build the jar; the following command should be run on the "jota" project:
99-
'mvn clean install -Prelease -DprofileIdEnabled=true'
99+
'mvn clean install'
100100

101101
This will generate a jar with the following format: `jota-[VERSION]-jar-with-dependencies.jar`
102102

@@ -279,17 +279,19 @@ See the License for the specific language governing permissions and
279279
limitations under the License.
280280
```
281281

282-
[iota-logo]: https://raw.githubusercontent.com/iotaledger/documentation/master/source/images/iota-logo.png
282+
[iota-logo]: https://avatars0.githubusercontent.com/u/20126597?s=200&v=4
283+
[codacy]: https://www.codacy.com/app/kwek20/iota-java?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=iotaledger/iota-java&amp;utm_campaign=Badge_Grade
284+
[codacy-badge]: https://api.codacy.com/project/badge/Grade/92feea51a15c4e589386c269475b8761
283285
[jitpack]: https://jitpack.io/#iotaledger/iota-java
284286
[jitpack-badge]: https://jitpack.io/v/iotaledger/iota-java.svg
285287
[travis]: https://travis-ci.org/iotaledger/iota-java
286288
[travis-badge]: https://travis-ci.org/iotaledger/iota-java.svg?branch=master
287289
[license]: https://github.com/iotaledger/iota-java/blob/master/LICENSE
288290
[license-badge]: https://img.shields.io/github/license/iotaledger/iota-java.svg
289-
[iota-iri]: https://github.com/iotaledger/iri/tree/v1.5.0
290-
[iota-iri-badge]: https://img.shields.io/badge/IOTA%20IRI%20compatibility-v1.5.0-blue.svg
291+
[iota-iri]: https://github.com/iotaledger/iri/tree/v1.5.5
292+
[iota-iri-badge]: https://img.shields.io/badge/IOTA%20IRI%20compatibility-v1.5.5-blue.svg
291293
[iota-api]: https://iota.readme.io/reference
292-
[iota-api-badge]: https://img.shields.io/badge/IOTA%20API%20coverage-14/15%20commands-red.svg
294+
[iota-api-badge]: https://img.shields.io/badge/IOTA%20API%20coverage-15/15%20commands-green.svg
293295
[javadoc]: https://iotaledger.github.io/iota-java/javadoc/
294296
[issues]: https://github.com/iotaledger/iota-java/issues
295297
[new-issue]: https://github.com/iotaledger/iota-java/issues/new

jota/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>org.iota</groupId>
77
<artifactId>jota-parent</artifactId>
8-
<version>1.0.0-beta1</version>
8+
<version>1.0.0-beta2</version>
99
</parent>
1010

1111
<name>JOTA : Library</name>

jota/src/main/java/jota/IotaAPI.java

Lines changed: 214 additions & 139 deletions
Large diffs are not rendered by default.

jota/src/main/java/jota/dto/response/GetNewAddressResponse.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,12 @@ public static GetNewAddressResponse create(List<String> addresses, long duration
2727
public List<String> getAddresses() {
2828
return addresses;
2929
}
30+
31+
/**
32+
* Gets the first address, for quick access
33+
* @return The address
34+
*/
35+
public String first() {
36+
return addresses.get(0);
37+
}
3038
}

jota/src/main/java/jota/dto/response/GetNodeInfoResponse.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ public class GetNodeInfoResponse extends AbstractResponse {
2121
private long time;
2222
private int tips;
2323
private int transactionsToRequest;
24+
25+
private String[] features;
2426

2527
/**
2628
* The name of the IOTA software the node currently running (IRI stands for Initial Reference Implementation).
@@ -167,4 +169,12 @@ public int getTips() {
167169
public int getTransactionsToRequest() {
168170
return transactionsToRequest;
169171
}
172+
173+
/**
174+
*
175+
* @return
176+
*/
177+
public String[] getFeatures() {
178+
return features;
179+
}
170180
}

jota/src/main/java/jota/error/BaseException.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@
44
import java.util.Arrays;
55
import java.util.Collection;
66

7-
/**
8-
* @author Adrian
9-
*/
107
public class BaseException extends Exception {
118

129
/**

jota/src/main/java/jota/model/Bundle.java

Lines changed: 4 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
import jota.pow.ICurl;
44
import jota.pow.SpongeFactory;
55
import jota.utils.Converter;
6+
import jota.utils.Signing;
7+
68
import org.apache.commons.lang3.StringUtils;
79

810
import java.util.ArrayList;
@@ -12,7 +14,6 @@
1214
/**
1315
* This class represents a Bundle, a set of transactions.
1416
*
15-
* @author pinpong
1617
**/
1718
public class Bundle implements Comparable<Bundle> {
1819

@@ -25,7 +26,7 @@ public class Bundle implements Comparable<Bundle> {
2526
* Initializes a new instance of the Bundle class without transactions.
2627
*/
2728
public Bundle() {
28-
this(new ArrayList<Transaction>(), 0);
29+
this(new ArrayList<>(), 0);
2930
}
3031

3132
/**
@@ -181,41 +182,7 @@ public void addTrytes(List<String> signatureFragments) {
181182
* @return normalizedBundle A normalized bundle hash.
182183
*/
183184
public int[] normalizedBundle(String bundleHash) {
184-
int[] normalizedBundle = new int[81];
185-
186-
for (int i = 0; i < 3; i++) {
187-
188-
long sum = 0;
189-
for (int j = 0; j < 27; j++) {
190-
191-
sum += (normalizedBundle[i * 27 + j] = Converter.value(Converter.tritsString("" + bundleHash.charAt(i * 27 + j))));
192-
}
193-
194-
if (sum >= 0) {
195-
while (sum-- > 0) {
196-
for (int j = 0; j < 27; j++) {
197-
if (normalizedBundle[i * 27 + j] > -13) {
198-
normalizedBundle[i * 27 + j]--;
199-
break;
200-
}
201-
}
202-
}
203-
} else {
204-
205-
while (sum++ < 0) {
206-
207-
for (int j = 0; j < 27; j++) {
208-
209-
if (normalizedBundle[i * 27 + j] < 13) {
210-
normalizedBundle[i * 27 + j]++;
211-
break;
212-
}
213-
}
214-
}
215-
}
216-
}
217-
218-
return normalizedBundle;
185+
return new Signing().normalizedBundle(bundleHash);
219186
}
220187

221188

jota/src/main/java/jota/model/Input.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
/**
77
* This class represents an Input.
88
*
9-
* @author Adrian
109
**/
1110
public class Input {
1211

jota/src/main/java/jota/model/Inputs.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public List<Input> getInputsList() {
4747
* @param inputsList The input list.
4848
*/
4949
public void setInputsList(List<Input> inputsList) {
50-
inputsList = inputsList;
50+
this.inputsList = inputsList;
5151
}
5252

5353
/**

jota/src/main/java/jota/model/Neighbor.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
/**
44
* This class represents an Neighbor.
55
*
6-
* @author pinpong
76
**/
87
public class Neighbor {
98

0 commit comments

Comments
 (0)