Commit Graph

157 Commits

Author SHA1 Message Date
adrianziser
c891d41bef * switched from Curl-P27 -> Curl-P81
* new Transaction format
2017-09-24 00:03:18 +02:00
Michael Schierl
2a39e03f36 Add support for local PoW
To use it, call the `localPoW` method of the IotaAPI.Builder and pass
your desired PoW implementation.

The included implementation uses @Come-from-Beyond's PearlDiver (which
according to a statement of him on Slack may be used "for whatever you
wish" despite missing a license in the repo) to performs PoW by CPU.
Other implementations are possible (even outside this lib) by
implementing the IotaLocalPoW interface.

The PearlDiver class has been taken from
iotaledger/PearlDiver@212c332d60, the only
modification was to make it Java 7 compatible by replacing the lambda
with a Runnable anonymous class and fixing the nested `this` references
to point to the outer class.
2017-09-15 20:59:48 +02:00
adrianziser
f758fc2a9c Merge pull request #36 from schierlm/patch-2
Fix ambiguous utility method call - thx @schierlm
2017-09-09 21:39:25 +02:00
adrianziser
b58064310f Merge pull request #37 from schierlm/patch-3
Use correct arraycopy length - thx @schierlm
2017-09-09 21:38:21 +02:00
Michael Schierl
c4535aefbe Avoid copying from Array to list and back
As Java's Lists use boxed Integers, we try to avoid the memory
consumption, GC pressure and time overhead caused by copying an int[]
into a List<Integer> and back again.
2017-09-07 22:13:26 +02:00
Michael Schierl
53df67d490 More arraycopy improvements
In fact, most arraycopy and copyOfRange calls in the class are unneeded,
since Kerl can also directly operate on array slices. Care has been
taken not to introduce new side effects, therefore one copyOfRange call
in `digests` needs to stay. Existing side effects are kept, although
probably undesirable (`signatureFragment` clobbers the `keyFragment`
input parameter).
2017-09-07 22:01:31 +02:00
Michael Schierl
f694178ac1 Use correct arraycopy length
The code copies 243 single adjacent element in an array using arraycopy in a loop. For copying single elements, direct array access is more performant (as it avoids the penalty of calling into native code and the JIT may detect patterns and optimize them). However, in this case, as the copied elements are adjacent, replace the whole loop with a single arraycopy call.
2017-09-02 21:27:45 +02:00
Michael Schierl
8f655c0487 Fix ambiguous utility method call
The trits() method that takes a `String` first checks if the String contains a number, and if yes tries to convert that number into trytes. A String consisting only of digits "9" is ambiguous and has been converted as a number instead of a String (making one unit test fail). Since there is only one caller of that method that intentionally passes a number containing a String (and it is even in the same class), refactor it to have overloads taking a String vs. a long value and fix the only caller to use the long overload instead.
2017-09-02 21:23:30 +02:00
Michael Schierl
a1278b1d73 Fix inverted condition
Found by Eclipse's static null value analyzer.

It makes no sense to set the value to 0 if it is not null. That way, null remains null (and will create a NPE in line 123), and all other values get overwritten by 0. Therefore, overwrite null by zero, fixing both warnings.
2017-09-02 19:46:55 +02:00
adrianziser
f43d606f04 speed optimization (java 7 compatible) thx @th0br0 2017-08-16 20:01:34 +02:00
Oliver Nitzschke
75c433e1e8 Merge pull request #29 from jpkrohling/JPK-FixBuilder
Fixed IOTA API Builder
2017-08-15 11:58:03 +02:00
Juraci Paixão Kröhling
74d9025165
Fixed IOTA API Builder 2017-08-15 09:27:57 +02:00
Juraci Paixão Kröhling
4d88496054
Transfer should not require a tag 2017-08-15 09:01:06 +02:00
pinpong
1114e56b42 updated getAccountData 2017-08-13 16:00:23 +02:00
pinpong
eddf73dd09 updated getAccountData 2017-08-13 15:25:57 +02:00
pinpong
2a9a6abd35 added getAccountData 2017-08-13 14:36:56 +02:00
pinpong
d2b33f73bd refactored 2017-08-13 07:27:28 +02:00
adrianziser
3650407eb9 cleanup 2017-08-13 01:26:19 +02:00
adrianziser
ba0d5bbbc3 curl is still used for the calculation of transaction hashs 2017-08-13 01:23:57 +02:00
adrianziser
f3a32d4bdc switched from curl to kerl 2017-08-12 15:56:06 +02:00
Oliver Nitzschke
6241a01446 Merge pull request #19 from toonsevrin/patch-1
Patch 1
2017-07-02 23:10:45 +02:00
Toon Sevrin
5693c69bc4 Made inputValidation optional 2017-07-02 13:30:22 +02:00
Toon Sevrin
7f5910bdd7 Added optional inputValidation and remainder 2017-07-02 13:13:09 +02:00
Andreas C. Osowski
65883fc80f Fixes #14
`IotaAPI.prepareTransfers` should pass `remainderAddress` to
`IotaAPI.addRemainder`
2017-06-19 11:16:04 +02:00
Oliver Nitzschke
ebe81b22c2 updated neighbors model 2017-06-03 09:46:32 +02:00
pinpong
8b3b9dd6c9 documentation 2017-02-19 15:28:17 +01:00
adrianziser
bbaa4d8b2f Multisig implementation finished 2017-02-18 20:37:26 +01:00
pinpong
5e956137a4 fixed last commit 2017-02-16 19:28:28 +01:00
pinpong
73799607cb refactored 2017-02-15 23:52:46 +01:00
pinpong
1c019746df Fixed NullPointer 2017-02-15 20:16:02 +01:00
pinpong
ec3a1fde08 Revert "Fixed NullPointer"
This reverts commit 220872d594.
2017-02-15 20:14:49 +01:00
pinpong
220872d594 Fixed NullPointer 2017-02-15 19:23:58 +01:00
pinpong
d0f2a5517c documentation 2017-02-15 18:16:25 +01:00
pinpong
8c2a36bacf documentation 2017-02-14 21:05:27 +01:00
pinpong
8cb20c2792 documentation 2017-02-14 20:58:35 +01:00
pinpong
bc451b81aa documentation 2017-02-14 20:20:15 +01:00
pinpong
6000f702d6 documentation 2017-02-13 18:06:23 +01:00
pinpong
878f5e9f95 documentation 2017-02-12 23:36:47 +01:00
pinpong
e4db4219e0 documentation 2017-02-12 23:18:51 +01:00
adrianziser
90ac1071ee always clone curl instance 2017-02-12 17:53:12 +01:00
pinpong
ecf1e5d58f fixed small extension 2017-02-05 20:03:20 +01:00
pinpong
cdea177ebd added more documentation 2017-02-05 13:43:06 +01:00
pinpong
8e08047b93 added documentation 2017-02-05 11:57:13 +01:00
AZ
7709521c8c add missing class 2017-02-04 19:11:13 +01:00
AZ
4b4c4af7ae multisigs [wip] 2017-02-04 18:56:10 +01:00
AZ
62bf75ed53 small extension for tests & inputvalidation, added multisignatures (WIP) 2017-02-04 18:55:07 +01:00
pinpong
f143cfbbf6 extended tests 2017-02-03 16:50:17 +01:00
pinpong
92f8d31a1d private key generation with security level param 2017-02-02 23:27:23 +01:00
pinpong
8cf315fb09 fixed merge #10 2017-02-02 16:59:12 +01:00
AZ
6176b0d556 refactored 2017-01-29 20:23:23 +01:00