From eedd456af2a2ffb9077070395850a2660f7897d9 Mon Sep 17 00:00:00 2001 From: Gianluigi Davassi Date: Mon, 26 Dec 2016 09:36:41 +0100 Subject: [PATCH 01/45] Update (#9) * fixed getTransactionsToApprove (#12) * updated GetNodeInfo * fixed getTransactionsToApprove * fixed getTransactionsToApprove * updated tests (#13) * updated tests * Bundle: fixed addEntry * added getLatestInclusion (#14) * added getLatestInclusion * added findTransactionObjects * added documentation * added replayTransfer, findTransaction (#15) * added findTransactionObjects * added documentation * fixed NullPoointer * added replayTransfer * extended InputValidatorTest * fixed merge conflict --- src/main/java/jota/IotaAPIProxy.java | 157 +++++++++++------- .../dto/response/GetNodeInfoResponse.java | 5 + .../GetTransactionsToApproveResponse.java | 12 +- src/main/java/jota/model/Bundle.java | 16 +- src/main/java/jota/model/Transaction.java | 8 + src/main/java/jota/utils/Converter.java | 41 ++++- src/test/java/jota/InputValidatorTest.java | 29 +++- src/test/java/jota/IotaAPIProxyTest.java | 65 +++++++- 8 files changed, 237 insertions(+), 96 deletions(-) diff --git a/src/main/java/jota/IotaAPIProxy.java b/src/main/java/jota/IotaAPIProxy.java index 6bb6032..173bda8 100644 --- a/src/main/java/jota/IotaAPIProxy.java +++ b/src/main/java/jota/IotaAPIProxy.java @@ -1,48 +1,7 @@ package jota; -import java.io.BufferedReader; -import java.io.FileReader; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Calendar; -import java.util.Collection; -import java.util.Collections; -import java.util.List; -import java.util.Properties; -import java.util.concurrent.TimeUnit; - -import org.apache.commons.lang3.StringUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import jota.dto.request.IotaAttachToTangleRequest; -import jota.dto.request.IotaBroadcastTransactionRequest; -import jota.dto.request.IotaCommandRequest; -import jota.dto.request.IotaFindTransactionsRequest; -import jota.dto.request.IotaGetBalancesRequest; -import jota.dto.request.IotaGetInclusionStateRequest; -import jota.dto.request.IotaGetTransactionsToApproveRequest; -import jota.dto.request.IotaGetTrytesRequest; -import jota.dto.request.IotaNeighborsRequest; -import jota.dto.request.IotaStoreTransactionsRequest; -import jota.dto.response.AddNeighborsResponse; -import jota.dto.response.BroadcastTransactionsResponse; -import jota.dto.response.FindTransactionResponse; -import jota.dto.response.GetAttachToTangleResponse; -import jota.dto.response.GetBalancesAndFormatResponse; -import jota.dto.response.GetBalancesResponse; -import jota.dto.response.GetBundleResponse; -import jota.dto.response.GetInclusionStateResponse; -import jota.dto.response.GetNeighborsResponse; -import jota.dto.response.GetNewAddressResponse; -import jota.dto.response.GetNodeInfoResponse; -import jota.dto.response.GetTipsResponse; -import jota.dto.response.GetTransactionsToApproveResponse; -import jota.dto.response.GetTrytesResponse; -import jota.dto.response.InterruptAttachingToTangleResponse; -import jota.dto.response.RemoveNeighborsResponse; -import jota.dto.response.StoreTransactionsResponse; +import jota.dto.request.*; +import jota.dto.response.*; import jota.model.Bundle; import jota.model.Input; import jota.model.Transaction; @@ -51,11 +10,20 @@ import jota.utils.Converter; import jota.utils.InputValidator; import jota.utils.IotaAPIUtils; import okhttp3.OkHttpClient; +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import retrofit2.Call; import retrofit2.Response; import retrofit2.Retrofit; import retrofit2.converter.gson.GsonConverterFactory; +import java.io.BufferedReader; +import java.io.FileReader; +import java.io.IOException; +import java.util.*; +import java.util.concurrent.TimeUnit; + /** * IotaAPIProxy Builder. Usage: * @@ -282,15 +250,15 @@ public class IotaAPIProxy { * sendTrytes * prepareTransfers * getInputs - + * getLatestInclusion + getTransfers sendTransfer getBundle getTransactionsObjects findTransactionObjects - getLatestInclusion - + replayBundle broadcastBundle getAccountData @@ -317,14 +285,14 @@ public class IotaAPIProxy { * @param {array} trytes * @param {int} depth * @param {int} minWeightMagnitude - * @return + * @return */ public List sendTrytes(final String trytes, final int minWeightMagnitude) { final GetTransactionsToApproveResponse txs = getTransactionsToApprove(minWeightMagnitude); // attach to tangle - do pow - final GetAttachToTangleResponse res = attachToTangle(txs.getTrunkTransaction(), txs.getBranchTransactionToApprove(), minWeightMagnitude, trytes); + final GetAttachToTangleResponse res = attachToTangle(txs.getTrunkTransaction(), txs.getBranchTransaction(), minWeightMagnitude, trytes); try { broadcastAndStore(res.getTrytes()); @@ -341,13 +309,7 @@ public class IotaAPIProxy { } return trx; } - - public List findAndGetTxs(final String addresses) { - final FindTransactionResponse res = findTransactionsByAddresses(addresses); - return getTransactionsObjects(res.getHashes()); - } - /** * Wrapper function for getTrytes and transactionObjects * gets the trytes and transaction object from a list of transaction hashes @@ -358,7 +320,7 @@ public class IotaAPIProxy { * @returns {function} callback * @returns {object} success **/ - public List getTransactionsObjects(String ... hashes) { + public List getTransactionsObjects(String[] hashes) { if (!InputValidator.isArrayOfHashes(hashes)) { throw new IllegalStateException("Not an Array of Hashes: " + Arrays.toString(hashes)); @@ -373,6 +335,26 @@ public class IotaAPIProxy { } return trxs; } + + /** + * Wrapper function for findTransactions, getTrytes and transactionObjects + * Returns the transactionObject of a transaction hash. The input can be a valid + * findTransactions input + * + * @param {object} input + * @method getTransactionsObjects + * @returns {function} callback + * @returns {object} success + **/ + public List findTransactionObjects(String[] input) { + FindTransactionResponse ftr = findTransactions(input, null, null, null); + if (ftr == null || ftr.getHashes() == null) + + return null; + + // get the transaction objects of the transactions + return getTransactionsObjects(ftr.getHashes()); + } /** * Prepares transfer by generating bundle, finding and signing inputs @@ -413,7 +395,7 @@ public class IotaAPIProxy { // Get total length, message / maxLength (2187 trytes) signatureMessageLength += Math.floor(transfer.getMessage().length() / 2187); - String msgCopy = new String(transfer.getMessage()); + String msgCopy = transfer.getMessage(); // While there is still a message, copy it while (!msgCopy.isEmpty()) { @@ -575,10 +557,12 @@ public class IotaAPIProxy { // Calls getBalances and formats the output // returns the final inputsObject then - public GetBalancesAndFormatResponse getBalanceAndFormat(final List addresses, - final List balances, long threshold, int start, int end) { + public GetBalancesAndFormatResponse getBalanceAndFormat(final List addresses, List balances, long threshold, int start, int end) { - GetBalancesResponse bres = getBalances(100, addresses); + if (balances == null || balances.isEmpty()) { + GetBalancesResponse getBalancesResponse = getBalances(100, addresses); + balances = Arrays.asList(getBalancesResponse.getBalances()); + } // If threshold defined, keep track of whether reached or not // else set default to true @@ -598,7 +582,7 @@ public class IotaAPIProxy { // Increase totalBalance of all aggregated inputs totalBalance += balance; - if (thresholdReached == false && totalBalance >= threshold) { + if (!thresholdReached && totalBalance >= threshold) { thresholdReached = true; break; } @@ -610,11 +594,60 @@ public class IotaAPIProxy { } throw new IllegalStateException("Not enough balance"); } - + + /** + * Gets the associated bundle transactions of a single transaction + * Does validation of signatures, total sum as well as bundle order + * + * @method getBundle + * @param {string} transaction Hash of a tail transaction + * @returns {list} bundle Transaction objects + **/ public GetBundleResponse getBundle(String transaction) { return null; //IotaAPIUtils.getBundle(transaction); } - + + /** + * Replays a transfer by doing Proof of Work again + * + * @method replayBundle + * @param {string} tail + * @param {int} depth + * @param {int} minWeightMagnitude + * @param {function} callback + * @returns {object} analyzed Transaction objects + **/ + public List replayTransfer(String transaction, int depth, int minWeightMagnitude) { + + List bundleTrytes = new ArrayList<>(); + + GetBundleResponse bundle = getBundle(transaction); + + for (Transaction element : bundle.getTransactions()) { + + bundleTrytes.add(IotaAPIUtils.transactionTrytes(element)); + } + + return sendTrytes(bundleTrytes, minWeightMagnitude); + } + + /** + * Wrapper function for getNodeInfo and getInclusionStates + * + * @method getLatestInclusion + * @param {array} hashes + * @returns {function} callback + * @returns {array} state + **/ + public GetInclusionStateResponse getLatestInclusion(String[] hashes) { + GetNodeInfoResponse getNodeInfoResponse = getNodeInfo(); + if (getNodeInfoResponse == null) return null; + + String[] latestMilestone = {getNodeInfoResponse.getLatestSolidSubtangleMilestone()}; + + return getInclusionStates(hashes, latestMilestone); + } + public static class Builder { String protocol, host, port; diff --git a/src/main/java/jota/dto/response/GetNodeInfoResponse.java b/src/main/java/jota/dto/response/GetNodeInfoResponse.java index f7477e4..233c0fb 100644 --- a/src/main/java/jota/dto/response/GetNodeInfoResponse.java +++ b/src/main/java/jota/dto/response/GetNodeInfoResponse.java @@ -4,6 +4,7 @@ public class GetNodeInfoResponse extends AbstractResponse { private String appName; private String appVersion; + private String jreVersion; private int jreAvailableProcessors; private long jreFreeMemory; private long jreMaxMemory; @@ -26,6 +27,10 @@ public class GetNodeInfoResponse extends AbstractResponse { return appVersion; } + public String getJreVersion() { + return jreVersion; + } + public Integer getJreAvailableProcessors() { return jreAvailableProcessors; } diff --git a/src/main/java/jota/dto/response/GetTransactionsToApproveResponse.java b/src/main/java/jota/dto/response/GetTransactionsToApproveResponse.java index 5f76cf3..ba7d478 100644 --- a/src/main/java/jota/dto/response/GetTransactionsToApproveResponse.java +++ b/src/main/java/jota/dto/response/GetTransactionsToApproveResponse.java @@ -3,13 +3,13 @@ package jota.dto.response; public class GetTransactionsToApproveResponse extends AbstractResponse { private String trunkTransaction; - private String branchTransactionToApprove; - - public String getBranchTransactionToApprove() { - return branchTransactionToApprove; - } + private String branchTransaction; public String getTrunkTransaction() { return trunkTransaction; } -} + + public String getBranchTransaction() { + return branchTransaction; + } +} \ No newline at end of file diff --git a/src/main/java/jota/model/Bundle.java b/src/main/java/jota/model/Bundle.java index 675fbd7..90d966d 100644 --- a/src/main/java/jota/model/Bundle.java +++ b/src/main/java/jota/model/Bundle.java @@ -1,7 +1,6 @@ package jota.model; import jota.pow.Curl; -import jota.utils.Constants; import jota.utils.Converter; import java.util.ArrayList; @@ -43,18 +42,14 @@ public class Bundle { this.length = length; } - public void addEntry(int signatureMessageLength, String slice, long value, String tag, long timestamp) { + public void addEntry(int signatureMessageLength, String address, long value, String tag, long timestamp) { for (int i = 0; i < signatureMessageLength; i++) { - //TODO -/* var transactionObject = new Object(); - transactionObject.address = address; - transactionObject.value = i == 0 ? value : 0; - transactionObject.tag = tag; - transactionObject.timestamp = timestamp; + List transactions = new ArrayList<>(getTransactions()); + transactions.add(new Transaction(address, String.valueOf(i == 0 ? value : 0), tag, String.valueOf(timestamp))); + + setTransactions(transactions); - this.bundle[this.bundle.length] = transactionObject; -*/ } } @@ -84,6 +79,7 @@ public class Bundle { while (lastIndexTrits.length < 27) { lastIndexTrits[lastIndexTrits.length] = 0; } + int[] t = Converter.trits(this.getTransactions().get(i).getAddress() + Converter.trytes(valueTrits) + this.getTransactions().get(i).getTag() + Converter.trytes(timestampTrits) + Converter.trytes(currentIndexTrits) + Converter.trytes(lastIndexTrits)); curl.absorb(t, 0, t.length); } diff --git a/src/main/java/jota/model/Transaction.java b/src/main/java/jota/model/Transaction.java index 8a74f5a..0f7f962 100644 --- a/src/main/java/jota/model/Transaction.java +++ b/src/main/java/jota/model/Transaction.java @@ -41,6 +41,14 @@ public class Transaction { this.nonce = nonce; } + + public Transaction(String address, String value, String tag, String timestamp) { + this.address = address; + this.value = value; + this.tag = tag; + this.timestamp = timestamp; + } + @Override public String toString() { return ToStringBuilder.reflectionToString(this, ToStringStyle.MULTI_LINE_STYLE); diff --git a/src/main/java/jota/utils/Converter.java b/src/main/java/jota/utils/Converter.java index 90550e7..4276b08 100644 --- a/src/main/java/jota/utils/Converter.java +++ b/src/main/java/jota/utils/Converter.java @@ -2,14 +2,12 @@ package jota.utils; import jota.model.Transaction; import jota.pow.Curl; - -import java.util.Arrays; -import java.util.Optional; - import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.util.Arrays; + public class Converter { private static final Logger log = LoggerFactory.getLogger(Converter.class); @@ -69,12 +67,39 @@ public class Converter { } public static int[] trits(final String trytes) { - final int[] trits = new int[trytes.length() * NUMBER_OF_TRITS_IN_A_TRYTE]; - for (int i = 0; i < trytes.length(); i++) { - System.arraycopy(TRYTE_TO_TRITS_MAPPINGS[Constants.TRYTE_ALPHABET.indexOf(trytes.charAt(i))], 0, trits, i * NUMBER_OF_TRITS_IN_A_TRYTE, NUMBER_OF_TRITS_IN_A_TRYTE); - } + if (InputValidator.isValue(trytes)) { + + int value = Integer.parseInt(trytes); + + long absoluteValue = value < 0 ? -value : value; + + while (absoluteValue > 0) { + + int remainder = (int) (absoluteValue % RADIX); + absoluteValue /= RADIX; + + if (remainder > MAX_TRIT_VALUE) { + remainder = MIN_TRIT_VALUE; + absoluteValue++; + } + + trits[trits.length] = remainder; + } + if (value < 0) { + + for (int i = 0; i < trits.length; i++) { + + trits[i] = -trits[i]; + } + } + } else { + + for (int i = 0; i < trytes.length(); i++) { + System.arraycopy(TRYTE_TO_TRITS_MAPPINGS[Constants.TRYTE_ALPHABET.indexOf(trytes.charAt(i))], 0, trits, i * NUMBER_OF_TRITS_IN_A_TRYTE, NUMBER_OF_TRITS_IN_A_TRYTE); + } + } return trits; } diff --git a/src/test/java/jota/InputValidatorTest.java b/src/test/java/jota/InputValidatorTest.java index 5f4795e..b898baf 100644 --- a/src/test/java/jota/InputValidatorTest.java +++ b/src/test/java/jota/InputValidatorTest.java @@ -1,8 +1,12 @@ package jota; +import jota.model.Transfer; import jota.utils.InputValidator; import org.junit.Test; +import java.util.ArrayList; +import java.util.List; + import static org.junit.Assert.assertEquals; /** @@ -11,8 +15,11 @@ import static org.junit.Assert.assertEquals; public class InputValidatorTest { private static final String TEST_ADDRESS_WITHOUT_CHECKSUM = "PNGMCSNRCTRHCHPXYTPKEJYPCOWKOMRXZFHH9N9VDIKMNVAZCMIYRHVJIAZARZTUETJVFDMBEBIQE9QTHBFWDAOEFA"; + private static final String TEST_ADDRESS_WITH_CHECKSUM = "PNGMCSNRCTRHCHPXYTPKEJYPCOWKOMRXZFHH9N9VDIKMNVAZCMIYRHVJIAZARZTUETJVFDMBEBIQE9QTHBFWDAOEFA"; private static final String TEST_TRYTES = "BYSWEAUTWXHXZ9YBZISEK9LUHWGMHXCGEVNZHRLUWQFCUSDXZHOFHWHL9MQPVJXXZLIXPXPXF9KYEREFSKCPKYIIKPZVLHUTDFQKKVVBBN9ATTLPCNPJDWDEVIYYLGPZGCWXOBDXMLJC9VO9QXTTBLAXTTBFUAROYEGQIVB9MJWJKXJMCUPTWAUGFZB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VYLCENJIOBLWNB999999999XKBRHUD99C99999999NKZKEKWLDKMJCI9N9XQOLWEPAYWSH9999999999999999999999999KDDTGZLIPBNZKMLTOLOXQVNGLASESDQVPTXALEKRMIOHQLUHD9ELQDBQETS9QFGTYOYWLNTSKKMVJAUXSIROUICDOXKSYZTDPEDKOQENTJOWJONDEWROCEJIEWFWLUAACVSJFTMCHHXJBJRKAAPUDXXVXFWP9X9999IROUICDOXKSYZTDPEDKOQENTJOWJONDEWROCEJIEWFWLUAACVSJFTMCHHXJBJRKAAPUDXXVXFWP9X9999"; - + private static final String TEST_HASH = "OAATQS9VQLSXCLDJVJJVYUGONXAXOFMJOZNSYWRZSWECMXAQQURHQBJNLD9IOFEPGZEPEMPXCIVRX9999"; + private static final String TEST_MESSAGE = "JOTA"; + private static final String TEST_TAG = "JOTASPAM9999999999999999999"; @Test public void shouldIsAddress() { assertEquals(InputValidator.isAddress(TEST_ADDRESS_WITHOUT_CHECKSUM), true); @@ -27,4 +34,22 @@ public class InputValidatorTest { public void shouldIsTrytes() { assertEquals(InputValidator.isTrytes(TEST_TRYTES, TEST_TRYTES.length()), true); } -} + + @Test + public void shouldIsValue() { + assertEquals(InputValidator.isValue("1234"), true); + } + + @Test + public void shouldIsArrayOfHashes() { + assertEquals(InputValidator.isArrayOfHashes(new String[]{TEST_HASH, TEST_HASH}), true); + } + + @Test + public void shouldIsTransfersCollectionCorrect() { + List transfers = new ArrayList<>(); + transfers.add(new jota.model.Transfer(TEST_ADDRESS_WITH_CHECKSUM, 0, TEST_MESSAGE, TEST_TAG)); + transfers.add(new jota.model.Transfer(TEST_ADDRESS_WITH_CHECKSUM, 0, TEST_MESSAGE, TEST_TAG)); + assertEquals(InputValidator.isTransfersCollectionCorrect(transfers), true); + } +} \ No newline at end of file diff --git a/src/test/java/jota/IotaAPIProxyTest.java b/src/test/java/jota/IotaAPIProxyTest.java index 7f62a73..ffb52ac 100644 --- a/src/test/java/jota/IotaAPIProxyTest.java +++ b/src/test/java/jota/IotaAPIProxyTest.java @@ -3,12 +3,15 @@ package jota; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import jota.dto.response.*; +import jota.model.Transfer; import org.hamcrest.core.Is; import org.hamcrest.core.IsNull; import org.junit.Before; import org.junit.Test; +import java.util.ArrayList; import java.util.Collections; +import java.util.List; import static org.junit.Assert.assertThat; @@ -28,6 +31,9 @@ public class IotaAPIProxyTest { private static final String TEST_TRYTES = "BYSWEAUTWXHXZ9YBZISEK9LUHWGMHXCGEVNZHRLUWQFCUSDXZHOFHWHL9MQPVJXXZLIXPXPXF9KYEREFSKCPKYIIKPZVLHUTDFQKKVVBBN9ATTLPCNPJDWDEVIYYLGPZGCWXOBDXMLJC9VO9QXTTBLAXTTBFUAROYEGQIVB9MJWJKXJMCUPTWAUGFZBTZCSJVRBGMYXTVBDDS9MYUJCPZ9YDWWQNIPUAIJXXSNLKUBSCOIJPCLEFPOXFJREXQCUVUMKSDOVQGGHRNILCO9GNCLWFM9APMNMWYASHXQAYBEXF9QRIHIBHYEJOYHRQJAOKAQ9AJJFQ9WEIWIJOTZATIBOXQLBMIJU9PCGBLVDDVFP9CFFSXTDUXMEGOOFXWRTLFGV9XXMYWEMGQEEEDBTIJ9OJOXFAPFQXCDAXOUDMLVYRMRLUDBETOLRJQAEDDLNVIRQJUBZBO9CCFDHIX9MSQCWYAXJVWHCUPTRSXJDESISQPRKZAFKFRULCGVRSBLVFOPEYLEE99JD9SEBALQINPDAZHFAB9RNBH9AZWIJOTLBZVIEJIAYGMC9AZGNFWGRSWAXTYSXVROVNKCOQQIWGPNQZKHUNODGYADPYLZZZUQRTJRTODOUKAOITNOMWNGHJBBA99QUMBHRENGBHTH9KHUAOXBVIVDVYYZMSEYSJWIOGGXZVRGN999EEGQMCOYVJQRIRROMPCQBLDYIGQO9AMORPYFSSUGACOJXGAQSPDY9YWRRPESNXXBDQ9OZOXVIOMLGTSWAMKMTDRSPGJKGBXQIVNRJRFRYEZ9VJDLHIKPSKMYC9YEGHFDS9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HOGQ9WOMQFHWJVEG9NYX9KWBTCAIXNXHEBDIOFO9ALYMFGRICLCKKLG9FOBOX9PDWNQRGHBKHGKKRLWTBEQMCWQRLHAVYYZDIIPKVQTHYTWQMTOACXZOQCDTJTBAAUWXSGJF9PNQIJ9AJRUMUVCPWYVYVARKR9RKGOUHHNKNVGGPDDLGKPQNOYHNKAVVKCXWXOQPZNSLATUJT9AUWRMPPSWHSTTYDFAQDXOCYTZHOYYGAIM9CELMZ9AZPWB9MJXGHOKDNNSZVUDAGXTJJSSZCPZVPZBYNNTUQABSXQWZCHDQSLGK9UOHCFKBIBNETK999999999999999999999999999999999999999999999999999999999999999999999999999999999NOXDXXKUDWLOFJLIPQIBRBMGDYCPGDNLQOLQS99EQYKBIU9VHCJVIPFUYCQDNY9APGEVYLCENJIOBLWNB999999999XKBRHUD99C99999999NKZKEKWLDKMJCI9N9XQOLWEPAYWSH9999999999999999999999999KDDTGZLIPBNZKMLTOLOXQVNGLASESDQVPTXALEKRMIOHQLUHD9ELQDBQETS9QFGTYOYWLNTSKKMVJAUXSIROUICDOXKSYZTDPEDKOQENTJOWJONDEWROCEJIEWFWLUAACVSJFTMCHHXJBJRKAAPUDXXVXFWP9X9999IROUICDOXKSYZTDPEDKOQENTJOWJONDEWROCEJIEWFWLUAACVSJFTMCHHXJBJRKAAPUDXXVXFWP9X9999"; private static final String TEST_MILESTONE = "SMYMAKKPSUKCKDRUEYCGZJTYCZ9HHDMDUWBAPXARGURPQRHTAJDASRWMIDTPTBNDKDEFBUTBGGAFX9999"; private static final Integer TEST_MILESTONE_INDEX = 8059; + private static final String TEST_MESSAGE = "JOTA"; + private static final String TEST_TAG = "JOTASPAM9999999999999999999"; + private IotaAPIProxy proxy; @@ -40,6 +46,21 @@ public class IotaAPIProxyTest { public void shouldGetNodeInfo() { GetNodeInfoResponse nodeInfo = proxy.getNodeInfo(); assertThat(nodeInfo.getAppVersion(), IsNull.notNullValue()); + assertThat(nodeInfo.getAppName(), IsNull.notNullValue()); + //assertThat(nodeInfo.getJreVersion(), IsNull.notNullValue()); + assertThat(nodeInfo.getJreAvailableProcessors(), IsNull.notNullValue()); + assertThat(nodeInfo.getJreFreeMemory(), IsNull.notNullValue()); + assertThat(nodeInfo.getJreMaxMemory(), IsNull.notNullValue()); + assertThat(nodeInfo.getJreTotalMemory(), IsNull.notNullValue()); + assertThat(nodeInfo.getLatestMilestone(), IsNull.notNullValue()); + assertThat(nodeInfo.getLatestMilestoneIndex(), IsNull.notNullValue()); + assertThat(nodeInfo.getLatestSolidSubtangleMilestone(), IsNull.notNullValue()); + assertThat(nodeInfo.getLatestSolidSubtangleMilestoneIndex(), IsNull.notNullValue()); + assertThat(nodeInfo.getNeighbors(), IsNull.notNullValue()); + assertThat(nodeInfo.getPacketsQueueSize(), IsNull.notNullValue()); + assertThat(nodeInfo.getTime(), IsNull.notNullValue()); + assertThat(nodeInfo.getTips(), IsNull.notNullValue()); + assertThat(nodeInfo.getTransactionsToRequest(), IsNull.notNullValue()); } @Test @@ -70,25 +91,25 @@ public class IotaAPIProxyTest { public void shouldFindTransactionsByAddresses() { FindTransactionResponse trans = proxy.findTransactionsByAddresses(TEST_ADDRESS_WITH_CHECKSUM); System.err.println(gson.toJson(trans)); - assertThat(trans, IsNull.notNullValue()); + assertThat(trans.getHashes(), IsNull.notNullValue()); } @Test public void shouldFindTransactionsByApprovees() { FindTransactionResponse trans = proxy.findTransactionsByApprovees(new String[]{TEST_HASH}); - assertThat(trans, IsNull.notNullValue()); + assertThat(trans.getHashes(), IsNull.notNullValue()); } @Test public void shouldFindTransactionsByBundles() { FindTransactionResponse trans = proxy.findTransactionsByBundles(TEST_HASH); - assertThat(trans, IsNull.notNullValue()); + assertThat(trans.getHashes(), IsNull.notNullValue()); } @Test public void shouldFindTransactionsByDigests() { FindTransactionResponse trans = proxy.findTransactionsByDigests(TEST_HASH); - assertThat(trans, IsNull.notNullValue()); + assertThat(trans.getHashes(), IsNull.notNullValue()); } @@ -97,27 +118,32 @@ public class IotaAPIProxyTest { @Test public void shouldGetTrytes() { GetTrytesResponse res = proxy.getTrytes(TEST_HASH); - assertThat(res, IsNull.notNullValue()); + assertThat(res.getTrytes(), IsNull.notNullValue()); } @Test public void shouldGetInclusionStates() { GetInclusionStateResponse res = proxy.getInclusionStates(new String[]{TEST_ADDRESS_WITH_CHECKSUM}, new String[]{"DNSBRJWNOVUCQPILOQIFDKBFJMVOTGHLIMLLRXOHFTJZGRHJUEDAOWXQRYGDI9KHYFGYDWQJZKX999999"}); - assertThat(res, IsNull.notNullValue()); + assertThat(res.getStates(), IsNull.notNullValue()); } @Test // very long execution public void shouldGetTransactionsToApprove() { GetTransactionsToApproveResponse res = proxy.getTransactionsToApprove(27); - assertThat(res, IsNull.notNullValue()); + assertThat(res.getTrunkTransaction(), IsNull.notNullValue()); + assertThat(res.getBranchTransaction(), IsNull.notNullValue()); + } @Test public void shouldGetBalances() { GetBalancesResponse res = proxy.getBalances(100, new String[]{TEST_ADDRESS_WITH_CHECKSUM}); System.err.println(res); - assertThat(res, IsNull.notNullValue()); + assertThat(res.getBalances(), IsNull.notNullValue()); + assertThat(res.getMilestone(), IsNull.notNullValue()); + assertThat(res.getMilestoneIndex(), IsNull.notNullValue()); + } @Test @@ -131,4 +157,27 @@ public class IotaAPIProxyTest { final GetNewAddressResponse res = proxy.getNewAddress(TEST_SEED, 0, false, 1, false); assertThat(res.getAddresses(), Is.is(Collections.singletonList(TEST_ADDRESS_WITHOUT_CHECKSUM))); } + + @Test + public void shouldPrepareTransfer() { + List transfers = new ArrayList<>(); + transfers.add(new jota.model.Transfer(TEST_ADDRESS_WITH_CHECKSUM, 0, TEST_MESSAGE, TEST_TAG)); + proxy.prepareTransfers(TEST_SEED, transfers, null, null); + } + + @Test + public void shouldSendTrytes() { + proxy.sendTrytes(TEST_TRYTES, 18); + } + + @Test + public void shouldGetLastInclusionState() { + GetInclusionStateResponse res = proxy.getLatestInclusion(new String[]{TEST_HASH}); + assertThat(res.getStates(), IsNull.notNullValue()); + } + + @Test + public void shouldFindTransactionObjects() { + assertThat(proxy.findTransactionObjects(new String[]{TEST_ADDRESS_WITH_CHECKSUM}), IsNull.notNullValue()); + } } \ No newline at end of file From 3cddecbaf164f360fa326a6721b586baad3776cf Mon Sep 17 00:00:00 2001 From: Oliver Nitzschke Date: Thu, 2 Feb 2017 17:38:40 +0100 Subject: [PATCH 02/45] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 915be80..4fdc112 100644 --- a/README.md +++ b/README.md @@ -69,5 +69,5 @@ There's an extensive list of test coverages on the src/test/java package of the If JOTA has been useful to you and you feel like contributing, consider posting a bug report or a pull request. Alternatively, donations are very welcome too! -* Bitcoin (Gianni Davassi): `3FGCHqhG1SUpgn2eS1Agq2KnxJemWnQFbB` -* Bitcoin (Adrian Ziser): `3FGCHqhG1SUpgn2eS1Agq2KnxJemWnQFbB` \ No newline at end of file +* Bitcoin (Gianluigi Davassi): `3FGCHqhG1SUpgn2eS1Agq2KnxJemWnQFbB` +* Bitcoin (Adrian Ziser): `1MyCJP3yZtSJ3bMVEoQRPSY3D6Ev7CTvzo` From 9b00d3530452b0d2a7310488e124c6f83b24e466 Mon Sep 17 00:00:00 2001 From: Oliver Nitzschke Date: Thu, 2 Feb 2017 17:54:32 +0100 Subject: [PATCH 03/45] Update README.md --- README.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/README.md b/README.md index 4fdc112..82656f6 100644 --- a/README.md +++ b/README.md @@ -67,7 +67,4 @@ There's an extensive list of test coverages on the src/test/java package of the ##Supporting the project -If JOTA has been useful to you and you feel like contributing, consider posting a bug report or a pull request. Alternatively, donations are very welcome too! - -* Bitcoin (Gianluigi Davassi): `3FGCHqhG1SUpgn2eS1Agq2KnxJemWnQFbB` -* Bitcoin (Adrian Ziser): `1MyCJP3yZtSJ3bMVEoQRPSY3D6Ev7CTvzo` +If JOTA has been useful to you and you feel like contributing, consider posting a bug report or a pull request. From 7c4154efa5aac6a8efc950d2e241422e2291bed7 Mon Sep 17 00:00:00 2001 From: Oliver Nitzschke Date: Thu, 2 Feb 2017 21:55:48 +0100 Subject: [PATCH 04/45] Update README.md --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 82656f6..732705b 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,6 @@ +[![Build Status](https://travis-ci.org/iotaledger/iota.lib.java.svg?branch=dev)](https://travis-ci.org/iotaledger/iota.lib.java) + + ##Introduction The JOTA library is a simple Java wrapper around [[IOTA]](http://www.iotatoken.com/) Node's JSON-REST HTTP interface. From b8269ea186d7fa5fa9be1dbbcdf77caf1bb37b7d Mon Sep 17 00:00:00 2001 From: Oliver Nitzschke Date: Thu, 2 Feb 2017 22:03:26 +0100 Subject: [PATCH 05/45] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 732705b..f061cff 100644 --- a/README.md +++ b/README.md @@ -60,7 +60,7 @@ Jota is still *not* in the central maven repository. It will be available when i - This is pre-release software! - There may be performance and stability issues. - You may loose all your money :) - - Please report any issues using the Issue Tracker" + - Please report any issues using the Issue Tracker" That's it! From 92f8d31a1dc6c567dfa576e07ebff1430031586b Mon Sep 17 00:00:00 2001 From: pinpong Date: Thu, 2 Feb 2017 23:27:23 +0100 Subject: [PATCH 06/45] private key generation with security level param --- src/main/java/jota/IotaAPI.java | 119 +++++++++++------- .../error/InvalidSecurityLevelException.java | 11 ++ src/main/java/jota/model/Input.java | 14 ++- src/main/java/jota/utils/IotaAPIUtils.java | 46 +++---- src/test/java/jota/IotaAPITest.java | 24 ++-- 5 files changed, 135 insertions(+), 79 deletions(-) create mode 100644 src/main/java/jota/error/InvalidSecurityLevelException.java diff --git a/src/main/java/jota/IotaAPI.java b/src/main/java/jota/IotaAPI.java index ad1353d..514269c 100644 --- a/src/main/java/jota/IotaAPI.java +++ b/src/main/java/jota/IotaAPI.java @@ -41,13 +41,19 @@ public class IotaAPI extends IotaAPICore { * This is either done deterministically, or by providing the index of the new remainderAddress * * @param seed Tryte-encoded seed. It should be noted that this seed is not transferred + * @param security Security level to be used for the private key / address. Can be 1, 2 or 3 * @param index Optional (default null). Key index to start search from. If the index is provided, the generation of the address is not deterministic. * @param checksum Optional (default false). Adds 9-tryte address checksum * @param total Optional (default 1)Total number of addresses to generate * @param returnAll If true, it returns all addresses which were deterministically generated (until findTransactions returns null) * @return an array of strings with the specifed number of addresses */ - public GetNewAddressResponse getNewAddress(final String seed, final int index, final boolean checksum, final int total, final boolean returnAll) { + public GetNewAddressResponse getNewAddress(final String seed, int security, final int index, final boolean checksum, final int total, final boolean returnAll) throws InvalidSecurityLevelException { + + if (security < 1 || security > 3) { + throw new InvalidSecurityLevelException(); + } + StopWatch stopWatch = new StopWatch(); List allAddresses = new ArrayList<>(); @@ -56,7 +62,7 @@ public class IotaAPI extends IotaAPICore { // and return the list of all addresses if (total != 0) { for (int i = index; i < index + total; i++) { - allAddresses.add(IotaAPIUtils.newAddress(seed, i, checksum, customCurl)); + allAddresses.add(IotaAPIUtils.newAddress(seed, security, i, checksum, customCurl)); } return GetNewAddressResponse.create(allAddresses, stopWatch.getElapsedTimeMili()); } @@ -64,7 +70,7 @@ public class IotaAPI extends IotaAPICore { // already created if null, return list of addresses for (int i = index; ; i++) { - final String newAddress = IotaAPIUtils.newAddress(seed, i, checksum, customCurl); + final String newAddress = IotaAPIUtils.newAddress(seed, security, i, checksum, customCurl); final FindTransactionResponse response = findTransactionsByAddresses(newAddress); allAddresses.add(newAddress); @@ -83,22 +89,26 @@ public class IotaAPI extends IotaAPICore { } /** - * @param {string} seed - * @param {object} options - * @param {function} callback - * @method getTransfers - * @property {int} start Starting key index - * @property {int} end Ending key index - * @property {bool} inclusionStates returns confirmation status of all transactions - * @returns {object} success + * @param seed + * @param start + * @param end + * @param inclusionStates + * @param security + * @param seed + * @param seed + * @returns Bundle **/ - public GetTransferResponse getTransfers(String seed, Integer start, Integer end, Boolean inclusionStates) throws ArgumentException, InvalidBundleException, InvalidSignatureException, NoNodeInfoException, NoInclusionStatesExcpection { + public GetTransferResponse getTransfers(String seed, int security, Integer start, Integer end, Boolean inclusionStates) throws ArgumentException, InvalidBundleException, InvalidSignatureException, NoNodeInfoException, NoInclusionStatesExcpection, InvalidSecurityLevelException { StopWatch stopWatch = new StopWatch(); // validate & if needed pad seed if ((seed = InputValidator.validateSeed(seed)) == null) { throw new IllegalStateException("Invalid Seed"); } + if (security < 1 || security > 3) { + throw new InvalidSecurityLevelException(); + } + start = start != null ? 0 : start; if (start > end || end > (start + 500)) { @@ -107,7 +117,7 @@ public class IotaAPI extends IotaAPICore { StopWatch sw = new StopWatch(); System.out.println("GetTransfer started"); - GetNewAddressResponse gnr = getNewAddress(seed, start, false, end == null ? end - start : end, true); + GetNewAddressResponse gnr = getNewAddress(seed, security, start, false, end == null ? end - start : end, true); if (gnr != null && gnr.getAddresses() != null) { System.out.println("GetTransfers after getNewAddresses " + sw.getElapsedTimeMili() + " ms"); Bundle[] bundles = bundlesFromAddresses(gnr.getAddresses().toArray(new String[gnr.getAddresses().size()]), inclusionStates); @@ -302,17 +312,15 @@ public class IotaAPI extends IotaAPICore { /** * Prepares transfer by generating bundle, finding and signing inputs * - * @param {string} seed - * @param {object} transfers - * @param {object} options - * @param {function} callback - * @return - * @method prepareTransfers - * @property {array} inputs Inputs used for signing. Needs to have correct keyIndex and address value - * @property {string} address Remainder address + * @param seed + * @param security + * @param transfers + * @param remainder + * @param inputs + * @param security * @returns {array} trytes Returns bundle trytes **/ - public List prepareTransfers(String seed, final List transfers, String remainder, List inputs) throws NotEnoughBalanceException { + public List prepareTransfers(String seed, int security, final List transfers, String remainder, List inputs) throws NotEnoughBalanceException, InvalidSecurityLevelException { // Input validation of transfers object if (!InputValidator.isTransfersCollectionCorrect(transfers)) { @@ -324,6 +332,9 @@ public class IotaAPI extends IotaAPICore { throw new IllegalStateException("Invalid Seed"); } + if (security < 1 || security > 3) { + throw new InvalidSecurityLevelException(); + } // Create a new bundle final Bundle bundle = new Bundle(); @@ -403,13 +414,19 @@ public class IotaAPI extends IotaAPICore { int i = 0; for (String balance : balances) { long thisBalance = Integer.parseInt(balance); - totalBalance += thisBalance; // If input has balance, add it to confirmedInputs if (thisBalance > 0) { + totalBalance += thisBalance; Input inputEl = inputs.get(i++); inputEl.setBalance(thisBalance); confirmedInputs.add(inputEl); + + // if we've already reached the intended input value, break out of loop + if (totalBalance >= totalValue) { + log.info("Total balance already reached "); + break; + } } } @@ -418,7 +435,7 @@ public class IotaAPI extends IotaAPICore { throw new IllegalStateException("Not enough balance"); } - return addRemainder(seed, confirmedInputs, bundle, tag, totalValue, null, signatureFragments); + return addRemainder(seed, security, confirmedInputs, bundle, tag, totalValue, null, signatureFragments); } // Case 2: Get inputs deterministically @@ -427,9 +444,9 @@ public class IotaAPI extends IotaAPICore { // confirm that the inputs exceed the threshold else { - @SuppressWarnings("unchecked") GetBalancesAndFormatResponse newinputs = getInputs(seed, 0, 0, totalValue); + @SuppressWarnings("unchecked") GetBalancesAndFormatResponse newinputs = getInputs(seed, security, 0, 0, totalValue); // If inputs with enough balance - return addRemainder(seed, newinputs.getInput(), bundle, tag, totalValue, null, signatureFragments); + return addRemainder(seed, security, newinputs.getInput(), bundle, tag, totalValue, null, signatureFragments); } } else { @@ -451,15 +468,13 @@ public class IotaAPI extends IotaAPICore { /** * Gets the inputs of a seed * - * @param {string} seed - * @param {object} options - * @param {function} callback - * @method getInputs - * @property {int} start Starting key index - * @property {int} end Ending key index - * @property {int} threshold Min balance required + * @param seed + * @param security security secuirty level of private key / seed + * @param start start Starting key index + * @param end end Ending key index + * @param threshold threshold Min balance required **/ - public GetBalancesAndFormatResponse getInputs(String seed, int start, int end, long threshold) { + public GetBalancesAndFormatResponse getInputs(String seed, int security, int start, int end, long threshold) throws InvalidSecurityLevelException { StopWatch stopWatch = new StopWatch(); // validate the seed if (!InputValidator.isTrytes(seed, 0)) { @@ -471,6 +486,10 @@ public class IotaAPI extends IotaAPICore { throw new IllegalStateException("Invalid Seed"); } + if (security < 1 || security > 3) { + throw new InvalidSecurityLevelException(); + } + // If start value bigger than end, return error // or if difference between end and start is bigger than 500 keys if (start > end || end > (start + 500)) { @@ -487,11 +506,11 @@ public class IotaAPI extends IotaAPICore { for (int i = start; i < end; i++) { - String address = IotaAPIUtils.newAddress(seed, i, false, customCurl); + String address = IotaAPIUtils.newAddress(seed, security, i, false, customCurl); allAddresses.add(address); } - return getBalanceAndFormat(allAddresses, threshold, start, end, stopWatch); + return getBalanceAndFormat(allAddresses, threshold, start, end, stopWatch, security); } // Case 2: iterate till threshold || end // @@ -499,14 +518,18 @@ public class IotaAPI extends IotaAPICore { // Calls getNewAddress and deterministically generates and returns all addresses // We then do getBalance, format the output and return it else { - final GetNewAddressResponse res = getNewAddress(seed, start, false, 0, true); - return getBalanceAndFormat(res.getAddresses(), threshold, start, end, stopWatch); + final GetNewAddressResponse res = getNewAddress(seed, security, start, false, 0, true); + return getBalanceAndFormat(res.getAddresses(), threshold, start, end, stopWatch, security); } } // Calls getBalances and formats the output // returns the final inputsObject then - public GetBalancesAndFormatResponse getBalanceAndFormat(final List addresses, long threshold, int start, int end, StopWatch stopWatch) { + public GetBalancesAndFormatResponse getBalanceAndFormat(final List addresses, long threshold, int start, int end, StopWatch stopWatch, int security) throws InvalidSecurityLevelException { + + if (security < 1 || security > 3) { + throw new InvalidSecurityLevelException(); + } GetBalancesResponse getBalancesResponse = getBalances(100, addresses); List balances = Arrays.asList(getBalancesResponse.getBalances()); @@ -524,7 +547,7 @@ public class IotaAPI extends IotaAPICore { long balance = Long.parseLong(balances.get(++i)); if (balance > 0) { - final Input newEntry = new Input(address, balance, start + i); + final Input newEntry = new Input(address, balance, start + i, security); inputs.add(newEntry); // Increase totalBalance of all aggregated inputs @@ -680,10 +703,15 @@ public class IotaAPI extends IotaAPICore { return getInclusionStates(hashes, latestMilestone); } - public SendTransferResponse sendTransfer(String seed, int depth, int minWeightMagnitude, final List transfers, Input[] inputs, String address) throws NotEnoughBalanceException { + public SendTransferResponse sendTransfer(String seed, int security, int depth, int minWeightMagnitude, final List transfers, Input[] inputs, String address) throws NotEnoughBalanceException, InvalidSecurityLevelException { + + if (security < 1 || security > 3) { + throw new InvalidSecurityLevelException(); + } + StopWatch stopWatch = new StopWatch(); - List trytes = prepareTransfers(seed, transfers, address, inputs == null ? null : Arrays.asList(inputs)); + List trytes = prepareTransfers(seed, security, transfers, address, inputs == null ? null : Arrays.asList(inputs)); List trxs = sendTrytes(trytes.toArray(new String[trytes.size()]), depth, minWeightMagnitude); Boolean[] successful = new Boolean[trxs.size()]; @@ -768,12 +796,13 @@ public class IotaAPI extends IotaAPICore { } public List addRemainder(final String seed, + final int security, final List inputs, final Bundle bundle, final String tag, final long totalValue, final String remainderAddress, - final List signatureFragments) throws NotEnoughBalanceException { + final List signatureFragments) throws NotEnoughBalanceException, InvalidSecurityLevelException { long totalTransferValue = totalValue; for (int i = 0; i < inputs.size(); i++) { @@ -782,7 +811,7 @@ public class IotaAPI extends IotaAPICore { long timestamp = (long) Math.floor(Calendar.getInstance().getTimeInMillis() / 1000); // Add input as bundle entry - bundle.addEntry(2, inputs.get(i).getAddress(), toSubtract, tag, timestamp); + bundle.addEntry(security, inputs.get(i).getAddress(), toSubtract, tag, timestamp); // If there is a remainder value // Add extra output to send remaining funds to @@ -799,7 +828,7 @@ public class IotaAPI extends IotaAPICore { } else if (remainder > 0) { // Generate a new Address by calling getNewAddress - GetNewAddressResponse res = getNewAddress(seed, 0, false, 0, false); + GetNewAddressResponse res = getNewAddress(seed, security, 0, false, 0, false); // Remainder bundle entry bundle.addEntry(1, res.getAddresses().get(0), remainder, tag, timestamp); diff --git a/src/main/java/jota/error/InvalidSecurityLevelException.java b/src/main/java/jota/error/InvalidSecurityLevelException.java new file mode 100644 index 0000000..263ffbd --- /dev/null +++ b/src/main/java/jota/error/InvalidSecurityLevelException.java @@ -0,0 +1,11 @@ +package jota.error; + +/** + * Created by pinpong on 02.02.17. + */ +public class InvalidSecurityLevelException extends BaseException { + + public InvalidSecurityLevelException() { + super("Invalid security level"); + } +} diff --git a/src/main/java/jota/model/Input.java b/src/main/java/jota/model/Input.java index 16ce445..ead850c 100644 --- a/src/main/java/jota/model/Input.java +++ b/src/main/java/jota/model/Input.java @@ -10,11 +10,15 @@ public class Input { private String address; private long balance; private int keyIndex; + private int security; - public Input(String address, long balance, int keyIndex) { + + public Input(String address, long balance, int keyIndex, int security) { this.address = address; this.balance = balance; this.keyIndex = keyIndex; + this.security = security; + } @Override @@ -45,4 +49,12 @@ public class Input { public void setKeyIndex(int keyIndex) { this.keyIndex = keyIndex; } + + public int getSecurity() { + return security; + } + + public void setSecurity(int security) { + this.security = security; + } } \ No newline at end of file diff --git a/src/main/java/jota/utils/IotaAPIUtils.java b/src/main/java/jota/utils/IotaAPIUtils.java index 3d59c4c..adbf974 100644 --- a/src/main/java/jota/utils/IotaAPIUtils.java +++ b/src/main/java/jota/utils/IotaAPIUtils.java @@ -4,8 +4,6 @@ import jota.model.Bundle; import jota.model.Input; import jota.model.Transaction; import jota.pow.ICurl; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import java.util.ArrayList; import java.util.Arrays; @@ -19,19 +17,18 @@ import java.util.List; */ public class IotaAPIUtils { - private static final Logger log = LoggerFactory.getLogger(IotaAPIUtils.class); - /** * Generates a new address * * @param seed * @param index + * @param security * @param checksum * @return an String with address */ - public static String newAddress(String seed, int index, boolean checksum, ICurl curl) { + public static String newAddress(String seed, int security, int index, boolean checksum, ICurl curl) { Signing signing = new Signing(curl); - final int[] key = signing.key(Converter.trits(seed), index, 2); + final int[] key = signing.key(Converter.trits(seed), index, security); final int[] digests = signing.digests(key); final int[] addressTrits = signing.address(digests); @@ -47,6 +44,7 @@ public class IotaAPIUtils { final List inputs, final Bundle bundle, final List signatureFragments, ICurl curl) { + bundle.finalize(curl); bundle.addTrytes(signatureFragments); @@ -61,17 +59,18 @@ public class IotaAPIUtils { // Get the corresponding keyIndex of the address int keyIndex = 0; + int keySecurity = 0; for (Input input : inputs) { if (input.getAddress().equals(thisAddress)) { keyIndex = input.getKeyIndex(); - break; + keySecurity = input.getSecurity(); } } String bundleHash = bundle.getTransactions().get(i).getBundle(); // Get corresponding private key of address - int[] key = new Signing(curl).key(Converter.trits(seed), keyIndex, 2); + int[] key = new Signing(curl).key(Converter.trits(seed), keyIndex, keySecurity); // First 6561 trits for the firstFragment int[] firstFragment = Arrays.copyOfRange(key, 0, 6561); @@ -88,22 +87,27 @@ public class IotaAPIUtils { // Convert signature to trytes and assign the new signatureFragment bundle.getTransactions().get(i).setSignatureFragments(Converter.trytes(firstSignedFragment)); - // Because the signature is > 2187 trytes, we need to - // find the second transaction to add the remainder of the signature - for (int j = 0; j < bundle.getTransactions().size(); j++) { - // Same address as well as value = 0 (as we already spent the input) - if (bundle.getTransactions().get(j).getAddress().equals(thisAddress) && Long.parseLong(bundle.getTransactions().get(j).getValue()) == 0) { - // Use the second 6562 trits - int[] secondFragment = Arrays.copyOfRange(key, 6561, 6561 * 2); + // if user chooses higher than 27-tryte security + // for each security level, add an additional signature + for (int j = 1; j < keySecurity; j++) { - // The second 27 to 54 trytes of the bundle hash - int[] secondBundleFragment = Arrays.copyOfRange(normalizedBundleHash, 27, 27 * 2); + // Because the signature is > 2187 trytes, we need to + // find the second transaction to add the remainder of the signature + for (int k = 0; k < bundle.getTransactions().size(); k++) { + // Same address as well as value = 0 (as we already spent the input) + if (bundle.getTransactions().get(k).getAddress().equals(thisAddress) && Long.parseLong(bundle.getTransactions().get(k).getValue()) == 0) { + // Use the second 6562 trits + int[] secondFragment = Arrays.copyOfRange(key, 6561, 6561 * 2); - // Calculate the new signature - int[] secondSignedFragment = new Signing(curl).signatureFragment(secondBundleFragment, secondFragment); + // The second 27 to 54 trytes of the bundle hash + int[] secondBundleFragment = Arrays.copyOfRange(normalizedBundleHash, 27, 27 * 2); - // Convert signature to trytes and assign it again to this bundle entry - bundle.getTransactions().get(j).setSignatureFragments(Converter.trytes(secondSignedFragment)); + // Calculate the new signature + int[] secondSignedFragment = new Signing(curl).signatureFragment(secondBundleFragment, secondFragment); + + // Convert signature to trytes and assign it again to this bundle entry + bundle.getTransactions().get(k).setSignatureFragments(Converter.trytes(secondSignedFragment)); + } } } } diff --git a/src/test/java/jota/IotaAPITest.java b/src/test/java/jota/IotaAPITest.java index 7fc438c..7928694 100644 --- a/src/test/java/jota/IotaAPITest.java +++ b/src/test/java/jota/IotaAPITest.java @@ -73,8 +73,8 @@ public class IotaAPITest { @Test - public void shouldGetInputs() { - GetBalancesAndFormatResponse res = iotaClient.getInputs(TEST_SEED1, 0, 0, 0); + public void shouldGetInputs() throws InvalidSecurityLevelException { + GetBalancesAndFormatResponse res = iotaClient.getInputs(TEST_SEED1, 2, 0, 0, 0); System.out.println(res); assertThat(res, IsNull.notNullValue()); assertThat(res.getTotalBalance(), IsNull.notNullValue()); @@ -84,20 +84,20 @@ public class IotaAPITest { @Test - public void shouldCreateANewAddress() { - final GetNewAddressResponse res = iotaClient.getNewAddress(TEST_SEED1, 0, false, 100, false); + public void shouldCreateANewAddress() throws InvalidSecurityLevelException { + final GetNewAddressResponse res = iotaClient.getNewAddress(TEST_SEED1, 2, 0, false, 100, false); assertThat(res.getAddresses().get(0), Is.is(TEST_ADDRESS_WITHOUT_CHECKSUM)); System.out.println(new Gson().toJson(res)); } @Test - public void shouldPrepareTransfer() { + public void shouldPrepareTransfer() throws InvalidSecurityLevelException { List transfers = new ArrayList<>(); transfers.add(new jota.model.Transfer(TEST_ADDRESS_WITH_CHECKSUM, 0, TEST_MESSAGE, TEST_TAG)); transfers.add(new jota.model.Transfer(TEST_ADDRESS_WITH_CHECKSUM, 1, TEST_MESSAGE, TEST_TAG)); List trytes = null; try { - trytes = iotaClient.prepareTransfers(TEST_SEED1, transfers, null, null); + trytes = iotaClient.prepareTransfers(TEST_SEED1, 2, transfers, null, null); } catch (NotEnoughBalanceException e) { e.printStackTrace(); } @@ -124,8 +124,8 @@ public class IotaAPITest { } @Test - public void shouldGetTransfers() throws InvalidBundleException, ArgumentException, InvalidSignatureException, NoInclusionStatesExcpection, NoNodeInfoException { - GetTransferResponse gtr = iotaClient.getTransfers(TEST_SEED1, 0, 0, false); + public void shouldGetTransfers() throws InvalidBundleException, ArgumentException, InvalidSignatureException, NoInclusionStatesExcpection, NoNodeInfoException, InvalidSecurityLevelException { + GetTransferResponse gtr = iotaClient.getTransfers(TEST_SEED1, 2, 0, 0, false); assertThat(gtr.getTransfers(), IsNull.notNullValue()); for (Bundle test : gtr.getTransfers()) { @@ -142,19 +142,19 @@ public class IotaAPITest { } @Test(expected = IllegalStateException.class) - public void shouldNotSendTransfer() throws ArgumentException, InvalidSignatureException, InvalidBundleException, NotEnoughBalanceException { + public void shouldNotSendTransfer() throws ArgumentException, InvalidSignatureException, InvalidBundleException, NotEnoughBalanceException, InvalidSecurityLevelException { List transfers = new ArrayList<>(); transfers.add(new jota.model.Transfer(TEST_ADDRESS_WITHOUT_CHECKSUM, 10000990, "JUSTANOTHERTEST", TEST_TAG)); - SendTransferResponse str = iotaClient.sendTransfer(TEST_SEED2, 9, 18, transfers, null, null); + SendTransferResponse str = iotaClient.sendTransfer(TEST_SEED2, 2, 9, 18, transfers, null, null); assertThat(str.getSuccessfully(), IsNull.notNullValue()); } @Ignore @Test - public void shouldSendTransfer() throws ArgumentException, InvalidSignatureException, InvalidBundleException, NotEnoughBalanceException { + public void shouldSendTransfer() throws ArgumentException, InvalidSignatureException, InvalidBundleException, NotEnoughBalanceException, InvalidSecurityLevelException { List transfers = new ArrayList<>(); transfers.add(new jota.model.Transfer(TEST_ADDRESS_WITHOUT_CHECKSUM, 0, "JUSTANOTHERTEST", TEST_TAG)); - SendTransferResponse str = iotaClient.sendTransfer(TEST_SEED2, 9, 18, transfers, null, null); + SendTransferResponse str = iotaClient.sendTransfer(TEST_SEED2, 2, 9, 18, transfers, null, null); assertThat(str.getSuccessfully(), IsNull.notNullValue()); } } \ No newline at end of file From f143cfbbf6c68384e45a8707a21e759705bcc8a3 Mon Sep 17 00:00:00 2001 From: pinpong Date: Fri, 3 Feb 2017 16:50:17 +0100 Subject: [PATCH 07/45] extended tests --- src/main/java/jota/IotaAPI.java | 9 ++++--- src/test/java/jota/IotaAPITest.java | 27 +++++++++++-------- src/test/java/jota/IotaCoreApiTest.java | 1 - .../java/jota/SeedRandomGeneratorTest.java | 1 - 4 files changed, 22 insertions(+), 16 deletions(-) diff --git a/src/main/java/jota/IotaAPI.java b/src/main/java/jota/IotaAPI.java index 514269c..1612e09 100644 --- a/src/main/java/jota/IotaAPI.java +++ b/src/main/java/jota/IotaAPI.java @@ -29,7 +29,6 @@ public class IotaAPI extends IotaAPICore { private static final Logger log = LoggerFactory.getLogger(IotaAPI.class); private ICurl customCurl; - private StopWatch stopWatch; protected IotaAPI(Builder builder) { super(builder); @@ -66,7 +65,7 @@ public class IotaAPI extends IotaAPICore { } return GetNewAddressResponse.create(allAddresses, stopWatch.getElapsedTimeMili()); } - // No total provided: Continue calling findTransactions to see if address was + // No total provided: Continue calling findTransactions to see if address was // already created if null, return list of addresses for (int i = index; ; i++) { @@ -347,6 +346,10 @@ public class IotaAPI extends IotaAPICore { // and prepare the signatureFragments, message and tag for (final Transfer transfer : transfers) { + // If address with checksum then remove checksum + if (Checksum.isAddressWithChecksum(transfer.getAddress())) + transfer.setAddress(Checksum.removeChecksum(transfer.getAddress())); + int signatureMessageLength = 1; // If message longer than 2187 trytes, increase signatureMessageLength (add 2nd transaction) @@ -426,7 +429,7 @@ public class IotaAPI extends IotaAPICore { if (totalBalance >= totalValue) { log.info("Total balance already reached "); break; - } + } } } diff --git a/src/test/java/jota/IotaAPITest.java b/src/test/java/jota/IotaAPITest.java index 7928694..8994893 100644 --- a/src/test/java/jota/IotaAPITest.java +++ b/src/test/java/jota/IotaAPITest.java @@ -28,8 +28,9 @@ public class IotaAPITest { private static final String TEST_SEED1 = "AAA999999999999999999999999999999999999999999999999999999999999999999999999999999"; private static final String TEST_SEED2 = "IHDEENZYITYVYSPKAURUZAQKGVJEREFDJMYTANNXXGPZ9GJWTEOJJ9IPMXOGZNQLSNMFDSQOTZAEETUEA"; - private static final String TEST_ADDRESS_WITHOUT_CHECKSUM = "PNGMCSNRCTRHCHPXYTPKEJYPCOWKOMRXZFHH9N9VDIKMNVAZCMIYRHVJIAZARZTUETJVFDMBEBIQE9QTH"; - private static final String TEST_ADDRESS_WITH_CHECKSUM = "PNGMCSNRCTRHCHPXYTPKEJYPCOWKOMRXZFHH9N9VDIKMNVAZCMIYRHVJIAZARZTUETJVFDMBEBIQE9QTHBFWDAOEFA"; + private static final String TEST_ADDRESS_WITHOUT_CHECKSUM_SECURITY_LEVEL_1 = "NINSZRAKWBERQBBN9KGIRNXQDNENLBUBAYRZPUXFJSWRWVADEOGGOWMLQWSHA9NEOLASWRGOQJXAVRMFY"; + private static final String TEST_ADDRESS_WITHOUT_CHECKSUM_SECURITY_LEVEL_2 = "PNGMCSNRCTRHCHPXYTPKEJYPCOWKOMRXZFHH9N9VDIKMNVAZCMIYRHVJIAZARZTUETJVFDMBEBIQE9QTH"; + private static final String TEST_ADDRESS_WITHOUT_CHECKSUM_SECURITY_LEVEL_3 = "NOHBJKARAS9DZBFTRVIFY99STSQPSGTHMGMDYXLYIYKFYZISJUOGYWMZXDB9XEXFSSP9GYAIEHUQHLQ9C"; private static final String TEST_HASH = "CKZ9TYPLUWH9FUSYJMPIZBVHWFZXTZMVOJLC9KOICSTBBQWXYTOTMCVPSPMYNDONTXHRULRFAWD999999"; private static final String TEST_TRYTES = "BYSWEAUTWXHXZ9YBZISEK9LUHWGMHXCGEVNZHRLUWQFCUSDXZHOFHWHL9MQPVJXXZLIXPXPXF9KYEREFSKCPKYIIKPZVLHUTDFQKKVVBBN9ATTLPCNPJDWDEVIYYLGPZGCWXOBDXMLJC9VO9QXTTBLAXTTBFUAROYEGQIVB9MJWJKXJMCUPTWAUGFZBTZCSJVRBGMYXTVBDDS9MYUJCPZ9YDWWQNI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LDKMJCI9N9XQOLWEPAYWSH9999999999999999999999999KDDTGZLIPBNZKMLTOLOXQVNGLASESDQVPTXALEKRMIOHQLUHD9ELQDBQETS9QFGTYOYWLNTSKKMVJAUXSIROUICDOXKSYZTDPEDKOQENTJOWJONDEWROCEJIEWFWLUAACVSJFTMCHHXJBJRKAAPUDXXVXFWP9X9999IROUICDOXKSYZTDPEDKOQENTJOWJONDEWROCEJIEWFWLUAACVSJFTMCHHXJBJRKAAPUDXXVXFWP9X9999"; private static final String TEST_MILESTONE = "SMYMAKKPSUKCKDRUEYCGZJTYCZ9HHDMDUWBAPXARGURPQRHTAJDASRWMIDTPTBNDKDEFBUTBGGAFX9999"; @@ -82,19 +83,23 @@ public class IotaAPITest { } - @Test - public void shouldCreateANewAddress() throws InvalidSecurityLevelException { - final GetNewAddressResponse res = iotaClient.getNewAddress(TEST_SEED1, 2, 0, false, 100, false); - assertThat(res.getAddresses().get(0), Is.is(TEST_ADDRESS_WITHOUT_CHECKSUM)); - System.out.println(new Gson().toJson(res)); + public void shouldCreateANewAddressWithoutChecksum() throws InvalidSecurityLevelException { + final GetNewAddressResponse res1 = iotaClient.getNewAddress(TEST_SEED1, 1, 0, false, 5, false); + assertThat(res1.getAddresses().get(0), Is.is(TEST_ADDRESS_WITHOUT_CHECKSUM_SECURITY_LEVEL_1)); + + final GetNewAddressResponse res2 = iotaClient.getNewAddress(TEST_SEED1, 2, 0, false, 5, false); + assertThat(res2.getAddresses().get(0), Is.is(TEST_ADDRESS_WITHOUT_CHECKSUM_SECURITY_LEVEL_2)); + + final GetNewAddressResponse res3 = iotaClient.getNewAddress(TEST_SEED1, 3, 0, false, 5, false); + assertThat(res3.getAddresses().get(0), Is.is(TEST_ADDRESS_WITHOUT_CHECKSUM_SECURITY_LEVEL_3)); } @Test public void shouldPrepareTransfer() throws InvalidSecurityLevelException { List transfers = new ArrayList<>(); - transfers.add(new jota.model.Transfer(TEST_ADDRESS_WITH_CHECKSUM, 0, TEST_MESSAGE, TEST_TAG)); - transfers.add(new jota.model.Transfer(TEST_ADDRESS_WITH_CHECKSUM, 1, TEST_MESSAGE, TEST_TAG)); + transfers.add(new jota.model.Transfer(TEST_ADDRESS_WITHOUT_CHECKSUM_SECURITY_LEVEL_2, 0, TEST_MESSAGE, TEST_TAG)); + transfers.add(new jota.model.Transfer(TEST_ADDRESS_WITHOUT_CHECKSUM_SECURITY_LEVEL_2, 1, TEST_MESSAGE, TEST_TAG)); List trytes = null; try { trytes = iotaClient.prepareTransfers(TEST_SEED1, 2, transfers, null, null); @@ -144,7 +149,7 @@ public class IotaAPITest { @Test(expected = IllegalStateException.class) public void shouldNotSendTransfer() throws ArgumentException, InvalidSignatureException, InvalidBundleException, NotEnoughBalanceException, InvalidSecurityLevelException { List transfers = new ArrayList<>(); - transfers.add(new jota.model.Transfer(TEST_ADDRESS_WITHOUT_CHECKSUM, 10000990, "JUSTANOTHERTEST", TEST_TAG)); + transfers.add(new jota.model.Transfer(TEST_ADDRESS_WITHOUT_CHECKSUM_SECURITY_LEVEL_2, 10000990, "JUSTANOTHERTEST", TEST_TAG)); SendTransferResponse str = iotaClient.sendTransfer(TEST_SEED2, 2, 9, 18, transfers, null, null); assertThat(str.getSuccessfully(), IsNull.notNullValue()); } @@ -153,7 +158,7 @@ public class IotaAPITest { @Test public void shouldSendTransfer() throws ArgumentException, InvalidSignatureException, InvalidBundleException, NotEnoughBalanceException, InvalidSecurityLevelException { List transfers = new ArrayList<>(); - transfers.add(new jota.model.Transfer(TEST_ADDRESS_WITHOUT_CHECKSUM, 0, "JUSTANOTHERTEST", TEST_TAG)); + transfers.add(new jota.model.Transfer(TEST_ADDRESS_WITHOUT_CHECKSUM_SECURITY_LEVEL_2, 0, "JUSTANOTHERTEST", TEST_TAG)); SendTransferResponse str = iotaClient.sendTransfer(TEST_SEED2, 2, 9, 18, transfers, null, null); assertThat(str.getSuccessfully(), IsNull.notNullValue()); } diff --git a/src/test/java/jota/IotaCoreApiTest.java b/src/test/java/jota/IotaCoreApiTest.java index 8913816..a1cf103 100644 --- a/src/test/java/jota/IotaCoreApiTest.java +++ b/src/test/java/jota/IotaCoreApiTest.java @@ -133,6 +133,5 @@ public class IotaCoreApiTest { assertThat(res.getBalances(), IsNull.notNullValue()); assertThat(res.getMilestone(), IsNull.notNullValue()); assertThat(res.getMilestoneIndex(), IsNull.notNullValue()); - } } diff --git a/src/test/java/jota/SeedRandomGeneratorTest.java b/src/test/java/jota/SeedRandomGeneratorTest.java index b2ab6d2..01c203f 100644 --- a/src/test/java/jota/SeedRandomGeneratorTest.java +++ b/src/test/java/jota/SeedRandomGeneratorTest.java @@ -14,7 +14,6 @@ public class SeedRandomGeneratorTest { @Test public void shouldGenerateNewSeed() { - String generatedSeed = SeedRandomGenerator.generateNewSeed(); assertEquals(InputValidator.isAddress(generatedSeed), true); assertEquals(generatedSeed.length(), Constants.SEED_LENGTH_MAX); From 8f305c1730fec8c660be50a2f9f12a1d1cdd025b Mon Sep 17 00:00:00 2001 From: pinpong Date: Sat, 4 Feb 2017 17:01:17 +0100 Subject: [PATCH 08/45] fixed compiler warning --- pom.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/pom.xml b/pom.xml index 31625ee..6d1e3b2 100644 --- a/pom.xml +++ b/pom.xml @@ -103,6 +103,7 @@ org.apache.maven.plugins maven-surefire-plugin + 2.12.4 true From 62bf75ed534b54ce403a724cf1da9454b7d91647 Mon Sep 17 00:00:00 2001 From: AZ Date: Sat, 4 Feb 2017 18:55:07 +0100 Subject: [PATCH 09/45] small extension for tests & inputvalidation, added multisignatures (WIP) --- src/main/java/jota/IotaAPICore.java | 8 +++++++- src/test/java/jota/IotaAPITest.java | 21 +++++++++++++++++---- 2 files changed, 24 insertions(+), 5 deletions(-) diff --git a/src/main/java/jota/IotaAPICore.java b/src/main/java/jota/IotaAPICore.java index 7e032ac..961898e 100644 --- a/src/main/java/jota/IotaAPICore.java +++ b/src/main/java/jota/IotaAPICore.java @@ -2,6 +2,8 @@ package jota; import jota.dto.request.*; import jota.dto.response.*; +import jota.error.InvalidTrytesException; +import jota.utils.InputValidator; import okhttp3.OkHttpClient; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -165,7 +167,11 @@ public class IotaAPICore { return wrapCheckedException(res).body(); } - public GetAttachToTangleResponse attachToTangle(String trunkTransaction, String branchTransaction, Integer minWeightMagnitude, String... trytes) { + public GetAttachToTangleResponse attachToTangle(String trunkTransaction, String branchTransaction, Integer minWeightMagnitude, String... trytes) throws InvalidTrytesException { + if(InputValidator.isArrayOfTrytes(trytes)){ + throw new InvalidTrytesException(); + } + final Call res = service.attachToTangle(IotaAttachToTangleRequest.createAttachToTangleRequest(trunkTransaction, branchTransaction, minWeightMagnitude, trytes)); return wrapCheckedException(res).body(); } diff --git a/src/test/java/jota/IotaAPITest.java b/src/test/java/jota/IotaAPITest.java index 8994893..3a4bee5 100644 --- a/src/test/java/jota/IotaAPITest.java +++ b/src/test/java/jota/IotaAPITest.java @@ -32,7 +32,8 @@ public class IotaAPITest { private static final String TEST_ADDRESS_WITHOUT_CHECKSUM_SECURITY_LEVEL_2 = "PNGMCSNRCTRHCHPXYTPKEJYPCOWKOMRXZFHH9N9VDIKMNVAZCMIYRHVJIAZARZTUETJVFDMBEBIQE9QTH"; private static final String TEST_ADDRESS_WITHOUT_CHECKSUM_SECURITY_LEVEL_3 = "NOHBJKARAS9DZBFTRVIFY99STSQPSGTHMGMDYXLYIYKFYZISJUOGYWMZXDB9XEXFSSP9GYAIEHUQHLQ9C"; private static final String TEST_HASH = "CKZ9TYPLUWH9FUSYJMPIZBVHWFZXTZMVOJLC9KOICSTBBQWXYTOTMCVPSPMYNDONTXHRULRFAWD999999"; - private static final String TEST_TRYTES = "BYSWEAUTWXHXZ9YBZISEK9LUHWGMHXCGEVNZHRLUWQFCUSDXZHOFHWHL9MQPVJXXZLIXPXPXF9KYEREFSKCPKYIIKPZVLHUTDFQKKVVBBN9ATTLPCNPJDWDEVIYYLGPZGCWXOBDXMLJC9VO9QXTT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Q9U9P9UUP9YMZHWWWCIASCFLCMSKTELZWUGCDE9YOKVOVKTAYPHDF9ZCCQAYPJIJNGSHUIHHCOSSOOBUDOKE9CJZGYSSGNCQJVBEFTZFJ9SQUHOASKRRGBSHWKBCBWBTJHOGQ9WOMQFHWJVEG9NYX9KWBTCAIXNXHEBDIOFO9ALYMFGRICLCKKLG9FOBOX9PDWNQRGHBKHGKKRLWTBEQMCWQRLHAVYYZDIIPKVQTHYTWQMTOACXZOQCDTJTBAAUWXSGJF9PNQIJ9AJRUMUVCPWYVYVARKR9RKGOUHHNKNVGGPDDLGKPQNOYHNKAVVKCXWXOQPZNSLATUJT9AUWRMPPSWHSTTYDFAQDXOCYTZHOYYGAIM9CELMZ9AZPWB9MJXGHOKDNNSZVUDAGXTJJSSZCPZVPZBYNNTUQABSXQWZCHDQSLGK9UOHCFKBIBNETK999999999999999999999999999999999999999999999999999999999999999999999999999999999NOXDXXKUDWLOFJLIPQIBRBMGDYCPGDNLQOLQS99EQYKBIU9VHCJVIPFUYCQDNY9APGEVYLCENJIOBLWNB999999999XKBRHUD99C99999999NKZKEKWLDKMJCI9N9XQOLWEPAYWSH9999999999999999999999999KDDTGZLIPBNZKMLTOLOXQVNGLASESDQVPTXALEKRMIOHQLUHD9ELQDBQETS9QFGTYOYWLNTSKKMVJAUXSIROUICDOXKSYZTDPEDKOQENTJOWJONDEWROCEJIEWFWLUAACVSJFTMCHHXJBJRKAAPUDXXVXFWP9X9999IROUICDOXKSYZTDPEDKOQENTJOWJONDEWROCEJIEWFWLUAACVSJFTMCHHXJBJRKAAPUDXXVXFWP9X9999"; + private static final String TEST_TRYTES = "JUSTANOTHERTEST999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999PNGMCSNRCTRHCHPXYTPKEJYPCOWKOMRXZFHH9N9VDIKMNVAZCMIYRHVJIAZARZTUETJVFDMBEBIQE9QTH999999999999999999999999999JOTASPAM9999999999999999999VADPPWD99999999999999999999AQKWPYWBUEPGRZAVQUKYAVRPPNEIZZFHHLBESBBINMZCDU9GYMQAUKXSDLAHCB9XCFEPACLJGLHFUSTWJ999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999"; private static final String TEST_MILESTONE = "SMYMAKKPSUKCKDRUEYCGZJTYCZ9HHDMDUWBAPXARGURPQRHTAJDASRWMIDTPTBNDKDEFBUTBGGAFX9999"; private static final Integer TEST_MILESTONE_INDEX = 8059; private static final String TEST_MESSAGE = "JOTA"; @@ -122,6 +123,12 @@ public class IotaAPITest { assertThat(ftr, IsNull.notNullValue()); } + @Test(expected = ArgumentException.class) + public void shouldNotGetBundle() throws InvalidBundleException, ArgumentException, InvalidSignatureException { + GetBundleResponse gbr = iotaClient.getBundle(TEST_HASH); + assertThat(gbr, IsNull.notNullValue()); + } + @Test public void shouldGetBundle() throws InvalidBundleException, ArgumentException, InvalidSignatureException { GetBundleResponse gbr = iotaClient.getBundle(TEST_HASH); @@ -140,14 +147,20 @@ public class IotaAPITest { } } + @Ignore + @Test(expected = InvalidTrytesException.class) + public void shouldNotSendTrytes() throws InvalidTrytesException { + iotaClient.sendTrytes(new String[]{TEST_INVALID_TRYTES}, 9, 18); + } + @Ignore @Test - public void shouldSendTrytes() { + public void shouldSendTrytes() throws InvalidTrytesException { iotaClient.sendTrytes(new String[]{TEST_TRYTES}, 9, 18); } @Test(expected = IllegalStateException.class) - public void shouldNotSendTransfer() throws ArgumentException, InvalidSignatureException, InvalidBundleException, NotEnoughBalanceException, InvalidSecurityLevelException { + public void shouldNotSendTransfer() throws ArgumentException, InvalidSignatureException, InvalidBundleException, NotEnoughBalanceException, InvalidSecurityLevelException, InvalidTrytesException { List transfers = new ArrayList<>(); transfers.add(new jota.model.Transfer(TEST_ADDRESS_WITHOUT_CHECKSUM_SECURITY_LEVEL_2, 10000990, "JUSTANOTHERTEST", TEST_TAG)); SendTransferResponse str = iotaClient.sendTransfer(TEST_SEED2, 2, 9, 18, transfers, null, null); @@ -156,7 +169,7 @@ public class IotaAPITest { @Ignore @Test - public void shouldSendTransfer() throws ArgumentException, InvalidSignatureException, InvalidBundleException, NotEnoughBalanceException, InvalidSecurityLevelException { + public void shouldSendTransfer() throws ArgumentException, InvalidSignatureException, InvalidBundleException, NotEnoughBalanceException, InvalidSecurityLevelException, InvalidTrytesException { List transfers = new ArrayList<>(); transfers.add(new jota.model.Transfer(TEST_ADDRESS_WITHOUT_CHECKSUM_SECURITY_LEVEL_2, 0, "JUSTANOTHERTEST", TEST_TAG)); SendTransferResponse str = iotaClient.sendTransfer(TEST_SEED2, 2, 9, 18, transfers, null, null); From 4b4c4af7ae923f3e8fb53eba3d068385f9b13ced Mon Sep 17 00:00:00 2001 From: AZ Date: Sat, 4 Feb 2017 18:56:10 +0100 Subject: [PATCH 10/45] multisigs [wip] --- src/main/java/jota/IotaAPI.java | 175 ++++++++++++++- src/main/java/jota/utils/InputValidator.java | 14 ++ src/main/java/jota/utils/Multisig.java | 221 +++++++++++++++++++ 3 files changed, 407 insertions(+), 3 deletions(-) create mode 100644 src/main/java/jota/utils/Multisig.java diff --git a/src/main/java/jota/IotaAPI.java b/src/main/java/jota/IotaAPI.java index 1612e09..db6672d 100644 --- a/src/main/java/jota/IotaAPI.java +++ b/src/main/java/jota/IotaAPI.java @@ -225,7 +225,7 @@ public class IotaAPI extends IotaAPICore { * @param {int} minWeightMagnitude * @return */ - public List sendTrytes(final String[] trytes, final int depth, final int minWeightMagnitude) { + public List sendTrytes(final String[] trytes, final int depth, final int minWeightMagnitude) throws InvalidTrytesException { final GetTransactionsToApproveResponse txs = getTransactionsToApprove(depth); // attach to tangle - do pow @@ -662,7 +662,7 @@ public class IotaAPI extends IotaAPICore { * @method replayBundle * @returns {object} analyzed Transaction objects **/ - public ReplayBundleResponse replayBundle(String transaction, int depth, int minWeightMagnitude) throws InvalidBundleException, ArgumentException, InvalidSignatureException { + public ReplayBundleResponse replayBundle(String transaction, int depth, int minWeightMagnitude) throws InvalidBundleException, ArgumentException, InvalidSignatureException, InvalidTrytesException { StopWatch stopWatch = new StopWatch(); List bundleTrytes = new ArrayList<>(); @@ -706,7 +706,7 @@ public class IotaAPI extends IotaAPICore { return getInclusionStates(hashes, latestMilestone); } - public SendTransferResponse sendTransfer(String seed, int security, int depth, int minWeightMagnitude, final List transfers, Input[] inputs, String address) throws NotEnoughBalanceException, InvalidSecurityLevelException { + public SendTransferResponse sendTransfer(String seed, int security, int depth, int minWeightMagnitude, final List transfers, Input[] inputs, String address) throws NotEnoughBalanceException, InvalidSecurityLevelException, InvalidTrytesException { if (security < 1 || security > 3) { throw new InvalidSecurityLevelException(); @@ -781,6 +781,175 @@ public class IotaAPI extends IotaAPICore { } } + + /** + * Prepares transfer by generating the bundle with the corresponding cosigner transactions + * Does not contain signatures + * + * @param {object} transfers + * @param {function} callback + * @param securitySum sum of security levels used by all co-signers + * @param inputAddress array of input addresses as well as the securitySum + * @param remainderAddress Has to be generated by the cosigners before initiating the transfer, can be null if fully spent + * @method initiateTransfer + * @returns {array} Array of transaction objects + **/ + private GetTransferResponse initiateTransfer(int securitySum, final List inputAddress, String remainderAddress, final List transfers) { + StopWatch sw = new StopWatch(); + + + // If message or tag is not supplied, provide it + // Also remove the checksum of the address if it's there + + for (Transfer transfer : transfers) { + + transfer.setMessage(transfer.getMessage().isEmpty() ? StringUtils.rightPad(transfer.getMessage(), 2187, '9') : transfer.getMessage()); + transfer.setTag(transfer.getTag().isEmpty() ? StringUtils.rightPad(transfer.getTag(), 27, '9') : transfer.getTag()); + + if (Checksum.isValidChecksum(transfer.getAddress())) { + transfer.setAddress(Checksum.removeChecksum(transfer.getAddress())); + } + } + + // Input validation of transfers object + if (!InputValidator.isTransfersCollectionCorrect(transfers)) { + throw new IllegalStateException("Invalid Transfer"); + } + + // validate input address + + for (String address : inputAddress) { + if (!InputValidator.isAddress(address)) + throw new IllegalStateException("Invalid Address"); + } + + // validate remainder address + if (remainderAddress != null && !InputValidator.isAddress(remainderAddress)) { + throw new IllegalStateException("Invalid Address"); + } + + // Create a new bundle + final Bundle bundle = new Bundle(); + + int totalValue = 0; + final List signatureFragments = new ArrayList<>(); + String tag = ""; + // + + // Iterate over all transfers, get totalValue + // and prepare the signatureFragments, message and tag + for (final Transfer transfer : transfers) { + + int signatureMessageLength = 1; + + // If message longer than 2187 trytes, increase signatureMessageLength (add 2nd transaction) + if (transfer.getMessage().length() > 2187) { + + // Get total length, message / maxLength (2187 trytes) + signatureMessageLength += Math.floor(transfer.getMessage().length() / 2187); + + String msgCopy = transfer.getMessage(); + + // While there is still a message, copy it + while (!msgCopy.isEmpty()) { + + String fragment = StringUtils.substring(msgCopy, 0, 2187); + msgCopy = StringUtils.substring(msgCopy, 2187, msgCopy.length()); + + // Pad remainder of fragment + + fragment = StringUtils.rightPad(fragment, 2187, '9'); + + signatureFragments.add(fragment); + } + + } else { + + + // Else, get single fragment with 2187 of 9's trytes + String fragment = StringUtils.substring(transfer.getMessage(), 0, 2187); + + fragment = StringUtils.rightPad(fragment, 2187, '9'); + + signatureFragments.add(fragment); + + } + + // get current timestamp in seconds + long timestamp = (long) Math.floor(Calendar.getInstance().getTimeInMillis() / 1000); + + // If no tag defined, get 27 tryte tag. + tag = transfer.getTag().isEmpty() ? StringUtils.rightPad(transfer.getTag(), 27, '9') : transfer.getTag(); + + // Pad for required 27 tryte length + tag = StringUtils.rightPad(tag, 27, '9'); + + // Add first entry to the bundle + bundle.addEntry(signatureMessageLength, transfer.getAddress(), transfer.getValue(), tag, timestamp); + // Sum up total value + totalValue += transfer.getValue(); + } + + // Get inputs if we are sending tokens + if (totalValue != 0) { + + GetBalancesResponse balancesResponse = getBalances(100, inputAddress); + String[] balances = balancesResponse.getBalances(); + + long totalBalance = 0; + + for (String balance : balances) { + long thisBalance = Integer.parseInt(balance); + + totalBalance += thisBalance; + } + + // get current timestamp in seconds + long timestamp = (long) Math.floor(Calendar.getInstance().getTimeInMillis() / 1000); + + if (totalBalance > 0) { + + long toSubtract = 0 - totalBalance; + + // Add input as bundle entry + // Only a single entry, signatures will be added later + // TODO: fill in the right address + bundle.addEntry(securitySum, "", toSubtract, tag, timestamp); + } + + // Return not enough balance error + if (totalValue > totalBalance) { + throw new IllegalStateException("Not enough balance"); + } + + // If there is a remainder value + // Add extra output to send remaining funds to + if (totalBalance > totalValue) { + + long remainder = totalBalance - totalValue; + + // Remainder bundle entry if necessary + if (remainderAddress == null) { + throw new IllegalStateException("No remainder address defined"); + } + + bundle.addEntry(1, remainderAddress, remainder, tag, timestamp); + } + + + bundle.finalize(customCurl); + bundle.addTrytes(signatureFragments); + + return GetTransferResponse.create(new Bundle[]{}, sw.getElapsedTimeMili()); + + + } else { + + throw new RuntimeException("Invalid value transfer: the transfer does not require a signature."); + } + + } + public String findTailTransactionHash(String hash) throws ArgumentException { GetTrytesResponse gtr = getTrytes(hash); diff --git a/src/main/java/jota/utils/InputValidator.java b/src/main/java/jota/utils/InputValidator.java index 4e01cd4..f3f5be8 100644 --- a/src/main/java/jota/utils/InputValidator.java +++ b/src/main/java/jota/utils/InputValidator.java @@ -27,10 +27,24 @@ public class InputValidator { return trytes.matches("^[A-Z9]{" + (length == 0 ? "0," : length) + "}$"); } + public static boolean isNinesTrytes(final String trytes, final int length) { + return trytes.matches("^[9]{" + (length == 0 ? "0," : length) + "}$"); + } + public static boolean isValue(final String value) { return NumberUtils.isNumber(value); } + public static boolean isArrayOfTrytes(String[] trytes){ + for (String tryte : trytes) { + // Check if correct 2673 trytes + if (!isTrytes(tryte, 2673)) { + return false; + } + } + return true; + } + public static boolean isArrayOfHashes(String[] hashes) { if (hashes == null) return false; diff --git a/src/main/java/jota/utils/Multisig.java b/src/main/java/jota/utils/Multisig.java new file mode 100644 index 0000000..8623064 --- /dev/null +++ b/src/main/java/jota/utils/Multisig.java @@ -0,0 +1,221 @@ +package jota.utils; + +import jota.model.Bundle; +import jota.pow.ICurl; +import jota.pow.JCurl; + +import java.util.Arrays; + +/** + * Created by pinpong on 02.02.17. + */ +public class Multisig { + + private ICurl curl; + private Signing signingInstance; + + public Multisig(ICurl customCurl) { + this.curl = customCurl; + this.signingInstance = new Signing(curl); + } + + public Multisig() { + this.curl = new JCurl(); + } + + /** + * Gets the digest value of a seed + * + * @param {string} seed + * @param {int} index + * @param {int} security + * @method getDigest + * @returns {string} digest trytes + **/ + private String getDigest(String seed, int index, int security) { + + int[] key = signingInstance.key(Converter.trits(seed), index, security); + return Converter.trytes(signingInstance.digests(key)); + } + + /** + * Initiates the generation of a new multisig address or adds the key digest to an existing one + * + * @param digestTrytes + * @param curlStateTrytes + * @method addAddressDigest + * @returns {String} + **/ + private String addAddressDigest(String digestTrytes, String curlStateTrytes, ICurl customCurl) { + + int[] digest = Converter.trits(digestTrytes); + + // If curlStateTrytes is provided, convert into trits + // else use empty state and initiate the creation of a new address + + int[] curlState = curlStateTrytes.isEmpty() ? Converter.trits(curlStateTrytes) : new int[243]; + + + ICurl curl = customCurl == null ? new JCurl() : customCurl; + + + // initialize Curl with the provided state + curl.setState(curlState); + // absorb the key digest + curl.absorb(digest); + + return Converter.trytes(curl.getState()); + } + + /** + * Gets the key value of a seed + * + * @param {string} seed + * @param {int} index + * @method getKey + * @returns {string} digest trytes + **/ + + private String getKey(String seed, int index, int security) { + + return Converter.trytes(signingInstance.key(Converter.trits(seed), index, security)); + } + + /** + * Generates a new address + * + * @param {string} curlStateTrytes + * @param {string} + * @method finalizeAddress + * @returns {String} address + **/ + private String finalizeAddress(String curlStateTrytes, ICurl customCurl) { + + int[] curlState = Converter.trits(curlStateTrytes); + + // initialize Curl with the provided state + curl.setState(curlState); + + int[] addressTrits = new int[243]; + curl.squeeze(addressTrits); + + // Convert trits into trytes and return the address + return Converter.trytes(addressTrits); + } + + /** + * Validates a generated multisig address + * + * @param multisigAddress + * @param digests + * @method validateAddress + * @returns {bool} + **/ + private boolean validateAddress(String multisigAddress, int[][] digests, ICurl customCurl) { + + // initialize Curl with the provided state + curl.reset(); + + + for (int[] keyDigest : digests) { + curl.absorb(keyDigest); + } + + int[] addressTrits = new int[243]; + curl.squeeze(addressTrits); + + // Convert trits into trytes and return the address + return Converter.trytes(addressTrits).equals(multisigAddress); + } + + /** + * Adds the cosigner signatures to the corresponding bundle transaction + * + * @param {array} bundleToSign + * @param {int} cosignerIndex + * @param {string} inputAddress + * @param {string} key + * @param {function} callback + * @method addSignature + * @returns {array} trytes Returns bundle trytes + **/ + private void addSignature(Bundle[] bundleToSign, String inputAddress, String keyTrytes) { + + + // Get the security used for the private key + // 1 security level = 2187 trytes + int security = (keyTrytes.length() / 2187); + + // convert private key trytes into trits + int[] key = Converter.trits(keyTrytes); + + + // First get the total number of already signed transactions + // use that for the bundle hash calculation as well as knowing + // where to add the signature + int numSignedTxs = 0; + + + for (Bundle bundle : bundleToSign) + + for (int i = 0; i < bundle.getTransactions().size(); i++) { + + if (!bundle.getTransactions().get(i).getAddress().equals(inputAddress)) { + + // If transaction is already signed, increase counter + if (!InputValidator.isNinesTrytes(bundle.getTransactions().get(i).getSignatureFragments(), bundle.getTransactions().get(i).getSignatureFragments().length())) { + + numSignedTxs++; + } + // Else sign the transactions + else { + + String bundleHash = bundle.getTransactions().get(i).getBundle(); + + // First 6561 trits for the firstFragment + int[] firstFragment = Arrays.copyOfRange(key, 0, 6561); + + // Get the normalized bundle hash + int[][] normalizedBundleFragments = new int[3][27]; + int[] normalizedBundleHash = bundle.normalizedBundle(bundleHash); + + + // Split hash into 3 fragments + for (int k = 0; k < 3; k++) { + normalizedBundleFragments[k] = Arrays.copyOfRange(normalizedBundleHash, (k * 27), (k + 1) * 27); + } + + + // First bundle fragment uses 27 trytes + int[] firstBundleFragment = normalizedBundleFragments[numSignedTxs % 3]; + + // Calculate the new signatureFragment with the first bundle fragment + int[] firstSignedFragment = signingInstance.signatureFragment(firstBundleFragment, firstFragment); + + // Convert signature to trytes and assign the new signatureFragment + bundle.getTransactions().get(i).setSignatureFragments(Converter.trytes(firstSignedFragment)); + + for (int j = 1; j < security; j++) { + + // Next 6561 trits for the firstFragment + int[] nextFragment = Arrays.copyOfRange(key, 6561 * j, (j + 1) * 6561); + + // Use the next 27 trytes + int[] nextBundleFragment = normalizedBundleFragments[(numSignedTxs + j) % 3]; + + // Calculate the new signatureFragment with the first bundle fragment + int[] nextSignedFragment = signingInstance.signatureFragment(nextBundleFragment, nextFragment); + + // Convert signature to trytes and add new bundle entry at i + j position + // Assign the signature fragment + bundle.getTransactions().get(i + j).setSignatureFragments(Converter.trytes(nextSignedFragment)); + } + + break; + } + } + } + + return; + } +} \ No newline at end of file From 7709521c8cecfe4cb2175df9f2dd104d9459f3c8 Mon Sep 17 00:00:00 2001 From: AZ Date: Sat, 4 Feb 2017 19:11:13 +0100 Subject: [PATCH 11/45] add missing class --- src/main/java/jota/error/InvalidTrytesException.java | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 src/main/java/jota/error/InvalidTrytesException.java diff --git a/src/main/java/jota/error/InvalidTrytesException.java b/src/main/java/jota/error/InvalidTrytesException.java new file mode 100644 index 0000000..8977f2f --- /dev/null +++ b/src/main/java/jota/error/InvalidTrytesException.java @@ -0,0 +1,11 @@ +package jota.error; + +/** + * Created by Adrian on 04.02.2017. + */ +public class InvalidTrytesException extends BaseException { + + public InvalidTrytesException() { + super("Invalid input trytes"); + } +} From 8e08047b939043a1695bc2462cd3b6dd5a737ac7 Mon Sep 17 00:00:00 2001 From: pinpong Date: Sun, 5 Feb 2017 11:57:13 +0100 Subject: [PATCH 12/45] added documentation --- src/main/java/jota/IotaAPI.java | 161 ++++++++++-------- src/main/java/jota/IotaAPICommands.java | 2 +- src/main/java/jota/IotaAPIService.java | 28 +-- src/main/java/jota/pow/JCurl.java | 2 +- src/main/java/jota/utils/Checksum.java | 55 +++++- src/main/java/jota/utils/InputValidator.java | 44 +++++ .../java/jota/utils/IotaUnitConverter.java | 21 +++ .../java/jota/utils/SeedRandomGenerator.java | 6 + src/main/java/jota/utils/TrytesConverter.java | 12 +- src/test/java/jota/IotaCoreApiTest.java | 2 +- 10 files changed, 231 insertions(+), 102 deletions(-) diff --git a/src/main/java/jota/IotaAPI.java b/src/main/java/jota/IotaAPI.java index db6672d..06af7e3 100644 --- a/src/main/java/jota/IotaAPI.java +++ b/src/main/java/jota/IotaAPI.java @@ -14,13 +14,13 @@ import java.util.*; /** * IotaAPI Builder. Usage: - *

+ * * IotaApiProxy api = IotaApiProxy.Builder * .protocol("http") * .nodeAddress("localhost") * .port(12345) * .build(); - *

+ * * GetNodeInfoResponse response = api.getNodeInfo(); * * @author davassi @@ -39,11 +39,11 @@ public class IotaAPI extends IotaAPICore { * Generates a new address from a seed and returns the remainderAddress. * This is either done deterministically, or by providing the index of the new remainderAddress * - * @param seed Tryte-encoded seed. It should be noted that this seed is not transferred - * @param security Security level to be used for the private key / address. Can be 1, 2 or 3 - * @param index Optional (default null). Key index to start search from. If the index is provided, the generation of the address is not deterministic. - * @param checksum Optional (default false). Adds 9-tryte address checksum - * @param total Optional (default 1)Total number of addresses to generate + * @param seed Tryte-encoded seed. It should be noted that this seed is not transferred + * @param security Security level to be used for the private key / address. Can be 1, 2 or 3 + * @param index Optional (default null). Key index to start search from. If the index is provided, the generation of the address is not deterministic. + * @param checksum Optional (default false). Adds 9-tryte address checksum + * @param total Optional (default 1)Total number of addresses to generate * @param returnAll If true, it returns all addresses which were deterministically generated (until findTransactions returns null) * @return an array of strings with the specifed number of addresses */ @@ -88,14 +88,12 @@ public class IotaAPI extends IotaAPICore { } /** - * @param seed - * @param start - * @param end - * @param inclusionStates - * @param security - * @param seed - * @param seed - * @returns Bundle + * @param seed tryte-encoded seed. It should be noted that this seed is not transferred + * @param security security secuirty level of private key / seed + * @param start start Starting key index + * @param end end Ending key index + * @param inclusionStates Optional (default false). If True, it gets the inclusion states of the transfers. + * @return Bundle **/ public GetTransferResponse getTransfers(String seed, int security, Integer start, Integer end, Boolean inclusionStates) throws ArgumentException, InvalidBundleException, InvalidSignatureException, NoNodeInfoException, NoInclusionStatesExcpection, InvalidSecurityLevelException { StopWatch stopWatch = new StopWatch(); @@ -116,7 +114,7 @@ public class IotaAPI extends IotaAPICore { StopWatch sw = new StopWatch(); System.out.println("GetTransfer started"); - GetNewAddressResponse gnr = getNewAddress(seed, security, start, false, end == null ? end - start : end, true); + GetNewAddressResponse gnr = getNewAddress(seed, security, start, false, end, true); if (gnr != null && gnr.getAddresses() != null) { System.out.println("GetTransfers after getNewAddresses " + sw.getElapsedTimeMili() + " ms"); Bundle[] bundles = bundlesFromAddresses(gnr.getAddresses().toArray(new String[gnr.getAddresses().size()]), inclusionStates); @@ -126,6 +124,13 @@ public class IotaAPI extends IotaAPICore { return GetTransferResponse.create(new Bundle[]{}, stopWatch.getElapsedTimeMili()); } + /** + * Internal function to get the formatted bundles of a list of addresses + * + * @param addresses List of addresses + * @param inclusionStates Optional (default false). If True, it gets the inclusion states of the transfers. + * @return bundles Transaction objects + **/ public Bundle[] bundlesFromAddresses(String[] addresses, final Boolean inclusionStates) throws ArgumentException, InvalidBundleException, InvalidSignatureException, NoNodeInfoException, NoInclusionStatesExcpection { List trxs = findTransactionObjects(addresses); @@ -160,7 +165,7 @@ public class IotaAPI extends IotaAPICore { // If inclusionStates, get the confirmation status // of the tail transactions, and thus the bundles GetInclusionStateResponse gisr = null; - if (tailTxArray != null && tailTxArray.length != 0 && inclusionStates) { + if (tailTxArray.length != 0 && inclusionStates) { try { gisr = getLatestInclusion(tailTxArray); } catch (IllegalAccessError ignored) { @@ -178,9 +183,12 @@ public class IotaAPI extends IotaAPICore { try { GetBundleResponse bundleResponse = getBundle(param); Bundle gbr = new Bundle(bundleResponse.getTransactions(), bundleResponse.getTransactions().size()); - if (gbr != null && gbr.getTransactions() != null) { + if (gbr.getTransactions() != null) { if (inclusionStates) { - boolean thisInclusion = finalInclusionStates.getStates()[Arrays.asList(tailTxArray).indexOf(param)]; + boolean thisInclusion = false; + if (finalInclusionStates != null) { + thisInclusion = finalInclusionStates.getStates()[Arrays.asList(tailTxArray).indexOf(param)]; + } for (Transaction t : gbr.getTransactions()) { t.setPersistence(thisInclusion); } @@ -203,7 +211,7 @@ public class IotaAPI extends IotaAPICore { } /** - * @param trytes + * @param trytes the trytes * @return a StoreTransactionsResponse */ public StoreTransactionsResponse broadcastAndStore(final String... trytes) throws BroadcastAndStoreException { @@ -220,10 +228,10 @@ public class IotaAPI extends IotaAPICore { /** * Facade method: Gets transactions to approve, attaches to Tangle, broadcasts and stores * - * @param {array} trytes - * @param {int} depth - * @param {int} minWeightMagnitude - * @return + * @param trytes the trytes + * @param depth the depth + * @param minWeightMagnitude the minimum weight magnitude + * @return Transactions objects */ public List sendTrytes(final String[] trytes, final int depth, final int minWeightMagnitude) throws InvalidTrytesException { final GetTransactionsToApproveResponse txs = getTransactionsToApprove(depth); @@ -249,11 +257,9 @@ public class IotaAPI extends IotaAPICore { * Wrapper function for getTrytes and transactionObjects * gets the trytes and transaction object from a list of transaction hashes * - * @param {array} hashes - * @return * @method getTransactionsObjects - * @returns {function} callback - * @returns {object} success + * @param hashes the hashes + * @return Transaction objects **/ public List getTransactionsObjects(String[] hashes) { @@ -276,10 +282,9 @@ public class IotaAPI extends IotaAPICore { * Returns the transactionObject of a transaction hash. The input can be a valid * findTransactions input * - * @param {object} input * @method getTransactionsObjects - * @returns {function} callback - * @returns {object} success + * @param input the inputs + * @return Transactions **/ public List findTransactionObjects(String[] input) { FindTransactionResponse ftr = findTransactions(input, null, null, null); @@ -293,11 +298,9 @@ public class IotaAPI extends IotaAPICore { * Wrapper function for findTransactions, getTrytes and transactionObjects * Returns the transactionObject of a transaction hash. The input can be a valid * findTransactions input - * - * @param {object} input * @method getTransactionsObjects - * @returns {function} callback - * @returns {object} success + * @param input the inputs + * @return Transactions **/ public List findTransactionObjectsByBundle(String[] input) { FindTransactionResponse ftr = findTransactions(null, null, null, input); @@ -311,13 +314,12 @@ public class IotaAPI extends IotaAPICore { /** * Prepares transfer by generating bundle, finding and signing inputs * - * @param seed - * @param security - * @param transfers - * @param remainder - * @param inputs - * @param security - * @returns {array} trytes Returns bundle trytes + * @param seed 81-tryte encoded address of recipient + * @param security security secuirty level of private key / seed + * @param transfers Array of transfer objects + * @param remainder Optional (default null). if defined, this address will be used for sending the remainder value (of the inputs) to. + * @param inputs the inputs + * @return trytes Returns bundle trytes **/ public List prepareTransfers(String seed, int security, final List transfers, String remainder, List inputs) throws NotEnoughBalanceException, InvalidSecurityLevelException { @@ -471,10 +473,10 @@ public class IotaAPI extends IotaAPICore { /** * Gets the inputs of a seed * - * @param seed - * @param security security secuirty level of private key / seed - * @param start start Starting key index - * @param end end Ending key index + * @param seed tryte-encoded seed. It should be noted that this seed is not transferred + * @param security security secuirty level of private key / seed + * @param start start Starting key index + * @param end end Ending key index * @param threshold threshold Min balance required **/ public GetBalancesAndFormatResponse getInputs(String seed, int security, int start, int end, long threshold) throws InvalidSecurityLevelException { @@ -526,8 +528,18 @@ public class IotaAPI extends IotaAPICore { } } - // Calls getBalances and formats the output - // returns the final inputsObject then + + /** + * Gets the balances and formats the output + * + * @param addresses the addresses + * @param threshold threshold Min balance required + * @param start start Starting key index + * @param end end Ending key index + * @param stopWatch the stopwatch + * @param security security secuirty level of private key / seed + * @return Inputs object + **/ public GetBalancesAndFormatResponse getBalanceAndFormat(final List addresses, long threshold, int start, int end, StopWatch stopWatch, int security) throws InvalidSecurityLevelException { if (security < 1 || security > 3) { @@ -572,10 +584,8 @@ public class IotaAPI extends IotaAPICore { /** * Gets the associated bundle transactions of a single transaction * Does validation of signatures, total sum as well as bundle order - * - * @param {string} transaction Hash of a tail transaction - * @method getBundle - * @returns {list} bundle Transaction objects + * @param transaction the transaction encoded in trytes + * @return an array of bundle, if there are multiple arrays it means that there are conflicting bundles. **/ public GetBundleResponse getBundle(String transaction) throws ArgumentException, InvalidBundleException, InvalidSignatureException { StopWatch stopWatch = new StopWatch(); @@ -655,12 +665,10 @@ public class IotaAPI extends IotaAPICore { /** * Replays a transfer by doing Proof of Work again * - * @param {string} tail - * @param {int} depth - * @param {int} minWeightMagnitude - * @param {function} callback - * @method replayBundle - * @returns {object} analyzed Transaction objects + * @param transaction the transaction + * @param depth the depth + * @param minWeightMagnitude the minimum weight magnitude + * @return analyzed Transaction objects **/ public ReplayBundleResponse replayBundle(String transaction, int depth, int minWeightMagnitude) throws InvalidBundleException, ArgumentException, InvalidSignatureException, InvalidTrytesException { StopWatch stopWatch = new StopWatch(); @@ -692,10 +700,8 @@ public class IotaAPI extends IotaAPICore { /** * Wrapper function for getNodeInfo and getInclusionStates * - * @param {array} hashes - * @method getLatestInclusion - * @returns {function} callback - * @returns {array} state + * @param hashes the hashes + * @return inclusion state **/ public GetInclusionStateResponse getLatestInclusion(String[] hashes) throws NoNodeInfoException { GetNodeInfoResponse getNodeInfoResponse = getNodeInfo(); @@ -706,6 +712,19 @@ public class IotaAPI extends IotaAPICore { return getInclusionStates(hashes, latestMilestone); } + /** + * Wrapper function that basically does prepareTransfers, as well as attachToTangle and finally, it broadcasts and stores the transactions locally. + * + * @param seed tryte-encoded seed + * @param security security secuirty level of private key / seed + * @param depth the depth + * @param minWeightMagnitude the minimum weight magnitude + * @param transfers array of transfer objects + * @param inputs Option (default null). List of inputs used for funding the transfer + * @param address if defined, this address will be used for sending the remainder value (of the inputs) to + * @return array of Transaction objects + **/ + public SendTransferResponse sendTransfer(String seed, int security, int depth, int minWeightMagnitude, final List transfers, Input[] inputs, String address) throws NotEnoughBalanceException, InvalidSecurityLevelException, InvalidTrytesException { if (security < 1 || security > 3) { @@ -734,11 +753,10 @@ public class IotaAPI extends IotaAPICore { * the bundle hash of the transaction is no longer the same. In case the input * transaction hash is not a tail, we return an error. * - * @param {string} trunkTx Hash of a trunk or a tail transaction of a bundle - * @param {string} bundleHash - * @param {array} bundle List of bundles to be populated - * @method traverseBundle - * @returns {array} bundle Transaction objects + * @param trunkTx Hash of a trunk or a tail transaction of a bundle + * @param bundleHash the bundle hashes + * @param bundle List of bundles to be populated + * @return bundle Transaction objects **/ public Bundle traverseBundle(String trunkTx, String bundleHash, Bundle bundle) throws ArgumentException { GetTrytesResponse gtr = getTrytes(trunkTx); @@ -750,7 +768,7 @@ public class IotaAPI extends IotaAPICore { } Transaction trx = new Transaction(gtr.getTrytes()[0], customCurl); - if (trx == null || trx.getBundle() == null) { + if (trx.getBundle() == null) { throw new ArgumentException("Invalid trytes, could not create object"); } // If first transaction to search is not a tail, return error @@ -786,13 +804,10 @@ public class IotaAPI extends IotaAPICore { * Prepares transfer by generating the bundle with the corresponding cosigner transactions * Does not contain signatures * - * @param {object} transfers - * @param {function} callback * @param securitySum sum of security levels used by all co-signers * @param inputAddress array of input addresses as well as the securitySum * @param remainderAddress Has to be generated by the cosigners before initiating the transfer, can be null if fully spent - * @method initiateTransfer - * @returns {array} Array of transaction objects + * @return bundle of transaction objects **/ private GetTransferResponse initiateTransfer(int securitySum, final List inputAddress, String remainderAddress, final List transfers) { StopWatch sw = new StopWatch(); @@ -960,7 +975,7 @@ public class IotaAPI extends IotaAPICore { } Transaction trx = new Transaction(gtr.getTrytes()[0], customCurl); - if (trx == null || trx.getBundle() == null) { + if (trx.getBundle() == null) { throw new ArgumentException("Invalid trytes, could not create object"); } if (Integer.parseInt(trx.getCurrentIndex()) == 0) return trx.getHash(); diff --git a/src/main/java/jota/IotaAPICommands.java b/src/main/java/jota/IotaAPICommands.java index ed4d6bc..bcb9b58 100644 --- a/src/main/java/jota/IotaAPICommands.java +++ b/src/main/java/jota/IotaAPICommands.java @@ -2,7 +2,7 @@ package jota; /** * IOTA's node command list - *

+ * * 'params' is not currently used. */ public enum IotaAPICommands { diff --git a/src/main/java/jota/IotaAPIService.java b/src/main/java/jota/IotaAPIService.java index 2946307..a626209 100644 --- a/src/main/java/jota/IotaAPIService.java +++ b/src/main/java/jota/IotaAPIService.java @@ -19,7 +19,7 @@ public interface IotaAPIService { /** * Returns information about your node. - *

+ * * curl http://localhost:14265 -X POST -H 'Content-Type: application/json' * -d '{"command": "getNodeInfo"}' * @@ -31,7 +31,7 @@ public interface IotaAPIService { /** * Get the list of latest tips (unconfirmed transactions). - *

+ * * curl http://localhost:14265 -X POST -H 'Content-Type: application/json' * -d '{"command": "getNeighbors"}' */ @@ -41,7 +41,7 @@ public interface IotaAPIService { /** * Add a list of neighbors to your node. - *

+ * * curl http://localhost:14265 -X POST -H 'Content-Type: application/json' * -d '{"command": "addNeighbors", "uris": ["udp://8.8.8.8:14265", "udp://8.8.8.5:14265"]}' */ @@ -51,7 +51,7 @@ public interface IotaAPIService { /** * Removes a list of neighbors to your node. - *

+ * * curl http://localhost:14265 -X POST -H 'Content-Type: application/json' * -d '{"command": "removeNeighbors", "uris": ["udp://8.8.8.8:14265", "udp://8.8.8.5:14265"]}' */ @@ -61,7 +61,7 @@ public interface IotaAPIService { /** * Get the list of latest tips (unconfirmed transactions). - *

+ * * curl http://localhost:14265 -X POST -H 'Content-Type: application/json' * -d '{"command": "getTips"}' */ @@ -71,7 +71,7 @@ public interface IotaAPIService { /** * Find the transactions which match the specified input and return - *

+ * * curl http://localhost:14265 \ -X POST \ -H 'Content-Type: application/json' \ * -d '{"command": "findTransactions", "addresses": ["RVORZ9SIIP9RCYMREUIXXVPQIPHVCNPQ9HZWYKFWYWZRE9JQKG9REPKIASHUUECPSQO9JT9XNMVKWYGVAZETAIRPTM"]}' */ @@ -82,7 +82,7 @@ public interface IotaAPIService { /** * Get the inclusion states of a set of transactions. This is for determining if a transaction was accepted and confirmed by the network or not. You can search for multiple tips (and thus, milestones) to get past inclusion states of transactions. - *

+ * * curl http://localhost:14265 -X POST -H 'Content-Type: application/json' * -d '{"command": "getInclusionStates", "transactions"Q9HZWYKFWYWZRE9JQKG9REPKIASHUUECPSQO9JT9XNMVKWYGVAZETAIRPTM"], "tips" : []}' */ @@ -92,7 +92,7 @@ public interface IotaAPIService { /** * Returns the raw trytes data of a transaction. - *

+ * * curl http://localhost:14265 -X POST -H 'Content-Type: application/json' * -d '{"command": "getTrytes", "hashes": ["OAATQS9VQLSXCLDJVJJVYUGONXAXOFMJOZNSYWRZSWECMXAQQURHQBJNLD9IOFEPGZEPEMPXCIVRX9999"]}' */ @@ -102,7 +102,7 @@ public interface IotaAPIService { /** * Tip selection which returns trunkTransaction and branchTransaction. The input value is the latest coordinator milestone, as provided through the getNodeInfo API call. - *

+ * * curl http://localhost:14265 -X POST -H 'Content-Type: application/json' * -d '{"command": "getTransactionsToApprove", "depth": 27}' */ @@ -112,7 +112,7 @@ public interface IotaAPIService { /** * It returns the confirmed balance which a list of addresses have at the latest confirmed milestone. - *

+ * * curl http://localhost:14265 -X POST -H 'Content-Type: application/json' * -d '{"command": "getBalances", "addresses": ["HBBYKAKTILIPVUKFOTSLHGENPTXYBNKXZFQFR9VQFWNBMTQNRVOUKPVPRNBSZVVILMAFBKOTBLGLWLOHQ"], "threshold": 100}' */ @@ -122,7 +122,7 @@ public interface IotaAPIService { /** * Attaches the specified transactions (trytes) to the Tangle by doing Proof of Work. - *

+ * * curl http://localhost:14265 -X POST -H 'Content-Type: application/json' * -d '{"command": "attachToTangle", "trunkTransaction": "JVMTDGDPDFYHMZPMWEKKANBQSLSDTIIHAYQUMZOKHXXXGJHJDQPOMDOMNRDKYCZRUFZROZDADTHZC9999", "branchTransaction": "P9KFSJVGSPLXAEBJSHWFZLGP9GGJTIO9YITDEHATDTGAFLPLBZ9FOFWWTKMAZXZHFGQHUOXLXUALY9999", "minWeightMagnitude": 18, "trytes": ["TRYTVALUEHERE"]}' */ @@ -132,7 +132,7 @@ public interface IotaAPIService { /** * Interrupts and completely aborts the attachToTangle process. - *

+ * * curl http://localhost:14265 -X POST -H 'Content-Type: application/json' * -d '{"command": "interruptAttachingToTangle" } */ @@ -142,7 +142,7 @@ public interface IotaAPIService { /** * Broadcast a list of transactions to all neighbors. The input trytes for this call are provided by attachToTangle. - *

+ * * curl http://localhost:14265 -X POST -H 'Content-Type: application/json' * -d '{"command": "broadcastTransactions", "trytes": ["BYSWEAUTWXHXZ9YBZISEK9LUHWGMHXCGEVNZHRLUWQFCUSDXZHOFHWHL9MQPVJXXZLIXPXPXF9KYEREFSKCPKYIIKPZVLHUTDFQKKVVBBN9ATTLPCNPJDWDEVIYYLGPZGCWXOBDXMLJC9VO9QXTTBLAXTTBFUAROYEGQIVB9MJWJKXJMCUPTWAUGFZBTZCSJVRBGMYXTVBDDS9MYUJCPZ9YDWWQNIPUAIJXXSNLKUBSCOIJPCLEFPOXFJREXQCUVUMKSDOVQGGHRNILCO9GNCLWFM9APMNMWYASHXQAYBEXF9QRIHIBHYEJOYHRQJAOKAQ9AJJFQ9WEIWIJOTZATIBOXQLBMIJU9PCGBLVDDVFP9CFFSXTDUXMEGOOFXWRTLFGV9XXMYWEMGQEEEDBTIJ9OJO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GYNPAJNUJ9BKYYXSV9JSPEXYMCFAIKTGNRSQGUNIYZCRT9FOWENSZQPD9ALUPYYAVICHVYELYFPUYDTWUSWNIYFXPX9MICCCOOZIWRNJIDALWGWRATGLJXNAYTNIZWQ9YTVDBOFZRKO9CFWRPAQQRXTPACOWCPRLYRYSJARRKSQPR9TCFXDVIXLP9XVL99ERRDSOHBFJDJQQGGGCZNDQ9NYCTQJWVZIAELCRBJJFDMCNZU9FIZRPGNURTXOCDSQGXTQHKHUECGWFUUYS9J9NYQ9U9P9UUP9YMZHWWWCIASCFLCMSKTELZWUGCDE9YOKVOVKTAYPHDF9ZCCQAYPJIJNGSHUIHHCOSSOOBUDOKE9CJZGYSSGNCQJVBEFTZFJ9SQUHOASKRRGBSHWKBCBWBTJHOGQ9WOMQFHWJVEG9NYX9KWBTCAIXNXHEBDIOFO9ALYMFGRICLCKKLG9FOBOX9PDWNQRGHBKHGKKRLWTBEQMCWQRLHAVYYZDIIPKVQTHYTWQMTOACXZOQCDTJTBAAUWXSGJF9PNQIJ9AJRUMUVCPWYVYVARKR9RKGOUHHNKNVGGPDDLGKPQNOYHNKAVVKCXWXOQPZNSLATUJT9AUWRMPPSWHSTTYDFAQDXOCYTZHOYYGAIM9CELMZ9AZPWB9MJXGHOKDNNSZVUDAGXTJJSSZCPZVPZBYNNTUQABSXQWZCHDQSLGK9UOHCFKBIBNETK999999999999999999999999999999999999999999999999999999999999999999999999999999999NOXDXXKUDWLOFJLIPQIBRBMGDYCPGDNLQOLQS99EQYKBIU9VHCJVIPFUYCQDNY9APGEVYLCENJIOBLWNB999999999XKBRHUD99C99999999NKZKEKWLDKMJCI9N9XQOLWEPAYWSH9999999999999999999999999KDDTGZLIPBNZKMLTOLOXQVNGLASESDQVPTXALEKRMIOHQLUHD9ELQDBQETS9QFGTYOYWLNTSKKMVJAUXSIROUICDOXKSYZTDPEDKOQENTJOWJONDEWROCEJIEWFWLUAACVSJFTMCHHXJBJRKAAPUDXXVXFWP9X9999IROUICDOXKSYZTDPEDKOQENTJOWJONDEWROCEJIEWFWLUAACVSJFTMCHHXJBJRKAAPUDXXVXFWP9X9999"]} */ @@ -152,7 +152,7 @@ public interface IotaAPIService { /** * Store transactions into the local storage. The trytes to be used for this call are returned by attachToTangle. - *

+ * * curl http://localhost:14265 -X POST -H 'Content-Type: application/json' * -d '{"command": "storeTransactions", "trytes": ["BYSWEAUTWXHXZ9YBZISEK9LUHWGMHXCGEVNZHRLUWQFCUSDXZHOFHWHL9MQPVJXXZLIXPXPXF9KYEREFSKCPKYIIKPZVLHUTDFQKKVVBBN9ATTLPCNPJDWDEVIYYLGPZGCWXOBDXMLJC9VO9QXTTBLAXTTBFUAROYEGQIVB9MJWJKXJMCUPTWAUGFZBTZCSJVRBGMYXTVBDDS9MYUJCPZ9YDWWQNIPUAIJXXSNLKUBSCOIJPCLEFPOXFJREXQCUVUMKSDOVQGGHRNILCO9GNCLWFM9APMNMWYASHXQAYBEXF9QRIHIBHYEJOYHRQJAOKAQ9AJJFQ9WEIWIJOTZATIBOXQLBMIJU9PCGBLVDDVFP9CFFSXTDUXMEGOOFXWRTLFGV9XXMYWEMGQEEEDBTIJ9OJOXFAPFQXCDAXOUDMLVYRMRLUDBETOLRJQAEDDLNVIRQJUBZBO9CCFDHIX9MSQCWYAXJVWHCUPTRSXJDESISQPRKZAFKFRULCGVRSBLVFOPEYLEE99JD9SEBALQINPDAZHFAB9RNBH9AZWIJOTLBZVIEJIAYGMC9AZGNFWGRSWAXTYSXVROVNKCOQQIWGPNQZKHUNODGYADPYLZZZUQRTJRTODOUKAOITNOMWNGHJBBA99QUMBHRENGBHTH9KHUAOXBVIVDVYYZMSEYSJWIOGGXZVRGN999EEGQMCOYVJQRIRROMPCQBLDYIGQO9AMORPYFSSUGACOJXGAQSPDY9YWRRPESNXXBDQ9OZOXVIOMLGTSWAMKMTDRSPGJKGBXQIVNRJRFRYEZ9VJDLHIKPSKMYC9YEGHFDS9SGVDHRIXBEMLFIINOHVPXIFAZCJK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AIXNXHEBDIOFO9ALYMFGRICLCKKLG9FOBOX9PDWNQRGHBKHGKKRLWTBEQMCWQRLHAVYYZDIIPKVQTHYTWQMTOACXZOQCDTJTBAAUWXSGJF9PNQIJ9AJRUMUVCPWYVYVARKR9RKGOUHHNKNVGGPDDLGKPQNOYHNKAVVKCXWXOQPZNSLATUJT9AUWRMPPSWHSTTYDFAQDXOCYTZHOYYGAIM9CELMZ9AZPWB9MJXGHOKDNNSZVUDAGXTJJSSZCPZVPZBYNNTUQABSXQWZCHDQSLGK9UOHCFKBIBNETK999999999999999999999999999999999999999999999999999999999999999999999999999999999NOXDXXKUDWLOFJLIPQIBRBMGDYCPGDNLQOLQS99EQYKBIU9VHCJVIPFUYCQDNY9APGEVYLCENJIOBLWNB999999999XKBRHUD99C99999999NKZKEKWLDKMJCI9N9XQOLWEPAYWSH9999999999999999999999999KDDTGZLIPBNZKMLTOLOXQVNGLASESDQVPTXALEKRMIOHQLUHD9ELQDBQETS9QFGTYOYWLNTSKKMVJAUXSIROUICDOXKSYZTDPEDKOQENTJOWJONDEWROCEJIEWFWLUAACVSJFTMCHHXJBJRKAAPUDXXVXFWP9X9999IROUICDOXKSYZTDPEDKOQENTJOWJONDEWROCEJIEWFWLUAACVSJFTMCHHXJBJRKAAPUDXXVXFWP9X9999"]}' */ diff --git a/src/main/java/jota/pow/JCurl.java b/src/main/java/jota/pow/JCurl.java index 8eeebf1..f4ba2ff 100644 --- a/src/main/java/jota/pow/JCurl.java +++ b/src/main/java/jota/pow/JCurl.java @@ -2,7 +2,7 @@ package jota.pow; /** * (c) 2016 Come-from-Beyond - *

+ * * JCurl belongs to the sponge function family. */ public class JCurl implements ICurl { diff --git a/src/main/java/jota/utils/Checksum.java b/src/main/java/jota/utils/Checksum.java index 79605e5..1e6a923 100644 --- a/src/main/java/jota/utils/Checksum.java +++ b/src/main/java/jota/utils/Checksum.java @@ -1,13 +1,18 @@ package jota.utils; import jota.pow.JCurl; -import org.apache.commons.lang3.StringUtils; /** * Created by pinpong on 02.12.16. */ public class Checksum { + /** + * adds the checksum to the specified address + * + * @param address address without checksum + * @return the address with the appended checksum + **/ public static String addChecksum(String address) { InputValidator.checkAddress(address); String addressWithChecksum = address; @@ -15,32 +20,70 @@ public class Checksum { return addressWithChecksum; } - public static String removeChecksum(String addressWithChecksum) { - if (isAddressWithChecksum(addressWithChecksum)) { - return getAddress(addressWithChecksum); + /** + * remove the checksum to the specified address + * + * @param address address with checksum + * @return the address without checksum + **/ + public static String removeChecksum(String address) { + if (isAddressWithChecksum(address)) { + return getAddress(address); } - return StringUtils.EMPTY; + throw new RuntimeException("Invalid address: " + address); } + /** + * remove checksum length + * + * @param addressWithChecksum address with checksum + * @return address without checksum + **/ private static String getAddress(String addressWithChecksum) { return addressWithChecksum.substring(0, Constants.ADDRESS_LENGTH_WITHOUT_CHECKSUM); } + /** + * check if checksum is valid + * + * @param addressWithChecksum address + * @return boolean + **/ public static boolean isValidChecksum(String addressWithChecksum) { String addressWithoutChecksum = removeChecksum(addressWithChecksum); String addressWithRecalculateChecksum = addressWithChecksum += calculateChecksum(addressWithoutChecksum); return addressWithRecalculateChecksum.equals(addressWithChecksum); } + + /** + * check if specified address is a address with checksum + * + * @param address address + * @return boolean + **/ public static boolean isAddressWithChecksum(String address) { return InputValidator.checkAddress(address) && address.length() == Constants.ADDRESS_LENGTH_WITH_CHECKSUM; } + + /** + * check if specified address is a address + * + * @param address address + * @return boolean + **/ public static boolean isAddressWithoutChecksum(String address) { return InputValidator.checkAddress(address) && address.length() == Constants.ADDRESS_LENGTH_WITHOUT_CHECKSUM; } - public static String calculateChecksum(String address) { + /** + * calculate the checksum to the specified address + * + * @param address address + * @return the checksum + **/ + private static String calculateChecksum(String address) { JCurl curl = new JCurl(); curl.reset(); curl.setState(Converter.copyTrits(address, curl.getState())); diff --git a/src/main/java/jota/utils/InputValidator.java b/src/main/java/jota/utils/InputValidator.java index f3f5be8..b345284 100644 --- a/src/main/java/jota/utils/InputValidator.java +++ b/src/main/java/jota/utils/InputValidator.java @@ -11,11 +11,23 @@ import java.util.List; */ public class InputValidator { + /** + * validates an address + * + * @param address address to validate + * @return boolean + **/ public static boolean isAddress(String address) { return (address.length() == Constants.ADDRESS_LENGTH_WITHOUT_CHECKSUM || address.length() == Constants.ADDRESS_LENGTH_WITH_CHECKSUM) && isTrytes(address, address.length()); } + /** + * checks whether the specified address is an address + * + * @param address address to validate + * @return boolean + **/ public static boolean checkAddress(String address) { if (!isAddress(address)) { throw new RuntimeException("Invalid address: " + address); @@ -23,18 +35,44 @@ public class InputValidator { return true; } + /** + * checks if input is correct trytes consisting of A-Z9 optionally validates length + * + * @param trytes the trytes + * @param length the length + * @return boolean + **/ public static boolean isTrytes(final String trytes, final int length) { return trytes.matches("^[A-Z9]{" + (length == 0 ? "0," : length) + "}$"); } + /** + * checks if input is correct trytes consisting of 9 optionally validates length + * + * @param trytes the trytes + * @param length the length + * @return boolean + **/ public static boolean isNinesTrytes(final String trytes, final int length) { return trytes.matches("^[9]{" + (length == 0 ? "0," : length) + "}$"); } + /** + * determines whether the specified string represents a signed integer + * + * @param value the value + * @return boolean + **/ public static boolean isValue(final String value) { return NumberUtils.isNumber(value); } + /** + * determines whether the specified string represents a signed integer + * + * @param value the value + * @return boolean + **/ public static boolean isArrayOfTrytes(String[] trytes){ for (String tryte : trytes) { // Check if correct 2673 trytes @@ -96,6 +134,12 @@ public class InputValidator { return isTrytes(transfer.getTag(), 27); } + /** + * validate the seed + * + * @param seed the seed + * @return validated seed + **/ public static String validateSeed(String seed) { if (seed.length() > 81) return null; diff --git a/src/main/java/jota/utils/IotaUnitConverter.java b/src/main/java/jota/utils/IotaUnitConverter.java index def86e0..131fe59 100644 --- a/src/main/java/jota/utils/IotaUnitConverter.java +++ b/src/main/java/jota/utils/IotaUnitConverter.java @@ -7,6 +7,14 @@ import java.text.DecimalFormat; */ public class IotaUnitConverter { + /** + * convert the iota amount + * + * @param amount the amount + * @param fromUnit the source unit e.g. the unit of amount + * @param toUnit the target unit + * @return the specified amount in the target unit + **/ public static long convertUnits(long amount, IotaUnits fromUnit, IotaUnits toUnit) { long amountInSource = (long) (amount * Math.pow(10, fromUnit.getValue())); return convertUnits(amountInSource, toUnit); @@ -16,6 +24,13 @@ public class IotaUnitConverter { return (long) (amount / Math.pow(10, toUnit.getValue())); } + /** + * convert the iota amount to text + * + * @param amount the amount + * @param extended extended length + * @return the specified amount in the target unit + **/ public static String convertRawIotaAmountToDisplayText(long amount, boolean extended) { IotaUnits unit = findOptimalIotaUnitToDisplay(amount); double amountInDisplayUnit = convertAmountTo(amount, unit); @@ -44,6 +59,12 @@ public class IotaUnitConverter { return result; } + /** + * finds the optimal unit to display the specified amount in + * + * @param amount the amount + * @return the optimal IotaUnit + **/ public static IotaUnits findOptimalIotaUnitToDisplay(long amount) { int length = String.valueOf(amount).length(); diff --git a/src/main/java/jota/utils/SeedRandomGenerator.java b/src/main/java/jota/utils/SeedRandomGenerator.java index fa8b58c..2727d8c 100644 --- a/src/main/java/jota/utils/SeedRandomGenerator.java +++ b/src/main/java/jota/utils/SeedRandomGenerator.java @@ -7,6 +7,12 @@ import java.security.SecureRandom; */ public class SeedRandomGenerator { + + /** + * generate a new seed + * + * @return random generated seed + **/ public static String generateNewSeed() { char[] chars = Constants.TRYTE_ALPHABET.toCharArray(); StringBuilder builder = new StringBuilder(); diff --git a/src/main/java/jota/utils/TrytesConverter.java b/src/main/java/jota/utils/TrytesConverter.java index 81f585a..bea49ac 100644 --- a/src/main/java/jota/utils/TrytesConverter.java +++ b/src/main/java/jota/utils/TrytesConverter.java @@ -8,20 +8,20 @@ public class TrytesConverter { /** * Conversion of ascii encoded bytes to trytes. * Input is a string (can be stringified JSON object), return value is Trytes - *

+ * * How the conversion works: * 2 Trytes === 1 Byte * There are a total of 27 different tryte values: 9ABCDEFGHIJKLMNOPQRSTUVWXYZ - *

+ * * 1. We get the decimal value of an individual ASCII character * 2. From the decimal value, we then derive the two tryte values by basically calculating the tryte equivalent (e.g. 100 === 19 + 3 * 27) * a. The first tryte value is the decimal value modulo 27 (27 trytes) * b. The second value is the remainder (decimal value - first value), divided by 27 * 3. The two values returned from Step 2. are then input as indices into the available values list ('9ABCDEFGHIJKLMNOPQRSTUVWXYZ') to get the correct tryte value - *

- *

+ * + * * EXAMPLE - *

+ * * Lets say we want to convert the ASCII character "Z". * 1. 'Z' has a decimal value of 90. * 2. 90 can be represented as 9 + 3 * 27. To make it simpler: @@ -31,7 +31,7 @@ public class TrytesConverter { * a. The first tryte value is '9ABCDEFGHIJKLMNOPQRSTUVWXYZ'[9] === "I" * b. The second tryte value is '9ABCDEFGHIJKLMNOPQRSTUVWXYZ'[3] === "C" * Our tryte pair is "IC" - *

+ * * * @param inputString * @return The ASCII char "Z" is represented as "IC" in trytes. diff --git a/src/test/java/jota/IotaCoreApiTest.java b/src/test/java/jota/IotaCoreApiTest.java index a1cf103..d3aa4e8 100644 --- a/src/test/java/jota/IotaCoreApiTest.java +++ b/src/test/java/jota/IotaCoreApiTest.java @@ -77,7 +77,7 @@ public class IotaCoreApiTest { @Test public void shouldFindTransactionsByApprovees() { - FindTransactionResponse trans = proxy.findTransactionsByApprovees(new String[]{TEST_HASH}); + FindTransactionResponse trans = proxy.findTransactionsByApprovees(TEST_HASH); assertThat(trans.getHashes(), IsNull.notNullValue()); } From cdea177ebdc4d7f730effff67562468bbe9839e1 Mon Sep 17 00:00:00 2001 From: pinpong Date: Sun, 5 Feb 2017 13:43:06 +0100 Subject: [PATCH 13/45] added more documentation --- src/main/java/jota/IotaAPI.java | 31 ++++++------- .../jota/error/InvalidAddressException.java | 10 ++++ .../jota/error/InvalidTransferException.java | 10 ++++ src/main/java/jota/utils/Checksum.java | 13 +++--- src/main/java/jota/utils/Converter.java | 14 ++++++ src/main/java/jota/utils/InputValidator.java | 28 +++++++---- src/main/java/jota/utils/IotaAPIUtils.java | 12 +++-- .../java/jota/utils/IotaUnitConverter.java | 29 ++++++++++++ src/main/java/jota/utils/Multisig.java | 46 ++++++++----------- src/test/java/jota/ChecksumTest.java | 7 +-- src/test/java/jota/InputValidatorTest.java | 3 +- src/test/java/jota/IotaAPITest.java | 21 ++++----- 12 files changed, 144 insertions(+), 80 deletions(-) create mode 100644 src/main/java/jota/error/InvalidAddressException.java create mode 100644 src/main/java/jota/error/InvalidTransferException.java diff --git a/src/main/java/jota/IotaAPI.java b/src/main/java/jota/IotaAPI.java index 06af7e3..73a00e9 100644 --- a/src/main/java/jota/IotaAPI.java +++ b/src/main/java/jota/IotaAPI.java @@ -47,7 +47,7 @@ public class IotaAPI extends IotaAPICore { * @param returnAll If true, it returns all addresses which were deterministically generated (until findTransactions returns null) * @return an array of strings with the specifed number of addresses */ - public GetNewAddressResponse getNewAddress(final String seed, int security, final int index, final boolean checksum, final int total, final boolean returnAll) throws InvalidSecurityLevelException { + public GetNewAddressResponse getNewAddress(final String seed, int security, final int index, final boolean checksum, final int total, final boolean returnAll) throws InvalidSecurityLevelException, InvalidAddressException { if (security < 1 || security > 3) { throw new InvalidSecurityLevelException(); @@ -95,7 +95,7 @@ public class IotaAPI extends IotaAPICore { * @param inclusionStates Optional (default false). If True, it gets the inclusion states of the transfers. * @return Bundle **/ - public GetTransferResponse getTransfers(String seed, int security, Integer start, Integer end, Boolean inclusionStates) throws ArgumentException, InvalidBundleException, InvalidSignatureException, NoNodeInfoException, NoInclusionStatesExcpection, InvalidSecurityLevelException { + public GetTransferResponse getTransfers(String seed, int security, Integer start, Integer end, Boolean inclusionStates) throws ArgumentException, InvalidBundleException, InvalidSignatureException, NoNodeInfoException, NoInclusionStatesExcpection, InvalidSecurityLevelException, InvalidAddressException { StopWatch stopWatch = new StopWatch(); // validate & if needed pad seed if ((seed = InputValidator.validateSeed(seed)) == null) { @@ -113,12 +113,9 @@ public class IotaAPI extends IotaAPICore { } StopWatch sw = new StopWatch(); - System.out.println("GetTransfer started"); GetNewAddressResponse gnr = getNewAddress(seed, security, start, false, end, true); if (gnr != null && gnr.getAddresses() != null) { - System.out.println("GetTransfers after getNewAddresses " + sw.getElapsedTimeMili() + " ms"); Bundle[] bundles = bundlesFromAddresses(gnr.getAddresses().toArray(new String[gnr.getAddresses().size()]), inclusionStates); - System.out.println("GetTransfers after bundlesFromAddresses " + sw.getElapsedTimeMili() + " ms"); return GetTransferResponse.create(bundles, stopWatch.getElapsedTimeMili()); } return GetTransferResponse.create(new Bundle[]{}, stopWatch.getElapsedTimeMili()); @@ -321,11 +318,11 @@ public class IotaAPI extends IotaAPICore { * @param inputs the inputs * @return trytes Returns bundle trytes **/ - public List prepareTransfers(String seed, int security, final List transfers, String remainder, List inputs) throws NotEnoughBalanceException, InvalidSecurityLevelException { + public List prepareTransfers(String seed, int security, final List transfers, String remainder, List inputs) throws NotEnoughBalanceException, InvalidSecurityLevelException, InvalidAddressException, InvalidTransferException { // Input validation of transfers object if (!InputValidator.isTransfersCollectionCorrect(transfers)) { - throw new IllegalStateException("Invalid Transfer"); + throw new InvalidTransferException(); } // validate & if needed pad seed @@ -479,7 +476,7 @@ public class IotaAPI extends IotaAPICore { * @param end end Ending key index * @param threshold threshold Min balance required **/ - public GetBalancesAndFormatResponse getInputs(String seed, int security, int start, int end, long threshold) throws InvalidSecurityLevelException { + public GetBalancesAndFormatResponse getInputs(String seed, int security, int start, int end, long threshold) throws InvalidSecurityLevelException, InvalidAddressException { StopWatch stopWatch = new StopWatch(); // validate the seed if (!InputValidator.isTrytes(seed, 0)) { @@ -725,7 +722,7 @@ public class IotaAPI extends IotaAPICore { * @return array of Transaction objects **/ - public SendTransferResponse sendTransfer(String seed, int security, int depth, int minWeightMagnitude, final List transfers, Input[] inputs, String address) throws NotEnoughBalanceException, InvalidSecurityLevelException, InvalidTrytesException { + public SendTransferResponse sendTransfer(String seed, int security, int depth, int minWeightMagnitude, final List transfers, Input[] inputs, String address) throws NotEnoughBalanceException, InvalidSecurityLevelException, InvalidTrytesException, InvalidAddressException, InvalidTransferException { if (security < 1 || security > 3) { throw new InvalidSecurityLevelException(); @@ -804,12 +801,12 @@ public class IotaAPI extends IotaAPICore { * Prepares transfer by generating the bundle with the corresponding cosigner transactions * Does not contain signatures * - * @param securitySum sum of security levels used by all co-signers - * @param inputAddress array of input addresses as well as the securitySum - * @param remainderAddress Has to be generated by the cosigners before initiating the transfer, can be null if fully spent + * @param securitySum sum of security levels used by all co-signers + * @param inputAddress array of input addresses as well as the securitySum + * @param remainderAddress has to be generated by the cosigners before initiating the transfer, can be null if fully spent * @return bundle of transaction objects **/ - private GetTransferResponse initiateTransfer(int securitySum, final List inputAddress, String remainderAddress, final List transfers) { + private GetTransferResponse initiateTransfer(int securitySum, final List inputAddress, String remainderAddress, final List transfers) throws InvalidAddressException, InvalidBundleException, InvalidTransferException { StopWatch sw = new StopWatch(); @@ -828,19 +825,19 @@ public class IotaAPI extends IotaAPICore { // Input validation of transfers object if (!InputValidator.isTransfersCollectionCorrect(transfers)) { - throw new IllegalStateException("Invalid Transfer"); + throw new InvalidTransferException(); } // validate input address for (String address : inputAddress) { if (!InputValidator.isAddress(address)) - throw new IllegalStateException("Invalid Address"); + throw new InvalidBundleException(); } // validate remainder address if (remainderAddress != null && !InputValidator.isAddress(remainderAddress)) { - throw new IllegalStateException("Invalid Address"); + throw new InvalidBundleException(); } // Create a new bundle @@ -989,7 +986,7 @@ public class IotaAPI extends IotaAPICore { final String tag, final long totalValue, final String remainderAddress, - final List signatureFragments) throws NotEnoughBalanceException, InvalidSecurityLevelException { + final List signatureFragments) throws NotEnoughBalanceException, InvalidSecurityLevelException, InvalidAddressException { long totalTransferValue = totalValue; for (int i = 0; i < inputs.size(); i++) { diff --git a/src/main/java/jota/error/InvalidAddressException.java b/src/main/java/jota/error/InvalidAddressException.java new file mode 100644 index 0000000..442babf --- /dev/null +++ b/src/main/java/jota/error/InvalidAddressException.java @@ -0,0 +1,10 @@ +package jota.error; + +/** + * Created by pinpong on 05.02.17. + */ +public class InvalidAddressException extends BaseException { + public InvalidAddressException() { + super("Invalid Address!"); + } +} diff --git a/src/main/java/jota/error/InvalidTransferException.java b/src/main/java/jota/error/InvalidTransferException.java new file mode 100644 index 0000000..20a6565 --- /dev/null +++ b/src/main/java/jota/error/InvalidTransferException.java @@ -0,0 +1,10 @@ +package jota.error; + +/** + * Created by pinpong on 05.02.17. + */ +public class InvalidTransferException extends BaseException { + public InvalidTransferException() { + super("Invalid Transfer!"); + } +} diff --git a/src/main/java/jota/utils/Checksum.java b/src/main/java/jota/utils/Checksum.java index 1e6a923..bd2e542 100644 --- a/src/main/java/jota/utils/Checksum.java +++ b/src/main/java/jota/utils/Checksum.java @@ -1,5 +1,6 @@ package jota.utils; +import jota.error.InvalidAddressException; import jota.pow.JCurl; /** @@ -13,7 +14,7 @@ public class Checksum { * @param address address without checksum * @return the address with the appended checksum **/ - public static String addChecksum(String address) { + public static String addChecksum(String address) throws InvalidAddressException { InputValidator.checkAddress(address); String addressWithChecksum = address; addressWithChecksum += calculateChecksum(address); @@ -26,11 +27,11 @@ public class Checksum { * @param address address with checksum * @return the address without checksum **/ - public static String removeChecksum(String address) { + public static String removeChecksum(String address) throws InvalidAddressException { if (isAddressWithChecksum(address)) { return getAddress(address); } - throw new RuntimeException("Invalid address: " + address); + throw new InvalidAddressException(); } /** @@ -49,7 +50,7 @@ public class Checksum { * @param addressWithChecksum address * @return boolean **/ - public static boolean isValidChecksum(String addressWithChecksum) { + public static boolean isValidChecksum(String addressWithChecksum) throws InvalidAddressException { String addressWithoutChecksum = removeChecksum(addressWithChecksum); String addressWithRecalculateChecksum = addressWithChecksum += calculateChecksum(addressWithoutChecksum); return addressWithRecalculateChecksum.equals(addressWithChecksum); @@ -62,7 +63,7 @@ public class Checksum { * @param address address * @return boolean **/ - public static boolean isAddressWithChecksum(String address) { + public static boolean isAddressWithChecksum(String address) throws InvalidAddressException { return InputValidator.checkAddress(address) && address.length() == Constants.ADDRESS_LENGTH_WITH_CHECKSUM; } @@ -73,7 +74,7 @@ public class Checksum { * @param address address * @return boolean **/ - public static boolean isAddressWithoutChecksum(String address) { + public static boolean isAddressWithoutChecksum(String address) throws InvalidAddressException { return InputValidator.checkAddress(address) && address.length() == Constants.ADDRESS_LENGTH_WITHOUT_CHECKSUM; } diff --git a/src/main/java/jota/utils/Converter.java b/src/main/java/jota/utils/Converter.java index 283c20b..31628fd 100644 --- a/src/main/java/jota/utils/Converter.java +++ b/src/main/java/jota/utils/Converter.java @@ -90,6 +90,12 @@ public class Converter { return d; } + /** + * Converts trytes into trits + * + * @param trytes trytes to be converted + * @return array of trits + **/ public static int[] trits(final String trytes) { final List trits = new LinkedList<>(); if (InputValidator.isValue(trytes)) { @@ -160,6 +166,14 @@ public class Converter { return destination; } + /** + * Converts trites to trytes + * + * @param trits trits to be converted + * @param offset + * @param size + * @return trytes + **/ public static String trytes(final int[] trits, final int offset, final int size) { StringBuilder trytes = new StringBuilder(); diff --git a/src/main/java/jota/utils/InputValidator.java b/src/main/java/jota/utils/InputValidator.java index b345284..0399602 100644 --- a/src/main/java/jota/utils/InputValidator.java +++ b/src/main/java/jota/utils/InputValidator.java @@ -1,5 +1,6 @@ package jota.utils; +import jota.error.InvalidAddressException; import jota.model.Transfer; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.math.NumberUtils; @@ -28,9 +29,9 @@ public class InputValidator { * @param address address to validate * @return boolean **/ - public static boolean checkAddress(String address) { + public static boolean checkAddress(String address) throws InvalidAddressException { if (!isAddress(address)) { - throw new RuntimeException("Invalid address: " + address); + throw new InvalidAddressException(); } return true; } @@ -70,7 +71,7 @@ public class InputValidator { /** * determines whether the specified string represents a signed integer * - * @param value the value + * @param trytes the trytes * @return boolean **/ public static boolean isArrayOfTrytes(String[] trytes){ @@ -83,6 +84,12 @@ public class InputValidator { return true; } + /** + * checks if input is array of hashes + * + * @param hashes + * @return boolean + **/ public static boolean isArrayOfHashes(String[] hashes) { if (hashes == null) return false; @@ -105,21 +112,26 @@ public class InputValidator { /** * checks if input is correct hash collections * - * @param {array} hash - * @method isTransfersArray - * @returns {boolean} + * @param transfers + * @return boolean **/ public static boolean isTransfersCollectionCorrect(final List transfers) { for (final Transfer transfer : transfers) { - if (!isTransfersArray(transfer)) { + if (!isTransfer(transfer)) { return false; } } return true; } - public static boolean isTransfersArray(final Transfer transfer) { + /** + * checks if input is correct transfer + * + * @param transfer + * @return boolean + **/ + public static boolean isTransfer(final Transfer transfer) { if (!isAddress(transfer.getAddress())) { return false; diff --git a/src/main/java/jota/utils/IotaAPIUtils.java b/src/main/java/jota/utils/IotaAPIUtils.java index adbf974..0fdf9d8 100644 --- a/src/main/java/jota/utils/IotaAPIUtils.java +++ b/src/main/java/jota/utils/IotaAPIUtils.java @@ -1,5 +1,6 @@ package jota.utils; +import jota.error.InvalidAddressException; import jota.model.Bundle; import jota.model.Input; import jota.model.Transaction; @@ -20,13 +21,14 @@ public class IotaAPIUtils { /** * Generates a new address * - * @param seed - * @param index - * @param security - * @param checksum + * @param seed tryte-encoded seed. It should be noted that this seed is not transferred + * @param security security secuirty level of private key / seed + * @param index key index to start search from. If the index is provided, the generation of the address is not deterministic. + * @param checksum adds 9-tryte address checksum + * @param curl * @return an String with address */ - public static String newAddress(String seed, int security, int index, boolean checksum, ICurl curl) { + public static String newAddress(String seed, int security, int index, boolean checksum, ICurl curl) throws InvalidAddressException { Signing signing = new Signing(curl); final int[] key = signing.key(Converter.trits(seed), index, security); final int[] digests = signing.digests(key); diff --git a/src/main/java/jota/utils/IotaUnitConverter.java b/src/main/java/jota/utils/IotaUnitConverter.java index 131fe59..eade784 100644 --- a/src/main/java/jota/utils/IotaUnitConverter.java +++ b/src/main/java/jota/utils/IotaUnitConverter.java @@ -20,6 +20,13 @@ public class IotaUnitConverter { return convertUnits(amountInSource, toUnit); } + /** + * convert unit + * + * @param amount the amount + * @param toUnit the target unit + * @return the specified amount in the target unit + **/ private static long convertUnits(long amount, IotaUnits toUnit) { return (long) (amount / Math.pow(10, toUnit.getValue())); } @@ -37,16 +44,38 @@ public class IotaUnitConverter { return createAmountWithUnitDisplayText(amountInDisplayUnit, unit, extended); } + /** + * convert amount to target unit + * + * @param amount the amount + * @return the target unit + **/ public static double convertAmountTo(long amount, IotaUnits target) { return amount / Math.pow(10, target.getValue()); } + /** + * create amount with unit text + * + * @param amountInUnit the amount in units + * @param unit the unit + * @param extended extended length + * @return the target unit + **/ private static String createAmountWithUnitDisplayText(double amountInUnit, IotaUnits unit, boolean extended) { String result = createAmountDisplayText(amountInUnit, unit, extended); result += " " + unit.getUnit(); return result; } + /** + * create amount text + * + * @param amountInUnit the amount in units + * @param unit the unit + * @param extended extended length + * @return the target unit + **/ public static String createAmountDisplayText(double amountInUnit, IotaUnits unit, boolean extended) { DecimalFormat df; if (extended) df = new DecimalFormat("##0.##################"); diff --git a/src/main/java/jota/utils/Multisig.java b/src/main/java/jota/utils/Multisig.java index 8623064..686dc26 100644 --- a/src/main/java/jota/utils/Multisig.java +++ b/src/main/java/jota/utils/Multisig.java @@ -24,17 +24,14 @@ public class Multisig { } /** - * Gets the digest value of a seed - * - * @param {string} seed - * @param {int} index - * @param {int} security - * @method getDigest - * @returns {string} digest trytes + * @param seed tryte-encoded seed. It should be noted that this seed is not transferred + * @param security security secuirty level of private key / seed + * @param index + * @return digest trytes **/ - private String getDigest(String seed, int index, int security) { + private String getDigest(String seed, int security, int index) { - int[] key = signingInstance.key(Converter.trits(seed), index, security); + int[] key = signingInstance.key(Converter.trits(seed), security, index); return Converter.trytes(signingInstance.digests(key)); } @@ -44,7 +41,7 @@ public class Multisig { * @param digestTrytes * @param curlStateTrytes * @method addAddressDigest - * @returns {String} + * @return digest trytes **/ private String addAddressDigest(String digestTrytes, String curlStateTrytes, ICurl customCurl) { @@ -70,10 +67,9 @@ public class Multisig { /** * Gets the key value of a seed * - * @param {string} seed - * @param {int} index - * @method getKey - * @returns {string} digest trytes + * @param seed tryte-encoded seed. It should be noted that this seed is not transferred + * @param index + * @return digest trytes **/ private String getKey(String seed, int index, int security) { @@ -84,10 +80,9 @@ public class Multisig { /** * Generates a new address * - * @param {string} curlStateTrytes - * @param {string} - * @method finalizeAddress - * @returns {String} address + * @param curlStateTrytes + * @param customCurl + * @return address **/ private String finalizeAddress(String curlStateTrytes, ICurl customCurl) { @@ -108,8 +103,8 @@ public class Multisig { * * @param multisigAddress * @param digests - * @method validateAddress - * @returns {bool} + * @param customCurl + * @returns boolean **/ private boolean validateAddress(String multisigAddress, int[][] digests, ICurl customCurl) { @@ -131,13 +126,10 @@ public class Multisig { /** * Adds the cosigner signatures to the corresponding bundle transaction * - * @param {array} bundleToSign - * @param {int} cosignerIndex - * @param {string} inputAddress - * @param {string} key - * @param {function} callback - * @method addSignature - * @returns {array} trytes Returns bundle trytes + * @param bundleToSign + * @param inputAddress + * @param keyTrytes + * @return trytes Returns bundle trytes **/ private void addSignature(Bundle[] bundleToSign, String inputAddress, String keyTrytes) { diff --git a/src/test/java/jota/ChecksumTest.java b/src/test/java/jota/ChecksumTest.java index 1413f69..d6af06a 100644 --- a/src/test/java/jota/ChecksumTest.java +++ b/src/test/java/jota/ChecksumTest.java @@ -1,5 +1,6 @@ package jota; +import jota.error.InvalidAddressException; import jota.utils.Checksum; import org.junit.Test; @@ -14,17 +15,17 @@ public class ChecksumTest { private static final String TEST_ADDRESS_WITH_CHECKSUM = "RVORZ9SIIP9RCYMREUIXXVPQIPHVCNPQ9HZWYKFWYWZRE9JQKG9REPKIASHUUECPSQO9JT9XNMVKWYGVAFOXM9MUBX"; @Test - public void shouldAddChecksum() { + public void shouldAddChecksum() throws InvalidAddressException { assertEquals(Checksum.addChecksum(TEST_ADDRESS_WITHOUT_CHECKSUM), TEST_ADDRESS_WITH_CHECKSUM); } @Test - public void shouldRemoveChecksum() { + public void shouldRemoveChecksum() throws InvalidAddressException { assertEquals(Checksum.removeChecksum(TEST_ADDRESS_WITH_CHECKSUM), TEST_ADDRESS_WITHOUT_CHECKSUM); } @Test - public void shouldIsValidChecksum() { + public void shouldIsValidChecksum() throws InvalidAddressException { assertEquals(Checksum.isValidChecksum(TEST_ADDRESS_WITH_CHECKSUM), true); } } diff --git a/src/test/java/jota/InputValidatorTest.java b/src/test/java/jota/InputValidatorTest.java index c41b4bd..502ab47 100644 --- a/src/test/java/jota/InputValidatorTest.java +++ b/src/test/java/jota/InputValidatorTest.java @@ -1,5 +1,6 @@ package jota; +import jota.error.InvalidAddressException; import jota.model.Transfer; import jota.utils.InputValidator; import org.junit.Test; @@ -27,7 +28,7 @@ public class InputValidatorTest { } @Test - public void shouldCheckAddress() { + public void shouldCheckAddress() throws InvalidAddressException { assertEquals(InputValidator.checkAddress(TEST_ADDRESS_WITHOUT_CHECKSUM), true); } diff --git a/src/test/java/jota/IotaAPITest.java b/src/test/java/jota/IotaAPITest.java index 3a4bee5..fc75695 100644 --- a/src/test/java/jota/IotaAPITest.java +++ b/src/test/java/jota/IotaAPITest.java @@ -75,7 +75,7 @@ public class IotaAPITest { @Test - public void shouldGetInputs() throws InvalidSecurityLevelException { + public void shouldGetInputs() throws InvalidSecurityLevelException, InvalidAddressException { GetBalancesAndFormatResponse res = iotaClient.getInputs(TEST_SEED1, 2, 0, 0, 0); System.out.println(res); assertThat(res, IsNull.notNullValue()); @@ -85,7 +85,7 @@ public class IotaAPITest { } @Test - public void shouldCreateANewAddressWithoutChecksum() throws InvalidSecurityLevelException { + public void shouldCreateANewAddressWithoutChecksum() throws InvalidSecurityLevelException, InvalidAddressException { final GetNewAddressResponse res1 = iotaClient.getNewAddress(TEST_SEED1, 1, 0, false, 5, false); assertThat(res1.getAddresses().get(0), Is.is(TEST_ADDRESS_WITHOUT_CHECKSUM_SECURITY_LEVEL_1)); @@ -97,16 +97,11 @@ public class IotaAPITest { } @Test - public void shouldPrepareTransfer() throws InvalidSecurityLevelException { + public void shouldPrepareTransfer() throws InvalidSecurityLevelException, NotEnoughBalanceException, InvalidAddressException, InvalidTransferException { List transfers = new ArrayList<>(); transfers.add(new jota.model.Transfer(TEST_ADDRESS_WITHOUT_CHECKSUM_SECURITY_LEVEL_2, 0, TEST_MESSAGE, TEST_TAG)); transfers.add(new jota.model.Transfer(TEST_ADDRESS_WITHOUT_CHECKSUM_SECURITY_LEVEL_2, 1, TEST_MESSAGE, TEST_TAG)); - List trytes = null; - try { - trytes = iotaClient.prepareTransfers(TEST_SEED1, 2, transfers, null, null); - } catch (NotEnoughBalanceException e) { - e.printStackTrace(); - } + List trytes = iotaClient.prepareTransfers(TEST_SEED1, 2, transfers, null, null); Assert.assertNotNull(trytes); assertThat(trytes.isEmpty(), Is.is(false)); } @@ -136,7 +131,7 @@ public class IotaAPITest { } @Test - public void shouldGetTransfers() throws InvalidBundleException, ArgumentException, InvalidSignatureException, NoInclusionStatesExcpection, NoNodeInfoException, InvalidSecurityLevelException { + public void shouldGetTransfers() throws InvalidBundleException, ArgumentException, InvalidSignatureException, NoInclusionStatesExcpection, NoNodeInfoException, InvalidSecurityLevelException, InvalidAddressException { GetTransferResponse gtr = iotaClient.getTransfers(TEST_SEED1, 2, 0, 0, false); assertThat(gtr.getTransfers(), IsNull.notNullValue()); @@ -159,17 +154,17 @@ public class IotaAPITest { iotaClient.sendTrytes(new String[]{TEST_TRYTES}, 9, 18); } + @Ignore @Test(expected = IllegalStateException.class) - public void shouldNotSendTransfer() throws ArgumentException, InvalidSignatureException, InvalidBundleException, NotEnoughBalanceException, InvalidSecurityLevelException, InvalidTrytesException { + public void shouldNotSendTransfer() throws ArgumentException, InvalidSignatureException, InvalidBundleException, NotEnoughBalanceException, InvalidSecurityLevelException, InvalidTrytesException, InvalidAddressException, InvalidTransferException { List transfers = new ArrayList<>(); transfers.add(new jota.model.Transfer(TEST_ADDRESS_WITHOUT_CHECKSUM_SECURITY_LEVEL_2, 10000990, "JUSTANOTHERTEST", TEST_TAG)); SendTransferResponse str = iotaClient.sendTransfer(TEST_SEED2, 2, 9, 18, transfers, null, null); assertThat(str.getSuccessfully(), IsNull.notNullValue()); } - @Ignore @Test - public void shouldSendTransfer() throws ArgumentException, InvalidSignatureException, InvalidBundleException, NotEnoughBalanceException, InvalidSecurityLevelException, InvalidTrytesException { + public void shouldSendTransfer() throws ArgumentException, InvalidSignatureException, InvalidBundleException, NotEnoughBalanceException, InvalidSecurityLevelException, InvalidTrytesException, InvalidAddressException, InvalidTransferException { List transfers = new ArrayList<>(); transfers.add(new jota.model.Transfer(TEST_ADDRESS_WITHOUT_CHECKSUM_SECURITY_LEVEL_2, 0, "JUSTANOTHERTEST", TEST_TAG)); SendTransferResponse str = iotaClient.sendTransfer(TEST_SEED2, 2, 9, 18, transfers, null, null); From ecf1e5d58f816fde67e2bf2ae3ecbd53c35614fe Mon Sep 17 00:00:00 2001 From: pinpong Date: Sun, 5 Feb 2017 20:03:20 +0100 Subject: [PATCH 14/45] fixed small extension --- src/main/java/jota/IotaAPICore.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/jota/IotaAPICore.java b/src/main/java/jota/IotaAPICore.java index 961898e..51524a1 100644 --- a/src/main/java/jota/IotaAPICore.java +++ b/src/main/java/jota/IotaAPICore.java @@ -168,7 +168,7 @@ public class IotaAPICore { } public GetAttachToTangleResponse attachToTangle(String trunkTransaction, String branchTransaction, Integer minWeightMagnitude, String... trytes) throws InvalidTrytesException { - if(InputValidator.isArrayOfTrytes(trytes)){ + if(!InputValidator.isArrayOfTrytes(trytes)){ throw new InvalidTrytesException(); } From 3dc4682b4c3d7a37907f3e08d1c9c968b19009df Mon Sep 17 00:00:00 2001 From: pinpong Date: Sun, 5 Feb 2017 20:25:36 +0100 Subject: [PATCH 15/45] more tests --- src/test/java/jota/ChecksumTest.java | 2 +- src/test/java/jota/IotaAPITest.java | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/test/java/jota/ChecksumTest.java b/src/test/java/jota/ChecksumTest.java index d6af06a..f2b950d 100644 --- a/src/test/java/jota/ChecksumTest.java +++ b/src/test/java/jota/ChecksumTest.java @@ -18,7 +18,7 @@ public class ChecksumTest { public void shouldAddChecksum() throws InvalidAddressException { assertEquals(Checksum.addChecksum(TEST_ADDRESS_WITHOUT_CHECKSUM), TEST_ADDRESS_WITH_CHECKSUM); } - + @Test public void shouldRemoveChecksum() throws InvalidAddressException { assertEquals(Checksum.removeChecksum(TEST_ADDRESS_WITH_CHECKSUM), TEST_ADDRESS_WITHOUT_CHECKSUM); diff --git a/src/test/java/jota/IotaAPITest.java b/src/test/java/jota/IotaAPITest.java index fc75695..e3c9a3a 100644 --- a/src/test/java/jota/IotaAPITest.java +++ b/src/test/java/jota/IotaAPITest.java @@ -124,7 +124,7 @@ public class IotaAPITest { assertThat(gbr, IsNull.notNullValue()); } - @Test + @Test(expected = ArgumentException.class) public void shouldGetBundle() throws InvalidBundleException, ArgumentException, InvalidSignatureException { GetBundleResponse gbr = iotaClient.getBundle(TEST_HASH); assertThat(gbr, IsNull.notNullValue()); @@ -142,6 +142,13 @@ public class IotaAPITest { } } + @Ignore + @Test + public void shouldReplayBundle() throws InvalidTrytesException, InvalidBundleException, InvalidSignatureException, ArgumentException { + ReplayBundleResponse rbr = iotaClient.replayBundle(TEST_TRYTES, 9, 18); + assertThat(rbr, IsNull.notNullValue()); + } + @Ignore @Test(expected = InvalidTrytesException.class) public void shouldNotSendTrytes() throws InvalidTrytesException { @@ -163,6 +170,7 @@ public class IotaAPITest { assertThat(str.getSuccessfully(), IsNull.notNullValue()); } + @Ignore @Test public void shouldSendTransfer() throws ArgumentException, InvalidSignatureException, InvalidBundleException, NotEnoughBalanceException, InvalidSecurityLevelException, InvalidTrytesException, InvalidAddressException, InvalidTransferException { List transfers = new ArrayList<>(); From 90ac1071eeb5450800e8423d6d3aa432d6d46373 Mon Sep 17 00:00:00 2001 From: adrianziser Date: Sun, 12 Feb 2017 17:53:12 +0100 Subject: [PATCH 16/45] always clone curl instance --- src/main/java/jota/IotaAPI.java | 40 +++++++++++++++----------- src/main/java/jota/pow/ICurl.java | 10 ++++--- src/main/java/jota/pow/JCurl.java | 5 ++++ src/main/java/jota/utils/Multisig.java | 4 +-- 4 files changed, 37 insertions(+), 22 deletions(-) diff --git a/src/main/java/jota/IotaAPI.java b/src/main/java/jota/IotaAPI.java index 73a00e9..09eaf94 100644 --- a/src/main/java/jota/IotaAPI.java +++ b/src/main/java/jota/IotaAPI.java @@ -61,7 +61,7 @@ public class IotaAPI extends IotaAPICore { // and return the list of all addresses if (total != 0) { for (int i = index; i < index + total; i++) { - allAddresses.add(IotaAPIUtils.newAddress(seed, security, i, checksum, customCurl)); + allAddresses.add(IotaAPIUtils.newAddress(seed, security, i, checksum, customCurl.clone())); } return GetNewAddressResponse.create(allAddresses, stopWatch.getElapsedTimeMili()); } @@ -69,7 +69,7 @@ public class IotaAPI extends IotaAPICore { // already created if null, return list of addresses for (int i = index; ; i++) { - final String newAddress = IotaAPIUtils.newAddress(seed, security, i, checksum, customCurl); + final String newAddress = IotaAPIUtils.newAddress(seed, security, i, checksum, customCurl.clone()); final FindTransactionResponse response = findTransactionsByAddresses(newAddress); allAddresses.add(newAddress); @@ -245,7 +245,7 @@ public class IotaAPI extends IotaAPICore { final List trx = new ArrayList<>(); for (final String tryte : Arrays.asList(res.getTrytes())) { - trx.add(new Transaction(tryte, customCurl)); + trx.add(new Transaction(tryte, customCurl.clone())); } return trx; } @@ -269,7 +269,7 @@ public class IotaAPI extends IotaAPICore { final List trxs = new ArrayList<>(); for (final String tryte : trytesResponse.getTrytes()) { - trxs.add(new Transaction(tryte, customCurl)); + trxs.add(new Transaction(tryte, customCurl.clone())); } return trxs; } @@ -453,7 +453,7 @@ public class IotaAPI extends IotaAPICore { } else { // If no input required, don't sign and simply finalize the bundle - bundle.finalize(customCurl); + bundle.finalize(customCurl.clone()); bundle.addTrytes(signatureFragments); List trxb = bundle.getTransactions(); @@ -508,7 +508,7 @@ public class IotaAPI extends IotaAPICore { for (int i = start; i < end; i++) { - String address = IotaAPIUtils.newAddress(seed, security, i, false, customCurl); + String address = IotaAPIUtils.newAddress(seed, security, i, false, customCurl.clone()); allAddresses.add(address); } @@ -764,7 +764,7 @@ public class IotaAPI extends IotaAPICore { throw new ArgumentException("Bundle transactions not visible"); } - Transaction trx = new Transaction(gtr.getTrytes()[0], customCurl); + Transaction trx = new Transaction(gtr.getTrytes()[0], customCurl.clone()); if (trx.getBundle() == null) { throw new ArgumentException("Invalid trytes, could not create object"); } @@ -925,7 +925,7 @@ public class IotaAPI extends IotaAPICore { // Add input as bundle entry // Only a single entry, signatures will be added later - // TODO: fill in the right address + // TODO: unfinished stuff bundle.addEntry(securitySum, "", toSubtract, tag, timestamp); } @@ -947,13 +947,21 @@ public class IotaAPI extends IotaAPICore { bundle.addEntry(1, remainderAddress, remainder, tag, timestamp); } - - - bundle.finalize(customCurl); + // TODO: unfinished stuff + /* + bundle.finalize(customCurl.clone()); bundle.addTrytes(signatureFragments); - return GetTransferResponse.create(new Bundle[]{}, sw.getElapsedTimeMili()); + List trxb = bundle.getTransactions(); + List bundleTrytes = new ArrayList<>(); + for (Transaction trx : trxb) { + bundleTrytes.add(trx.toTrytes()); + } + + return GetTransferResponse.create(bundle.getTransactions(), sw.getElapsedTimeMili()); + */ + return null; } else { @@ -971,7 +979,7 @@ public class IotaAPI extends IotaAPICore { throw new ArgumentException("Bundle transactions not visible"); } - Transaction trx = new Transaction(gtr.getTrytes()[0], customCurl); + Transaction trx = new Transaction(gtr.getTrytes()[0], customCurl.clone()); if (trx.getBundle() == null) { throw new ArgumentException("Invalid trytes, could not create object"); } @@ -1008,7 +1016,7 @@ public class IotaAPI extends IotaAPICore { // Remainder bundle entry bundle.addEntry(1, remainderAddress, remainder, tag, timestamp); // Final function for signing inputs - return IotaAPIUtils.signInputsAndReturn(seed, inputs, bundle, signatureFragments, customCurl); + return IotaAPIUtils.signInputsAndReturn(seed, inputs, bundle, signatureFragments, customCurl.clone()); } else if (remainder > 0) { // Generate a new Address by calling getNewAddress @@ -1017,11 +1025,11 @@ public class IotaAPI extends IotaAPICore { bundle.addEntry(1, res.getAddresses().get(0), remainder, tag, timestamp); // Final function for signing inputs - return IotaAPIUtils.signInputsAndReturn(seed, inputs, bundle, signatureFragments, customCurl); + return IotaAPIUtils.signInputsAndReturn(seed, inputs, bundle, signatureFragments, customCurl.clone()); } else { // If there is no remainder, do not add transaction to bundle // simply sign and return - return IotaAPIUtils.signInputsAndReturn(seed, inputs, bundle, signatureFragments, customCurl); + return IotaAPIUtils.signInputsAndReturn(seed, inputs, bundle, signatureFragments, customCurl.clone()); } // If multiple inputs provided, subtract the totalTransferValue by diff --git a/src/main/java/jota/pow/ICurl.java b/src/main/java/jota/pow/ICurl.java index 9534837..877a16d 100644 --- a/src/main/java/jota/pow/ICurl.java +++ b/src/main/java/jota/pow/ICurl.java @@ -4,19 +4,21 @@ package jota.pow; * Created by Adrian on 07.01.2017. */ public interface ICurl { - JCurl absorb(final int[] trits, int offset, int length); + ICurl absorb(final int[] trits, int offset, int length); - JCurl absorb(final int[] trits); + ICurl absorb(final int[] trits); int[] squeeze(final int[] trits, int offset, int length); int[] squeeze(final int[] trits); - JCurl transform(); + ICurl transform(); - JCurl reset(); + ICurl reset(); int[] getState(); void setState(int[] state); + + ICurl clone(); } diff --git a/src/main/java/jota/pow/JCurl.java b/src/main/java/jota/pow/JCurl.java index f4ba2ff..f08a537 100644 --- a/src/main/java/jota/pow/JCurl.java +++ b/src/main/java/jota/pow/JCurl.java @@ -73,4 +73,9 @@ public class JCurl implements ICurl { public void setState(int[] state) { this.state = state; } + + @Override + public ICurl clone() { + return new JCurl(); + } } diff --git a/src/main/java/jota/utils/Multisig.java b/src/main/java/jota/utils/Multisig.java index 686dc26..4456d1d 100644 --- a/src/main/java/jota/utils/Multisig.java +++ b/src/main/java/jota/utils/Multisig.java @@ -16,11 +16,11 @@ public class Multisig { public Multisig(ICurl customCurl) { this.curl = customCurl; - this.signingInstance = new Signing(curl); + this.signingInstance = new Signing(curl.clone()); } public Multisig() { - this.curl = new JCurl(); + this(new JCurl()); } /** From b815130d6067cada092c4083b083c6796c8bbb2a Mon Sep 17 00:00:00 2001 From: adrianziser Date: Sun, 12 Feb 2017 18:23:43 +0100 Subject: [PATCH 17/45] github release key added --- .travis.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 964491c..9629607 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,10 +4,9 @@ jdk: script: mvn package deploy: provider: releases - file_glob: true - file: "/home/travis/build/iotaledger/iota.lib.java/target/jota*.jar" - skip_cleanup: true + api_key: + secure: YR8aDGTciBNQgI8GU5DSSm6dzKyZhgmixewIMkbjwrGkdLs/UnD2cfMh2ziNuivpmnIDj2rCMmf6gr1PhQno5nsPPrrFcJs0tIv2LAvAAJst/k32zMK3wv1x54eaTS3SK9VxUdAcnB0N3RvMKLiaqkwTcxa4PY9pWlHnZdc8h9oCqr7JAq8NH/94Ri4AiUc7hDgu6xnZNDqll6gJwdM8kUPQuUsAkkAl2dBVfqB7OeQFkmTvl6Hi5WCn9zbpBpKxE4t/SbgZvH5ccVBKOZveFG38/Mm1ur6VHQ8WvZFnEHps+aq8Sjz8irzcdGHC/hSGvMfsB2LRZHKd8KaRcSCypzuBjNt+ayEaaCd4AcNIsR/cEtC9aOzttNhS6eX4YpdaDjmvlqChjKvR+reKVXK7rb6Z08vHkJC1HOofovfjBP0RXT/O1CsUTpPS0lpNfrNZ0n0GfaHqtqxYrGDsXMFIHX5v39fqwAF2pmpJQaB3CeSLpEM7YbNcPlPRQ/w4XZ5SEN1ENS6a8oenOL+IZNMyspTywG3vQgdc82W5MhjFpUawrReeWd6y5xrHiWBLVPJGsgJQPIY0MkuAGiIGqiT8hSW8x8frYhX9IZ7/x4My6PYL8pCv+zn2V8LBr5KCtjVf3sGrxftlt1eLvQHkw290yRUgcfTAd2Dj8lk8H+jYgXA= + file: jota*.jar on: - tags: true repo: iotaledger/iota.lib.java - all_branches: true + branch: dev From 3d6e0e52c00a25d685e5f691fd7636da2292a907 Mon Sep 17 00:00:00 2001 From: adrianziser Date: Sun, 12 Feb 2017 19:17:31 +0100 Subject: [PATCH 18/45] Build *add javadoc & source *sign releases --- .travis.yml | 23 +++++++++++++--- codesigning.asc.enc | Bin 0 -> 9677 bytes pom.xml | 63 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 83 insertions(+), 3 deletions(-) create mode 100644 codesigning.asc.enc diff --git a/.travis.yml b/.travis.yml index 9629607..7c30b48 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,12 +1,29 @@ language: java + jdk: - oraclejdk8 -script: mvn package + +before_install: +- openssl aes-256-cbc -K $encrypted_943593fe7585_key -iv $encrypted_943593fe7585_iv -in codesigning.asc.enc -out codesigning.asc -d + +before_script: gpg --fast-import codesigning.asc + +script: mvn package -P build-extras + deploy: provider: releases api_key: secure: YR8aDGTciBNQgI8GU5DSSm6dzKyZhgmixewIMkbjwrGkdLs/UnD2cfMh2ziNuivpmnIDj2rCMmf6gr1PhQno5nsPPrrFcJs0tIv2LAvAAJst/k32zMK3wv1x54eaTS3SK9VxUdAcnB0N3RvMKLiaqkwTcxa4PY9pWlHnZdc8h9oCqr7JAq8NH/94Ri4AiUc7hDgu6xnZNDqll6gJwdM8kUPQuUsAkkAl2dBVfqB7OeQFkmTvl6Hi5WCn9zbpBpKxE4t/SbgZvH5ccVBKOZveFG38/Mm1ur6VHQ8WvZFnEHps+aq8Sjz8irzcdGHC/hSGvMfsB2LRZHKd8KaRcSCypzuBjNt+ayEaaCd4AcNIsR/cEtC9aOzttNhS6eX4YpdaDjmvlqChjKvR+reKVXK7rb6Z08vHkJC1HOofovfjBP0RXT/O1CsUTpPS0lpNfrNZ0n0GfaHqtqxYrGDsXMFIHX5v39fqwAF2pmpJQaB3CeSLpEM7YbNcPlPRQ/w4XZ5SEN1ENS6a8oenOL+IZNMyspTywG3vQgdc82W5MhjFpUawrReeWd6y5xrHiWBLVPJGsgJQPIY0MkuAGiIGqiT8hSW8x8frYhX9IZ7/x4My6PYL8pCv+zn2V8LBr5KCtjVf3sGrxftlt1eLvQHkw290yRUgcfTAd2Dj8lk8H+jYgXA= - file: jota*.jar + file_glob: true + file: + - "/home/travis/build/iotaledger/iota.lib.jota/target/jota*.jar" + - "/home/travis/build/iotaledger/iota.lib.jota/target/jota*.jar.asc" + - "/home/travis/build/iotaledger/iota.lib.jota/target/jota*-sources.jar" + - "/home/travis/build/iotaledger/iota.lib.jota/target/jota*-sources.jar.asc" + - "/home/travis/build/iotaledger/iota.lib.jota/target/jota*-javadoc.jar" + - "/home/travis/build/iotaledger/iota.lib.jota/target/jota*-javadoc.jar.asc" + skip_cleanup: true on: + tags: true repo: iotaledger/iota.lib.java - branch: dev + all_branches: true diff --git a/codesigning.asc.enc b/codesigning.asc.enc new file mode 100644 index 0000000000000000000000000000000000000000..938a0f56743955083cc526e8de17859975dff513 GIT binary patch literal 9677 zcmV;;B{JI4CDdh5#M9UT1xRSZwzuXcNu`)NvYL?jOpa)XO>!WIMI@?HoATXNa^93- z@MCV8y1`l~6$#g+qJIllqW(>iTT&!F&d#%eG0Ilm_4~6cxp!{oWcw4Rhz5nW4<-M; zT-m_MiOHTFm@kv?m^{WW1CgsBlVAJe8g|8K&U(G&+zl;b$$Yx6b;b-Wq!`~->Y}gk zrf%Uc(eSRyC+iKdSs%oybv>6~#EaS+M+-kc=aj$2D$ADpM@H0`l< z5vTkRwwSaH@nfp=8A zCNnZr91l8b3{@1b-*T=P#z5soILUJdQ!?#GPr5z(tAQ2m_H@;4YH2x19n?;#@WbmI z2JEngtE0JfxjTfeIEo2e#-jw47|zCvsTr*dKTaAeg#KNp?@6dV&;6>&8+(_qL*Iz+ zj}p_mw%PcNCT5;B)AC6WSXkVdjFrItyUY{~CK-6bc>{~;>XWEiON{IN7$AIPJ*j+@ zCZW4v zUDOWN5a+@R_H2iOQdsLGjkG>i|Id&rd%lCmkz9Ib#OQXmDEkmw6knu7U>R2M{^m&? z95voLqc#lh_Z>=`cX*vhTxl$MpEpT!i8uuf3P|*oOk*S9hKV{#yh=*jDv2Pn1%GuT z>=01?>mo7t*Imalgl*S!clS)ou-3yqVL4eGn27-E;H~KqH5fSUTjF=9cYTbCaRRUm zvcu#8{n~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|o%%ps&WQZ65FH)xGX8_E++QP@*@>1@2Bv z_*IbX0kU6TkGCl5Y11^=J{>iaTW4->#N%uZAiI5*)1 z3+T5bOEUjz=cqnH$h~fu2)D~*-f{A z?uXMBrw+@Rgb(=Nk{mPjDyq>G>MKC&Y0p1|0$2`MYIZCy&|1a-q@eb(o_lT+WNM?_ z0UrO@$_pBmZxY;k7_Vl^6>DL5pVO`rr`(+HeQ zBrVn$$P$d|2&+580y1_t?e`e0@sY8JcxzZjrb-?vCoBDgxYXT;z&kx%Pc(v&NvL*p zCkr=Re&;m4JdvXXcv7qWZ@&Q!?30vtdlXdrxCX-G|IGppL1?TEjj}5Q4vs=z&QKC_ zyrloDMYw<{bQ4;==X%k23(L?OR|O3s;CAVl=eX;juj5g)JEOwTG3SN(mR`)ejq!h9 P0+WCFxjJ8fnr$9rK;g)! literal 0 HcmV?d00001 diff --git a/pom.xml b/pom.xml index 6d1e3b2..dd03548 100644 --- a/pom.xml +++ b/pom.xml @@ -111,4 +111,67 @@ + + + + build-extras + + + build + full + + + + ${env.GPG_KEYNAME} + ${env.GPG_PASSPHRASE} + + + + + org.apache.maven.plugins + maven-source-plugin + + + attach-sources + + jar + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.10.4 + + private + true + + + + attach-javadocs + + jar + + + + + + org.apache.maven.plugins + maven-gpg-plugin + 1.6 + + + sign-artifacts + package + + sign + + + + + + + + From 2869c227b72041f3f3c054ab3d4c228fcd88cd66 Mon Sep 17 00:00:00 2001 From: adrianziser Date: Sun, 12 Feb 2017 20:08:31 +0100 Subject: [PATCH 19/45] travis cfg updated --- .travis.yml | 8 ++------ codesigning.asc.enc | Bin 9677 -> 9648 bytes 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7c30b48..3ce7e7e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,15 +1,11 @@ language: java - jdk: - oraclejdk8 - before_install: -- openssl aes-256-cbc -K $encrypted_943593fe7585_key -iv $encrypted_943593fe7585_iv -in codesigning.asc.enc -out codesigning.asc -d - +- openssl aes-256-cbc -K $encrypted_404912dc11ca_key -iv $encrypted_404912dc11ca_iv + -in codesigning.asc.enc -out codesigning.asc -d before_script: gpg --fast-import codesigning.asc - script: mvn package -P build-extras - deploy: provider: releases api_key: diff --git a/codesigning.asc.enc b/codesigning.asc.enc index 938a0f56743955083cc526e8de17859975dff513..9075dd00d8f973478ee73d1f4524e135b7c05e8e 100644 GIT binary patch literal 9648 zcmV;hB~RL|ePFr*(HoD0=$l=sONt>dR#X)h4C)Hc=X0(j#-ZK5L)!?h6(Az2sT-&6 zpKq?a@*t4A_hu07W+%f@;Z{S@xkNdnh+tZ^GvvNK4NU)7Nel;{Ji`Y%8=7ek-gb~| z%t~xphTUR(x4XSr|NXa>pCh~L(E|W4@Gp&uUuz8Zw|6i4wiN7M(cxU}=X%a%9{|$z z`RwDviuZ0sYDi{E2yWc>Cb7rf4v*%i#Rpby(U}M{RT>`5k`WnQ0mHj(fzP0YtIerT zbS<+CO2bE>Dh0vgKN(Ppyl8>SI(QKG53S{>9-e<}vz9nuQnEeZ1%2NBE;o}e9T#P1`zVlZF-tW>G7>Gg{9CDj)I{Gl0R zDrPxTxzF-Sh2FGr%D@MN+Y5>3H2_c->&VVExcn`NbV`yL_wYEVrEaWQAuEcwPhES` ztcbfl`DTS4EleB{ednL=a%aAlfj{FEQ;2#LQB1NnoM(tT9I<<14KTQ+HZCKz0ptwDI#6J;BED6?aAENkoRVND2DvoLhac?txL@)7)-8@aqJwbH`1%62cEf!)9- zuOI2?c8gmI1Mpw2{xm<<^(__x&hy0LHEkNJ8L*G%z)5&a`jl}Kec?`MFZL03Yd1x2 z+rCI!87vu@4v(4r`+B?Py=^GP@Xv)7mBh2uZAotM zI7xR20^SN%+1WYB-aAq|lE1B3BX_ut$n1M9X-DN$X>olVT@ZB2$HUCu&XfBt{EKr) z83CCt^*yWh&Bl)n5#xl<*h>it9zE8K8M1eUxCcB2*jtoWNQt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@yPAP>;FBA)myi<#_DqK+k?^8zz z?oyF~=j#Z@=`dabLuJv z@q_LGrD`KZNrvtBZtIUtj0s`+LUOV(V!$7x4@oP$h!M`xPBOU2z?^ZsUrham7uW}GJy*VPX!vB7QYf(vCdNS(3Dft)DT*sbxw zpT5pMA<(Uoj$I!ui$|phNBJLB?s~@fD|o%%ps&WQZ65FH)xGX8_E++QP@*@>1@2Bv z_*IbX0kU6TkGCl5Y11^=J{>iaTW4->#N%uZAiI5*)1 z3+T5bOEUjz=cqnH$h~fu2)D~*-f{A z?uXMBrw+@Rgb(=Nk{mPjDyq>G>MKC&Y0p1|0$2`MYIZCy&|1a-q@eb(o_lT+WNM?_ z0UrO@$_pBmZxY;k7_Vl^6>DL5pVO`rr`(+HeQ zBrVn$$P$d|2&+580y1_t?e`e0@sY8JcxzZjrb-?vCoBDgxYXT;z&kx%Pc(v&NvL*p zCkr=Re&;m4JdvXXcv7qWZ@&Q!?30vtdlXdrxCX-G|IGppL1?TEjj}5Q4vs=z&QKC_ zyrloDMYw<{bQ4;==X%k23(L?OR|O3s;CAVl=eX;juj5g)JEOwTG3SN(mR`)ejq!h9 P0+WCFxjJ8fnr$9rK;g)! From 1f488ff8970497f74ced1819b894d19f0be77fce Mon Sep 17 00:00:00 2001 From: adrianziser Date: Sun, 12 Feb 2017 20:18:09 +0100 Subject: [PATCH 20/45] once again --- codesigning.asc.enc | Bin 9648 -> 9648 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/codesigning.asc.enc b/codesigning.asc.enc index 9075dd00d8f973478ee73d1f4524e135b7c05e8e..71f4417725d25eaa1d3dc2b9bed7768356ae69c7 100644 GIT binary patch literal 9648 zcmV;hB~RK3E~MgqV;x@Idyw*IXw2`0oiS?{J;86;)okHjRr$Ay0P|R#&NRbxuK$A$ z%#pb}e&w$1U<`g$#GGXHd&!y97wiQBf5fBkrC)?2Gv*5kqz9#BW1Q76;9QR_KVIEW z)nbwL_wUSQm{$cA&^Gg_A7g^KGLf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^GZZlgHpyY-3a5)JyC=Dx^8Pwge zly1aUEYdu~gZmX|cTS;izPaHRmzhCqZ4S4crT^4=5j$rB5{;zJjauj9eq>YvjgWp* zH(|HFJl1DLomh2OTS&t;mk1xOQ&Hch3QaS#5{micFtE#-y|dQ5dGUZTp23ZajipUV zmKjn#{cD01c|s66l$7|L33oRa##rRxU`YjZ&}vv)oT3t49Qz#!N?R7I&K<}aQIRZM zE6cDIR8eQioa;17_&gI4tu>ivr_G2{l5QnuVO3c1(7p;XXaZA($!3c@Y-P;u@B$9s zE95k+LLVEYoy3Se&*#_vB7=VfU|ae#Sl3-?=$)0Xg9|7C!Sw9B{W|_KB4_N`i_e%z zg(62p7l1x)O?HRjxu^3`73VQs%RQG4+U>V@)hI##ySm!<1hdnHdiFdOGBq~WieDMF6sh`UonCz zIk=;&vqw)MEXQO=V=adfwlPIaF`0rp#42Qe>vmj~; Date: Sun, 12 Feb 2017 23:18:51 +0100 Subject: [PATCH 21/45] documentation --- .../jota/dto/request/IotaAttachToTangleRequest.java | 4 ++++ .../dto/request/IotaBroadcastTransactionRequest.java | 3 +++ src/main/java/jota/dto/request/IotaCommandRequest.java | 3 +++ .../jota/dto/request/IotaFindTransactionsRequest.java | 3 +++ .../java/jota/dto/request/IotaGetBalancesRequest.java | 3 +++ .../jota/dto/request/IotaGetInclusionStateRequest.java | 3 +++ .../request/IotaGetTransactionsToApproveRequest.java | 3 +++ .../java/jota/dto/request/IotaGetTrytesRequest.java | 3 +++ .../java/jota/dto/request/IotaNeighborsRequest.java | 3 +++ .../jota/dto/request/IotaStoreTransactionsRequest.java | 4 ++++ src/main/java/jota/dto/response/AbstractResponse.java | 3 +++ .../java/jota/dto/response/AddNeighborsResponse.java | 3 +++ .../jota/dto/response/AnalyzeTransactionResponse.java | 3 +++ .../dto/response/BroadcastTransactionsResponse.java | 3 +++ .../jota/dto/response/FindTransactionResponse.java | 3 +++ .../jota/dto/response/GetAttachToTangleResponse.java | 3 +++ .../dto/response/GetBalancesAndFormatResponse.java | 3 +++ .../java/jota/dto/response/GetBalancesResponse.java | 3 +++ src/main/java/jota/dto/response/GetBundleResponse.java | 3 +++ .../jota/dto/response/GetInclusionStateResponse.java | 3 +++ .../java/jota/dto/response/GetMilestoneResponse.java | 10 ---------- .../java/jota/dto/response/GetNeighborsResponse.java | 3 +++ .../java/jota/dto/response/GetNewAddressResponse.java | 3 +++ .../java/jota/dto/response/GetNodeInfoResponse.java | 3 +++ src/main/java/jota/dto/response/GetTipsResponse.java | 3 +++ .../dto/response/GetTransactionsToApproveResponse.java | 3 +++ .../java/jota/dto/response/GetTransferResponse.java | 4 ++-- src/main/java/jota/dto/response/GetTrytesResponse.java | 3 +++ .../response/InterruptAttachingToTangleResponse.java | 3 +++ .../jota/dto/response/RemoveNeighborsResponse.java | 3 +++ .../java/jota/dto/response/ReplayBundleResponse.java | 4 ++-- .../java/jota/dto/response/SendTransferResponse.java | 4 ++-- .../jota/dto/response/StoreTransactionsResponse.java | 3 +++ 33 files changed, 95 insertions(+), 16 deletions(-) delete mode 100644 src/main/java/jota/dto/response/GetMilestoneResponse.java diff --git a/src/main/java/jota/dto/request/IotaAttachToTangleRequest.java b/src/main/java/jota/dto/request/IotaAttachToTangleRequest.java index 8d50a54..6767a33 100644 --- a/src/main/java/jota/dto/request/IotaAttachToTangleRequest.java +++ b/src/main/java/jota/dto/request/IotaAttachToTangleRequest.java @@ -2,6 +2,10 @@ package jota.dto.request; import jota.IotaAPICommands; +/** + * This class represents the core API request 'attachToTangle'. + * It is used to attach trytes to the tangle. + **/ public class IotaAttachToTangleRequest extends IotaCommandRequest { private String trunkTransaction; diff --git a/src/main/java/jota/dto/request/IotaBroadcastTransactionRequest.java b/src/main/java/jota/dto/request/IotaBroadcastTransactionRequest.java index 5a0a5d5..e416151 100644 --- a/src/main/java/jota/dto/request/IotaBroadcastTransactionRequest.java +++ b/src/main/java/jota/dto/request/IotaBroadcastTransactionRequest.java @@ -2,6 +2,9 @@ package jota.dto.request; import jota.IotaAPICommands; +/** + * Broadcast a list of transactions to all neighbors. The input trytes for this call are provided by attachToTangle + **/ public class IotaBroadcastTransactionRequest extends IotaCommandRequest { private String[] trytes; diff --git a/src/main/java/jota/dto/request/IotaCommandRequest.java b/src/main/java/jota/dto/request/IotaCommandRequest.java index 3f914a0..261797e 100644 --- a/src/main/java/jota/dto/request/IotaCommandRequest.java +++ b/src/main/java/jota/dto/request/IotaCommandRequest.java @@ -2,6 +2,9 @@ package jota.dto.request; import jota.IotaAPICommands; +/** + * This class represents the core api request 'getNodeInfo', 'getNeighbors' and 'interruptAttachToTangle' + **/ public class IotaCommandRequest { final String command; diff --git a/src/main/java/jota/dto/request/IotaFindTransactionsRequest.java b/src/main/java/jota/dto/request/IotaFindTransactionsRequest.java index 04da886..c3c92cb 100644 --- a/src/main/java/jota/dto/request/IotaFindTransactionsRequest.java +++ b/src/main/java/jota/dto/request/IotaFindTransactionsRequest.java @@ -2,6 +2,9 @@ package jota.dto.request; import jota.IotaAPICommands; +/** + * This class represents the core api request 'findTransactions' + **/ public class IotaFindTransactionsRequest extends IotaCommandRequest { private String[] bundles; // List of bundle hashes. The hashes need to be extended to 81chars by padding the hash with 9's. diff --git a/src/main/java/jota/dto/request/IotaGetBalancesRequest.java b/src/main/java/jota/dto/request/IotaGetBalancesRequest.java index 33d760d..c71105d 100644 --- a/src/main/java/jota/dto/request/IotaGetBalancesRequest.java +++ b/src/main/java/jota/dto/request/IotaGetBalancesRequest.java @@ -2,6 +2,9 @@ package jota.dto.request; import jota.IotaAPICommands; +/** + * This class represents the core api request 'getBalances' + **/ public class IotaGetBalancesRequest extends IotaCommandRequest { private String[] addresses; diff --git a/src/main/java/jota/dto/request/IotaGetInclusionStateRequest.java b/src/main/java/jota/dto/request/IotaGetInclusionStateRequest.java index 704806e..30eb870 100644 --- a/src/main/java/jota/dto/request/IotaGetInclusionStateRequest.java +++ b/src/main/java/jota/dto/request/IotaGetInclusionStateRequest.java @@ -4,6 +4,9 @@ import jota.IotaAPICommands; import java.util.Collection; +/** + * This class represents the core API request 'getInclusionStates' + **/ public class IotaGetInclusionStateRequest extends IotaCommandRequest { private String[] transactions; diff --git a/src/main/java/jota/dto/request/IotaGetTransactionsToApproveRequest.java b/src/main/java/jota/dto/request/IotaGetTransactionsToApproveRequest.java index fb1b367..7d8d090 100644 --- a/src/main/java/jota/dto/request/IotaGetTransactionsToApproveRequest.java +++ b/src/main/java/jota/dto/request/IotaGetTransactionsToApproveRequest.java @@ -2,6 +2,9 @@ package jota.dto.request; import jota.IotaAPICommands; +/** + * This class represents the core API request 'getTransactionsToApprove' + **/ public class IotaGetTransactionsToApproveRequest extends IotaCommandRequest { private Integer depth; diff --git a/src/main/java/jota/dto/request/IotaGetTrytesRequest.java b/src/main/java/jota/dto/request/IotaGetTrytesRequest.java index eaa5888..fa33cba 100644 --- a/src/main/java/jota/dto/request/IotaGetTrytesRequest.java +++ b/src/main/java/jota/dto/request/IotaGetTrytesRequest.java @@ -2,6 +2,9 @@ package jota.dto.request; import jota.IotaAPICommands; +/** + * This class represents the core API request 'getTrytes' + **/ public class IotaGetTrytesRequest extends IotaCommandRequest { private String[] hashes; diff --git a/src/main/java/jota/dto/request/IotaNeighborsRequest.java b/src/main/java/jota/dto/request/IotaNeighborsRequest.java index c81c491..9edd43f 100644 --- a/src/main/java/jota/dto/request/IotaNeighborsRequest.java +++ b/src/main/java/jota/dto/request/IotaNeighborsRequest.java @@ -2,6 +2,9 @@ package jota.dto.request; import jota.IotaAPICommands; +/** + * This class represents the core API request 'addNeighbors' and 'removeNeighbors' + **/ public class IotaNeighborsRequest extends IotaCommandRequest { private String[] uris; diff --git a/src/main/java/jota/dto/request/IotaStoreTransactionsRequest.java b/src/main/java/jota/dto/request/IotaStoreTransactionsRequest.java index 1b9c55b..67baa29 100644 --- a/src/main/java/jota/dto/request/IotaStoreTransactionsRequest.java +++ b/src/main/java/jota/dto/request/IotaStoreTransactionsRequest.java @@ -2,6 +2,10 @@ package jota.dto.request; import jota.IotaAPICommands; +/** + * This class represents the core API request 'getTransactionsToApprove' + * It stores transactions into the local storage. The trytes to be used for this call are returned by attachToTangle. + **/ public class IotaStoreTransactionsRequest extends IotaCommandRequest { private String[] trytes; diff --git a/src/main/java/jota/dto/response/AbstractResponse.java b/src/main/java/jota/dto/response/AbstractResponse.java index e93ee07..752ab90 100644 --- a/src/main/java/jota/dto/response/AbstractResponse.java +++ b/src/main/java/jota/dto/response/AbstractResponse.java @@ -5,6 +5,9 @@ import org.apache.commons.lang3.builder.HashCodeBuilder; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; +/** + * Abstract response. + */ public abstract class AbstractResponse { private Long duration; diff --git a/src/main/java/jota/dto/response/AddNeighborsResponse.java b/src/main/java/jota/dto/response/AddNeighborsResponse.java index 586f5a2..5583132 100644 --- a/src/main/java/jota/dto/response/AddNeighborsResponse.java +++ b/src/main/java/jota/dto/response/AddNeighborsResponse.java @@ -1,5 +1,8 @@ package jota.dto.response; +/** + * Response of {@link jota.dto.request.IotaNeighborsRequest} + **/ public class AddNeighborsResponse extends AbstractResponse { private int addedNeighbors; diff --git a/src/main/java/jota/dto/response/AnalyzeTransactionResponse.java b/src/main/java/jota/dto/response/AnalyzeTransactionResponse.java index 08c56cf..d7154d3 100644 --- a/src/main/java/jota/dto/response/AnalyzeTransactionResponse.java +++ b/src/main/java/jota/dto/response/AnalyzeTransactionResponse.java @@ -5,6 +5,9 @@ import jota.model.Transaction; import java.util.ArrayList; import java.util.List; +/** + * Response of {@link jota.dto.request.IotaGetBalancesRequest} + **/ public class AnalyzeTransactionResponse extends AbstractResponse { private List transactions = new ArrayList<>(); diff --git a/src/main/java/jota/dto/response/BroadcastTransactionsResponse.java b/src/main/java/jota/dto/response/BroadcastTransactionsResponse.java index fe4d7cd..f7c2e0d 100644 --- a/src/main/java/jota/dto/response/BroadcastTransactionsResponse.java +++ b/src/main/java/jota/dto/response/BroadcastTransactionsResponse.java @@ -1,5 +1,8 @@ package jota.dto.response; +/** + * Response of {@link jota.dto.request.IotaBroadcastTransactionRequest} + **/ public class BroadcastTransactionsResponse extends AbstractResponse { // empty response } diff --git a/src/main/java/jota/dto/response/FindTransactionResponse.java b/src/main/java/jota/dto/response/FindTransactionResponse.java index 1991e86..a590b46 100644 --- a/src/main/java/jota/dto/response/FindTransactionResponse.java +++ b/src/main/java/jota/dto/response/FindTransactionResponse.java @@ -1,5 +1,8 @@ package jota.dto.response; +/** + * Response of {@link jota.dto.request.IotaFindTransactionsRequest} + **/ public class FindTransactionResponse extends AbstractResponse { String[] hashes; diff --git a/src/main/java/jota/dto/response/GetAttachToTangleResponse.java b/src/main/java/jota/dto/response/GetAttachToTangleResponse.java index acbbc42..079a762 100644 --- a/src/main/java/jota/dto/response/GetAttachToTangleResponse.java +++ b/src/main/java/jota/dto/response/GetAttachToTangleResponse.java @@ -1,5 +1,8 @@ package jota.dto.response; +/** + * Response of {@link jota.dto.request.IotaAttachToTangleRequest} + **/ public class GetAttachToTangleResponse extends AbstractResponse { private String[] trytes; diff --git a/src/main/java/jota/dto/response/GetBalancesAndFormatResponse.java b/src/main/java/jota/dto/response/GetBalancesAndFormatResponse.java index f06d27a..71ddb5e 100644 --- a/src/main/java/jota/dto/response/GetBalancesAndFormatResponse.java +++ b/src/main/java/jota/dto/response/GetBalancesAndFormatResponse.java @@ -4,6 +4,9 @@ import jota.model.Input; import java.util.List; +/** + * Response of api request 'getBalancesAndFormatResponse' + **/ public class GetBalancesAndFormatResponse extends AbstractResponse { private List input; diff --git a/src/main/java/jota/dto/response/GetBalancesResponse.java b/src/main/java/jota/dto/response/GetBalancesResponse.java index 0637f61..1de88bf 100644 --- a/src/main/java/jota/dto/response/GetBalancesResponse.java +++ b/src/main/java/jota/dto/response/GetBalancesResponse.java @@ -1,5 +1,8 @@ package jota.dto.response; +/** + * Response of {@link jota.dto.request.IotaGetBalancesRequest} + **/ public class GetBalancesResponse extends AbstractResponse { private String[] balances; diff --git a/src/main/java/jota/dto/response/GetBundleResponse.java b/src/main/java/jota/dto/response/GetBundleResponse.java index c3dfa1b..b183ea0 100644 --- a/src/main/java/jota/dto/response/GetBundleResponse.java +++ b/src/main/java/jota/dto/response/GetBundleResponse.java @@ -5,6 +5,9 @@ import jota.model.Transaction; import java.util.ArrayList; import java.util.List; +/** + * Response of api request 'getBundle + **/ public class GetBundleResponse extends AbstractResponse { private List transactions = new ArrayList<>(); diff --git a/src/main/java/jota/dto/response/GetInclusionStateResponse.java b/src/main/java/jota/dto/response/GetInclusionStateResponse.java index 5b60af9..856ff00 100644 --- a/src/main/java/jota/dto/response/GetInclusionStateResponse.java +++ b/src/main/java/jota/dto/response/GetInclusionStateResponse.java @@ -1,5 +1,8 @@ package jota.dto.response; +/** + * Response of {@link jota.dto.request.IotaGetInclusionStateRequest} + **/ public class GetInclusionStateResponse extends AbstractResponse { boolean[] states; diff --git a/src/main/java/jota/dto/response/GetMilestoneResponse.java b/src/main/java/jota/dto/response/GetMilestoneResponse.java deleted file mode 100644 index 7e3ecbe..0000000 --- a/src/main/java/jota/dto/response/GetMilestoneResponse.java +++ /dev/null @@ -1,10 +0,0 @@ -package jota.dto.response; - -public class GetMilestoneResponse extends AbstractResponse { - - private String milestone; - - public String getMilestone() { - return milestone; - } -} diff --git a/src/main/java/jota/dto/response/GetNeighborsResponse.java b/src/main/java/jota/dto/response/GetNeighborsResponse.java index 3740307..8191305 100644 --- a/src/main/java/jota/dto/response/GetNeighborsResponse.java +++ b/src/main/java/jota/dto/response/GetNeighborsResponse.java @@ -5,6 +5,9 @@ import jota.model.Neighbor; import java.util.ArrayList; import java.util.List; +/** + * Response of {@link jota.dto.request.IotaCommandRequest} + **/ public class GetNeighborsResponse extends AbstractResponse { private List neighbors = new ArrayList<>(); diff --git a/src/main/java/jota/dto/response/GetNewAddressResponse.java b/src/main/java/jota/dto/response/GetNewAddressResponse.java index 42d2288..aed7e98 100644 --- a/src/main/java/jota/dto/response/GetNewAddressResponse.java +++ b/src/main/java/jota/dto/response/GetNewAddressResponse.java @@ -2,6 +2,9 @@ package jota.dto.response; import java.util.List; +/** + * Response of api request 'getNewAddress' + **/ public class GetNewAddressResponse extends AbstractResponse { private List addresses; diff --git a/src/main/java/jota/dto/response/GetNodeInfoResponse.java b/src/main/java/jota/dto/response/GetNodeInfoResponse.java index 233c0fb..b66fc44 100644 --- a/src/main/java/jota/dto/response/GetNodeInfoResponse.java +++ b/src/main/java/jota/dto/response/GetNodeInfoResponse.java @@ -1,5 +1,8 @@ package jota.dto.response; +/** + * Response of {@link jota.dto.request.IotaNeighborsRequest} + **/ public class GetNodeInfoResponse extends AbstractResponse { private String appName; diff --git a/src/main/java/jota/dto/response/GetTipsResponse.java b/src/main/java/jota/dto/response/GetTipsResponse.java index e45fb7e..b6a0d0d 100644 --- a/src/main/java/jota/dto/response/GetTipsResponse.java +++ b/src/main/java/jota/dto/response/GetTipsResponse.java @@ -1,5 +1,8 @@ package jota.dto.response; +/** + * Response of {@link jota.dto.request.IotaCommandRequest} + **/ public class GetTipsResponse extends AbstractResponse { private String[] hashes; diff --git a/src/main/java/jota/dto/response/GetTransactionsToApproveResponse.java b/src/main/java/jota/dto/response/GetTransactionsToApproveResponse.java index ba7d478..3354000 100644 --- a/src/main/java/jota/dto/response/GetTransactionsToApproveResponse.java +++ b/src/main/java/jota/dto/response/GetTransactionsToApproveResponse.java @@ -1,5 +1,8 @@ package jota.dto.response; +/** + * Response of {@link jota.dto.request.IotaGetTransactionsToApproveRequest} + **/ public class GetTransactionsToApproveResponse extends AbstractResponse { private String trunkTransaction; diff --git a/src/main/java/jota/dto/response/GetTransferResponse.java b/src/main/java/jota/dto/response/GetTransferResponse.java index a4fc8da..ee8cf11 100644 --- a/src/main/java/jota/dto/response/GetTransferResponse.java +++ b/src/main/java/jota/dto/response/GetTransferResponse.java @@ -3,8 +3,8 @@ package jota.dto.response; import jota.model.Bundle; /** - * Created by pinpong on 28.12.16. - */ + * Response of api request 'getTransfer' + **/ public class GetTransferResponse extends AbstractResponse { private Bundle[] transferBundle; diff --git a/src/main/java/jota/dto/response/GetTrytesResponse.java b/src/main/java/jota/dto/response/GetTrytesResponse.java index e745caa..48101b5 100644 --- a/src/main/java/jota/dto/response/GetTrytesResponse.java +++ b/src/main/java/jota/dto/response/GetTrytesResponse.java @@ -1,5 +1,8 @@ package jota.dto.response; +/** + * Response of {@link jota.dto.request.IotaGetTrytesRequest} + **/ public class GetTrytesResponse extends AbstractResponse { private String[] trytes; diff --git a/src/main/java/jota/dto/response/InterruptAttachingToTangleResponse.java b/src/main/java/jota/dto/response/InterruptAttachingToTangleResponse.java index c3dda35..ab0400d 100644 --- a/src/main/java/jota/dto/response/InterruptAttachingToTangleResponse.java +++ b/src/main/java/jota/dto/response/InterruptAttachingToTangleResponse.java @@ -1,5 +1,8 @@ package jota.dto.response; +/** + * Response of {@link jota.dto.request.IotaCommandRequest} + **/ public class InterruptAttachingToTangleResponse extends AbstractResponse { // empty response } diff --git a/src/main/java/jota/dto/response/RemoveNeighborsResponse.java b/src/main/java/jota/dto/response/RemoveNeighborsResponse.java index 3f63730..51556fa 100644 --- a/src/main/java/jota/dto/response/RemoveNeighborsResponse.java +++ b/src/main/java/jota/dto/response/RemoveNeighborsResponse.java @@ -1,5 +1,8 @@ package jota.dto.response; +/** + * Response of {@link jota.dto.request.IotaNeighborsRequest} + **/ public class RemoveNeighborsResponse extends AbstractResponse { private int removedNeighbors; diff --git a/src/main/java/jota/dto/response/ReplayBundleResponse.java b/src/main/java/jota/dto/response/ReplayBundleResponse.java index 2c60c6c..563d701 100644 --- a/src/main/java/jota/dto/response/ReplayBundleResponse.java +++ b/src/main/java/jota/dto/response/ReplayBundleResponse.java @@ -1,8 +1,8 @@ package jota.dto.response; /** - * Created by pinpong on 01.01.17. - */ + * Response of api request 'replayBundle' + **/ public class ReplayBundleResponse extends AbstractResponse { private Boolean[] successfully; diff --git a/src/main/java/jota/dto/response/SendTransferResponse.java b/src/main/java/jota/dto/response/SendTransferResponse.java index d31b295..2422a14 100644 --- a/src/main/java/jota/dto/response/SendTransferResponse.java +++ b/src/main/java/jota/dto/response/SendTransferResponse.java @@ -1,8 +1,8 @@ package jota.dto.response; /** - * Created by pinpong on 28.12.16. - */ + * Response of api request 'sendTransfer' + **/ public class SendTransferResponse extends AbstractResponse { private Boolean[] successfully; diff --git a/src/main/java/jota/dto/response/StoreTransactionsResponse.java b/src/main/java/jota/dto/response/StoreTransactionsResponse.java index af6c773..767048e 100644 --- a/src/main/java/jota/dto/response/StoreTransactionsResponse.java +++ b/src/main/java/jota/dto/response/StoreTransactionsResponse.java @@ -1,5 +1,8 @@ package jota.dto.response; +/** + * Response of {@link jota.dto.request.IotaStoreTransactionsRequest} + **/ public class StoreTransactionsResponse extends AbstractResponse { public StoreTransactionsResponse(long duration) { setDuration(duration); From 878f5e9f95cbf79f07364de860c0aa8b154fc4d0 Mon Sep 17 00:00:00 2001 From: pinpong Date: Sun, 12 Feb 2017 23:36:47 +0100 Subject: [PATCH 22/45] documentation --- src/main/java/jota/IotaAPICore.java | 3 ++- src/main/java/jota/error/ArgumentException.java | 2 +- src/main/java/jota/error/BaseException.java | 2 +- src/main/java/jota/error/BroadcastAndStoreException.java | 2 +- src/main/java/jota/error/InvalidAddressException.java | 2 +- src/main/java/jota/error/InvalidBundleException.java | 2 +- src/main/java/jota/error/InvalidSecurityLevelException.java | 2 +- src/main/java/jota/error/InvalidSignatureException.java | 2 +- src/main/java/jota/error/InvalidTransferException.java | 2 +- src/main/java/jota/error/InvalidTrytesException.java | 2 +- src/main/java/jota/error/NoInclusionStatesExcpection.java | 2 +- src/main/java/jota/error/NoNodeInfoException.java | 2 +- src/main/java/jota/error/NotEnoughBalanceException.java | 2 +- src/main/java/jota/model/Bundle.java | 5 +++-- src/main/java/jota/model/Input.java | 5 +++-- src/main/java/jota/model/Inputs.java | 5 +++-- src/main/java/jota/model/Neighbor.java | 5 +++-- src/main/java/jota/model/Signature.java | 5 +++-- src/main/java/jota/model/Transaction.java | 3 ++- src/main/java/jota/model/Transfer.java | 3 ++- src/main/java/jota/pow/ICurl.java | 2 +- src/main/java/jota/utils/Checksum.java | 3 ++- src/main/java/jota/utils/Constants.java | 3 ++- src/main/java/jota/utils/InputValidator.java | 3 ++- src/main/java/jota/utils/IotaUnitConverter.java | 3 ++- src/main/java/jota/utils/IotaUnits.java | 1 + src/main/java/jota/utils/Multisig.java | 2 +- src/main/java/jota/utils/NamedThreadFactory.java | 2 +- src/main/java/jota/utils/Parallel.java | 2 +- src/main/java/jota/utils/SeedRandomGenerator.java | 3 ++- src/main/java/jota/utils/StopWatch.java | 2 +- src/main/java/jota/utils/TrytesConverter.java | 3 ++- src/test/java/jota/ChecksumTest.java | 2 +- src/test/java/jota/InputValidatorTest.java | 2 +- src/test/java/jota/IotaCoreApiTest.java | 2 +- src/test/java/jota/IotaUnitConverterTest.java | 2 +- src/test/java/jota/SeedRandomGeneratorTest.java | 2 +- src/test/java/jota/TrytesConverterTest.java | 2 +- 38 files changed, 57 insertions(+), 42 deletions(-) diff --git a/src/main/java/jota/IotaAPICore.java b/src/main/java/jota/IotaAPICore.java index 51524a1..7264b46 100644 --- a/src/main/java/jota/IotaAPICore.java +++ b/src/main/java/jota/IotaAPICore.java @@ -20,7 +20,8 @@ import java.util.Properties; import java.util.concurrent.TimeUnit; /** - * Created by Adrian on 15.01.2017. + * This class provides access to the Iota core API + * @author Adrian */ public class IotaAPICore { diff --git a/src/main/java/jota/error/ArgumentException.java b/src/main/java/jota/error/ArgumentException.java index 075d90e..fafb454 100644 --- a/src/main/java/jota/error/ArgumentException.java +++ b/src/main/java/jota/error/ArgumentException.java @@ -1,7 +1,7 @@ package jota.error; /** - * Created by Adrian on 09.12.2016. + * @author Adrian */ public class ArgumentException extends BaseException { diff --git a/src/main/java/jota/error/BaseException.java b/src/main/java/jota/error/BaseException.java index 972a0ac..bbfd5ea 100644 --- a/src/main/java/jota/error/BaseException.java +++ b/src/main/java/jota/error/BaseException.java @@ -5,7 +5,7 @@ import java.util.Arrays; import java.util.Collection; /** - * Created by Adrian on 09.12.2016. + * @author Adrian */ public class BaseException extends Exception { diff --git a/src/main/java/jota/error/BroadcastAndStoreException.java b/src/main/java/jota/error/BroadcastAndStoreException.java index a5b58e6..d5dbd52 100644 --- a/src/main/java/jota/error/BroadcastAndStoreException.java +++ b/src/main/java/jota/error/BroadcastAndStoreException.java @@ -1,7 +1,7 @@ package jota.error; /** - * Created by Adrian on 22.01.2017. + * @author Adrian */ public class BroadcastAndStoreException extends BaseException { diff --git a/src/main/java/jota/error/InvalidAddressException.java b/src/main/java/jota/error/InvalidAddressException.java index 442babf..b410951 100644 --- a/src/main/java/jota/error/InvalidAddressException.java +++ b/src/main/java/jota/error/InvalidAddressException.java @@ -1,7 +1,7 @@ package jota.error; /** - * Created by pinpong on 05.02.17. + * @author Adrian */ public class InvalidAddressException extends BaseException { public InvalidAddressException() { diff --git a/src/main/java/jota/error/InvalidBundleException.java b/src/main/java/jota/error/InvalidBundleException.java index 658011b..6d5017e 100644 --- a/src/main/java/jota/error/InvalidBundleException.java +++ b/src/main/java/jota/error/InvalidBundleException.java @@ -1,7 +1,7 @@ package jota.error; /** - * Created by Adrian on 27.12.2016. + * @author Adrian */ public class InvalidBundleException extends BaseException { diff --git a/src/main/java/jota/error/InvalidSecurityLevelException.java b/src/main/java/jota/error/InvalidSecurityLevelException.java index 263ffbd..d000376 100644 --- a/src/main/java/jota/error/InvalidSecurityLevelException.java +++ b/src/main/java/jota/error/InvalidSecurityLevelException.java @@ -1,7 +1,7 @@ package jota.error; /** - * Created by pinpong on 02.02.17. + * @author pinpong */ public class InvalidSecurityLevelException extends BaseException { diff --git a/src/main/java/jota/error/InvalidSignatureException.java b/src/main/java/jota/error/InvalidSignatureException.java index d8d5565..9a30602 100644 --- a/src/main/java/jota/error/InvalidSignatureException.java +++ b/src/main/java/jota/error/InvalidSignatureException.java @@ -1,7 +1,7 @@ package jota.error; /** - * Created by Adrian on 27.12.2016. + * @author Adrian */ public class InvalidSignatureException extends BaseException { public InvalidSignatureException() { diff --git a/src/main/java/jota/error/InvalidTransferException.java b/src/main/java/jota/error/InvalidTransferException.java index 20a6565..6d8e501 100644 --- a/src/main/java/jota/error/InvalidTransferException.java +++ b/src/main/java/jota/error/InvalidTransferException.java @@ -1,7 +1,7 @@ package jota.error; /** - * Created by pinpong on 05.02.17. + * @author pinpong */ public class InvalidTransferException extends BaseException { public InvalidTransferException() { diff --git a/src/main/java/jota/error/InvalidTrytesException.java b/src/main/java/jota/error/InvalidTrytesException.java index 8977f2f..c610afb 100644 --- a/src/main/java/jota/error/InvalidTrytesException.java +++ b/src/main/java/jota/error/InvalidTrytesException.java @@ -1,7 +1,7 @@ package jota.error; /** - * Created by Adrian on 04.02.2017. + * @author Adrian */ public class InvalidTrytesException extends BaseException { diff --git a/src/main/java/jota/error/NoInclusionStatesExcpection.java b/src/main/java/jota/error/NoInclusionStatesExcpection.java index c79ee4b..35fc61a 100644 --- a/src/main/java/jota/error/NoInclusionStatesExcpection.java +++ b/src/main/java/jota/error/NoInclusionStatesExcpection.java @@ -1,7 +1,7 @@ package jota.error; /** - * Created by Adrian on 22.01.2017. + * @author Adrian */ public class NoInclusionStatesExcpection extends BaseException { diff --git a/src/main/java/jota/error/NoNodeInfoException.java b/src/main/java/jota/error/NoNodeInfoException.java index 920c6f3..4df4ff8 100644 --- a/src/main/java/jota/error/NoNodeInfoException.java +++ b/src/main/java/jota/error/NoNodeInfoException.java @@ -1,7 +1,7 @@ package jota.error; /** - * Created by Adrian on 22.01.2017. + * @author Adrian */ public class NoNodeInfoException extends BaseException { diff --git a/src/main/java/jota/error/NotEnoughBalanceException.java b/src/main/java/jota/error/NotEnoughBalanceException.java index dfe44a1..a26d615 100644 --- a/src/main/java/jota/error/NotEnoughBalanceException.java +++ b/src/main/java/jota/error/NotEnoughBalanceException.java @@ -1,7 +1,7 @@ package jota.error; /** - * Created by Adrian on 09.12.2016. + * @author Adrian */ public class NotEnoughBalanceException extends BaseException { diff --git a/src/main/java/jota/model/Bundle.java b/src/main/java/jota/model/Bundle.java index 7c02db5..a878fc7 100644 --- a/src/main/java/jota/model/Bundle.java +++ b/src/main/java/jota/model/Bundle.java @@ -10,8 +10,9 @@ import java.util.List; /** - * Created by pinpong on 09.12.16. - */ + * This class represents a Bundle, a set of transactions + * @author pinpong + **/ public class Bundle implements Comparable { public static String EMPTY_HASH = "999999999999999999999999999999999999999999999999999999999999999999999999999999999"; diff --git a/src/main/java/jota/model/Input.java b/src/main/java/jota/model/Input.java index ead850c..f1e005a 100644 --- a/src/main/java/jota/model/Input.java +++ b/src/main/java/jota/model/Input.java @@ -4,8 +4,9 @@ import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; /** - * Created by Adrian on 09.12.2016. - */ + * This class represents an Input + * @author Adrian + **/ public class Input { private String address; private long balance; diff --git a/src/main/java/jota/model/Inputs.java b/src/main/java/jota/model/Inputs.java index 5d4b993..1485d81 100644 --- a/src/main/java/jota/model/Inputs.java +++ b/src/main/java/jota/model/Inputs.java @@ -5,8 +5,9 @@ import com.google.gson.Gson; import java.util.List; /** - * Created by Adrian on 09.12.2016. - */ + * This class represents an Inputs + * @author Adrian + **/ public class Inputs { private List inputsList; private long totalBalance; diff --git a/src/main/java/jota/model/Neighbor.java b/src/main/java/jota/model/Neighbor.java index 2eee719..fdd17ac 100644 --- a/src/main/java/jota/model/Neighbor.java +++ b/src/main/java/jota/model/Neighbor.java @@ -1,8 +1,9 @@ package jota.model; /** - * Created by pinpong on 02.12.16. - */ + * This class represents an Neighbor + * @author pinpong + **/ public class Neighbor { private String address; diff --git a/src/main/java/jota/model/Signature.java b/src/main/java/jota/model/Signature.java index 3e0a9ba..db5e12c 100644 --- a/src/main/java/jota/model/Signature.java +++ b/src/main/java/jota/model/Signature.java @@ -4,8 +4,9 @@ import java.util.ArrayList; import java.util.List; /** - * Created by Adrian on 27.12.2016. - */ + * This class represents an Signature + * @author Adrian + **/ public class Signature { String address; diff --git a/src/main/java/jota/model/Transaction.java b/src/main/java/jota/model/Transaction.java index 9b49bc8..b744040 100644 --- a/src/main/java/jota/model/Transaction.java +++ b/src/main/java/jota/model/Transaction.java @@ -12,7 +12,8 @@ import org.slf4j.LoggerFactory; import java.util.Arrays; /** - * Created by pinpong on 02.12.16. + * This class represents an iota transaction + * @author pinpong */ public class Transaction { private static final Logger log = LoggerFactory.getLogger(Transaction.class); diff --git a/src/main/java/jota/model/Transfer.java b/src/main/java/jota/model/Transfer.java index 65cb8de..645d2c3 100644 --- a/src/main/java/jota/model/Transfer.java +++ b/src/main/java/jota/model/Transfer.java @@ -3,7 +3,8 @@ package jota.model; import com.google.gson.Gson; /** - * Created by pinpong on 02.12.16. + * This class represents a Transfer + * @author pinpong */ public class Transfer { diff --git a/src/main/java/jota/pow/ICurl.java b/src/main/java/jota/pow/ICurl.java index 877a16d..0933ab1 100644 --- a/src/main/java/jota/pow/ICurl.java +++ b/src/main/java/jota/pow/ICurl.java @@ -1,7 +1,7 @@ package jota.pow; /** - * Created by Adrian on 07.01.2017. + * @author Adrian */ public interface ICurl { ICurl absorb(final int[] trits, int offset, int length); diff --git a/src/main/java/jota/utils/Checksum.java b/src/main/java/jota/utils/Checksum.java index bd2e542..e33bd21 100644 --- a/src/main/java/jota/utils/Checksum.java +++ b/src/main/java/jota/utils/Checksum.java @@ -4,7 +4,8 @@ import jota.error.InvalidAddressException; import jota.pow.JCurl; /** - * Created by pinpong on 02.12.16. + * This class defines utility methods to add/remove the checksum to/from an address + * @author pinpong */ public class Checksum { diff --git a/src/main/java/jota/utils/Constants.java b/src/main/java/jota/utils/Constants.java index 5f8f9a2..8a3a393 100644 --- a/src/main/java/jota/utils/Constants.java +++ b/src/main/java/jota/utils/Constants.java @@ -1,7 +1,8 @@ package jota.utils; /** - * Created by pinpong on 02.12.16. + * This class defines the global constants + * @author pinpong */ public class Constants { diff --git a/src/main/java/jota/utils/InputValidator.java b/src/main/java/jota/utils/InputValidator.java index 0399602..f1a2dea 100644 --- a/src/main/java/jota/utils/InputValidator.java +++ b/src/main/java/jota/utils/InputValidator.java @@ -8,7 +8,8 @@ import org.apache.commons.lang3.math.NumberUtils; import java.util.List; /** - * Created by pinpong on 02.12.16. + * This class provides methods to validate the parameters of different iota API methods + * @author pinpong */ public class InputValidator { diff --git a/src/main/java/jota/utils/IotaUnitConverter.java b/src/main/java/jota/utils/IotaUnitConverter.java index eade784..7b0635c 100644 --- a/src/main/java/jota/utils/IotaUnitConverter.java +++ b/src/main/java/jota/utils/IotaUnitConverter.java @@ -3,7 +3,8 @@ package jota.utils; import java.text.DecimalFormat; /** - * Created by Sascha on 30.11.16. + * This class provides methods to convert Iota to different units + * @author sascha */ public class IotaUnitConverter { diff --git a/src/main/java/jota/utils/IotaUnits.java b/src/main/java/jota/utils/IotaUnits.java index e799913..bb7bb09 100644 --- a/src/main/java/jota/utils/IotaUnits.java +++ b/src/main/java/jota/utils/IotaUnits.java @@ -2,6 +2,7 @@ package jota.utils; /** * Table of IOTA units based off of the standard system of Units + * @author pinpong **/ public enum IotaUnits { diff --git a/src/main/java/jota/utils/Multisig.java b/src/main/java/jota/utils/Multisig.java index 4456d1d..f2b07b4 100644 --- a/src/main/java/jota/utils/Multisig.java +++ b/src/main/java/jota/utils/Multisig.java @@ -7,7 +7,7 @@ import jota.pow.JCurl; import java.util.Arrays; /** - * Created by pinpong on 02.02.17. + * @author pinpong */ public class Multisig { diff --git a/src/main/java/jota/utils/NamedThreadFactory.java b/src/main/java/jota/utils/NamedThreadFactory.java index a6e3dab..4f92e1a 100644 --- a/src/main/java/jota/utils/NamedThreadFactory.java +++ b/src/main/java/jota/utils/NamedThreadFactory.java @@ -5,7 +5,7 @@ import java.util.concurrent.ThreadFactory; import java.util.concurrent.atomic.AtomicInteger; /** - * Created by Adrian on 15.01.2017. + * @author Adrian */ public class NamedThreadFactory implements ThreadFactory { private final String baseName; diff --git a/src/main/java/jota/utils/Parallel.java b/src/main/java/jota/utils/Parallel.java index f5cdeb7..3dccff4 100644 --- a/src/main/java/jota/utils/Parallel.java +++ b/src/main/java/jota/utils/Parallel.java @@ -8,7 +8,7 @@ import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; /** - * Created by Adrian on 15.01.2017. + * @author Adrian */ public class Parallel { private static final int NUM_CORES = Runtime.getRuntime().availableProcessors(); diff --git a/src/main/java/jota/utils/SeedRandomGenerator.java b/src/main/java/jota/utils/SeedRandomGenerator.java index 2727d8c..fd5b93a 100644 --- a/src/main/java/jota/utils/SeedRandomGenerator.java +++ b/src/main/java/jota/utils/SeedRandomGenerator.java @@ -3,7 +3,8 @@ package jota.utils; import java.security.SecureRandom; /** - * Created by pinpong on 13.12.16. + * This class allows to create a secure random generated seed + * @author pinpong */ public class SeedRandomGenerator { diff --git a/src/main/java/jota/utils/StopWatch.java b/src/main/java/jota/utils/StopWatch.java index 699de6f..18ec7bc 100644 --- a/src/main/java/jota/utils/StopWatch.java +++ b/src/main/java/jota/utils/StopWatch.java @@ -1,7 +1,7 @@ package jota.utils; /** - * Created by Adrian on 15.01.2017. + * @author adrian */ public class StopWatch { private long startTime = 0; diff --git a/src/main/java/jota/utils/TrytesConverter.java b/src/main/java/jota/utils/TrytesConverter.java index bea49ac..376167a 100644 --- a/src/main/java/jota/utils/TrytesConverter.java +++ b/src/main/java/jota/utils/TrytesConverter.java @@ -1,7 +1,8 @@ package jota.utils; /** - * Created by pinpong on 01.12.16. + * This class allows to convert between ASCII and tryte encoded strings + * @author pinpong */ public class TrytesConverter { diff --git a/src/test/java/jota/ChecksumTest.java b/src/test/java/jota/ChecksumTest.java index f2b950d..12ec896 100644 --- a/src/test/java/jota/ChecksumTest.java +++ b/src/test/java/jota/ChecksumTest.java @@ -7,7 +7,7 @@ import org.junit.Test; import static org.junit.Assert.assertEquals; /** - * Created by pinpong on 02.12.16. + * @author pinpong */ public class ChecksumTest { diff --git a/src/test/java/jota/InputValidatorTest.java b/src/test/java/jota/InputValidatorTest.java index 502ab47..244dacc 100644 --- a/src/test/java/jota/InputValidatorTest.java +++ b/src/test/java/jota/InputValidatorTest.java @@ -11,7 +11,7 @@ import java.util.List; import static org.junit.Assert.assertEquals; /** - * Created by pinpong on 02.12.16. + * @author pinpong */ public class InputValidatorTest { diff --git a/src/test/java/jota/IotaCoreApiTest.java b/src/test/java/jota/IotaCoreApiTest.java index d3aa4e8..36d8f44 100644 --- a/src/test/java/jota/IotaCoreApiTest.java +++ b/src/test/java/jota/IotaCoreApiTest.java @@ -9,7 +9,7 @@ import org.junit.Test; import static org.junit.Assert.assertThat; /** - * Created by Adrian on 15.01.2017. + * @author Adrian */ public class IotaCoreApiTest { diff --git a/src/test/java/jota/IotaUnitConverterTest.java b/src/test/java/jota/IotaUnitConverterTest.java index 624555a..a63e6de 100644 --- a/src/test/java/jota/IotaUnitConverterTest.java +++ b/src/test/java/jota/IotaUnitConverterTest.java @@ -7,7 +7,7 @@ import org.junit.Test; import static org.junit.Assert.assertEquals; /** - * Created by pinpong on 30.11.16. + * @author pinpong */ public class IotaUnitConverterTest { diff --git a/src/test/java/jota/SeedRandomGeneratorTest.java b/src/test/java/jota/SeedRandomGeneratorTest.java index 01c203f..0876dfe 100644 --- a/src/test/java/jota/SeedRandomGeneratorTest.java +++ b/src/test/java/jota/SeedRandomGeneratorTest.java @@ -8,7 +8,7 @@ import org.junit.Test; import static org.junit.Assert.assertEquals; /** - * Created by pinpong on 13.12.16. + * @author pinpong */ public class SeedRandomGeneratorTest { diff --git a/src/test/java/jota/TrytesConverterTest.java b/src/test/java/jota/TrytesConverterTest.java index f6403e5..9c65c4f 100644 --- a/src/test/java/jota/TrytesConverterTest.java +++ b/src/test/java/jota/TrytesConverterTest.java @@ -8,7 +8,7 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; /** - * Created by pinpong on 01.12.16. + * @author pinpong */ public class TrytesConverterTest { From c329298a7ab33fb44442898e9fb2f7024e0c80cc Mon Sep 17 00:00:00 2001 From: adrianziser Date: Sun, 12 Feb 2017 23:47:12 +0100 Subject: [PATCH 23/45] removed IDEA from cipher list --- codesigning.asc.enc | Bin 9648 -> 11200 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/codesigning.asc.enc b/codesigning.asc.enc index 71f4417725d25eaa1d3dc2b9bed7768356ae69c7..462aad380fb1a38e91ca6cb30a7e1cc67c99d486 100644 GIT binary patch literal 11200 zcmV;xD?ik2rXt0Xf!;p;pmo6rp~)`+#bpeeS{LcoQO3d?X<9SKNgnRD!Arpjg{b3j zrlQFUXQ)AGH2(|qWq`)WplwJ;4{^m@d1mT^GZ{KP8Ay3uyl1&a+*od6G)-=$*GljJ z8?I5x^FNmRuI?*8Yn^Z-<36AnK&gm*#-)aOFU>L%o92+9T+kVx*|ADV%v%|vU_a?K z50eF;5=F;sl_G6w`M$I;9--+irp&gHmQ*t6IasP;OcgXAlumX&LA+9nZvHY-p}Wq+ z@Azyylz)){!cEw0ETjv&w?|ki^u$mc!5klk!Zg;GyjbTle6`a?_!%BWwavCqT{VV-kZ%$CwEI=H1fY+@HDfT;_ zR&542wMOuGT)N*r(}^nmkp1vJpFYZNRM*{+u7vNs2K8C)0|F0S4U34sx~DJ%E?V02 zc+!{GSvS*y>|F<}VQHW&i|$Y@{g>ReNVYlJ#bjkaX-Cjf-591C^JIB~12B0fRp&Q@ z8g~b!21g-_*FO?9#Ul)wkOA3>QA~zfLX=XjSje>VMnMKFnhGd9$57s1L7SPG3_l%L z@Qv1a<#ro*07{g7g~bfqEDtt5bXj{L9#q%Qmw{f{pS6J|;O9?-Pld+-X2HLom@B84 zy_wR!;G;Uxv6EALVh0o@C(zEexu_?js1LhkoFOiv~BA? zDWVP@QM&uxN9uBo`wXE3K@~H;@FYh5n?Q@{ z8%915NbA$@4^5w^anK4?2d0wLL@j1b)lW4z-Pay(Q{N_VuTx}~ecJ?^)6URfqV|Cf zkqj!oBc2?6r(^V^F;`>x=mCd~eay(k7H&Yc+uAG%enH0)_mZkQec%{gGXS#SwMY82tRL zf)uh1{nqHquNc$spVSdY;9U}B3#AA&*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*>(+Vbp#$C*Voj*B@B2(J-s?u}2u~Lu z29~kbjG1&nn<&Js+I?1r^$ex1TU{9-&-du*J&xZsjc)CEkub~Rqn8po8q3?yJg_9I zn&Mt`FnoP{`cI|8fY;SzY~?2c%DOgH=7i8r1Wwma*tTDUlXE4VMrMb1q;3q1%6jX{l06f$ zN;nrk+*XS0&`O>ZiU0H@>%HY44(I|KARnwf)d~#kc9W_S+U`B3str9J$#wPQox|c7 zzZhm36KaJeVsQ4HRjv7dw$HW-47bu09|tKVWAJ861>KgIcx>+`YOFNEjFKCL>`MPt z1N5((BPBm)(IcsfV3c$D*uFii{HW^QGqx_^S=C?*8;7T~jWnlQ$Vjf-UT)%hER#!5 z;6@o~Bf*gQ=o+`+MCMA$H@7iGv6CmM4u#SV7c%k(UhI}AQ1Qj89{~=18@%MJP-}U> zKragl*A-b(?^clFv!)t2~;zy)<&@mbb976gm`tW@Dl;qefDhWL~~VaUlk54gdl zmze~fx7C3PhhcE)oy={-_UT6MN{U%IXsgGJ#&M^|77Pb0(YYbPws*qO0uRnWdum_? zJ&W&h2bJ~3W<<&Vh?-JymdKf3FXVLiBWEBqH8@l9Fn$F=t{6DsxPcn5pz?L6bgp(U m>WNVX28l<)COIsQ71vJqfu{gUz6Ci77mFMM`Z&Ur!d;mRkIX^< From a0e5a9a50a900661ce9a7bf32243b0a40c4ba1b6 Mon Sep 17 00:00:00 2001 From: adrianziser Date: Sun, 12 Feb 2017 23:59:34 +0100 Subject: [PATCH 24/45] finally --- codesigning.asc.enc | Bin 11200 -> 9536 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/codesigning.asc.enc b/codesigning.asc.enc index 462aad380fb1a38e91ca6cb30a7e1cc67c99d486..266c186788e28fe3bf4902209e2949a42e8f531d 100644 GIT binary patch literal 9536 zcmV-GCBNFVuGbpjh}T3?mRObv3_bR8`;{qrOstP|eYkYGgo>;i&h6DEZR>?7?7e%i zAd%^$iC{)ON`*_Yu?ddf(xnaYGbNlLVQgXs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0zI15` zXKkcy(L_o&Qp+qwt;m@rwYv(1?!Lo*j8lZE>^#DeZ08tYqSQSgP*_TVd&{D#}dhxf|+ixs)Js_HtZiic*i^=+1+XzS* zj%Sg9$!8!J9$s5I#vh|6)&$Q*`I6IeWt>ln`zp4_&!64Mf;g1WmzX1`3BzCDbk&LQ zTTn9N_h#wmY-i$`f(l^cQNN|e_7e>#(9%wLV~R`1xykyT0_EY3p#lT2Jlw#6hyFL( zYFsT&9z898&-&{%B;daQjrT|C<;u?KUTE1MOt^hDJ2ONDsKyDynnHDl^gxiD@?CfLT51=I9BR-3*`NJ*M& z9(ocN0Fz@M%u)2F(7k1vK^LS9`#C3qh=G9%A`fd~;h7Fl)Fly@VUwp)n%BDAl_c0i zdRTE}5iN9OxF~z?*R}}TJ;C~Y$DbiO>awz)Y@85Rsx zP4Qu>z)aC%R^wzD6{YfMOgvwi+uP9lJIoVV-|P{I3MY|koYp~zT_$|nf)FMGunun^wgZ#?RXAy2E~_}$RBk71kGGj z-9AE0XZ5!zwa^hmO_gHAGD*b+;svM=Nv1;%sj_lx|KVVRBpRWg9kIu0cXZpLEEovt zLi52GDoT#a>zlW|ZAnQj%}dl9D>S*T^wxx1{tDBJw!nj|W(t%~N6kTVSa-&c>%xW! zpNyrMv@V|qn|t9(ru8tbKA`bdkC~EW9*54_g767iiBSJq9R-|SsU0Ra&cEd6W7vkd z_A3PW-@JhJo1~MTb9Xc7oWh4wuiRrPp;g^~3k%S4R}{}<&KPZmy=9e!am@n83cj@+ z90j4ic4Ye{8{LpM#XT1T@6X%9p{i_vVFG^FD2w^-Y>zItN8RjNToce8ju!XI`JV;p e<)?F_qKWJ0jGPd&r4+QtADLlgpbpQlhOIDGhoL(F From b9d7e24481a807282db14ab89fe236a2dcd0e61a Mon Sep 17 00:00:00 2001 From: adrianziser Date: Mon, 13 Feb 2017 00:14:52 +0100 Subject: [PATCH 25/45] Build * disable doclint --- dependency-reduced-pom.xml | 128 +++++++++++++++++++++++++++++++++++++ pom.xml | 1 + 2 files changed, 129 insertions(+) create mode 100644 dependency-reduced-pom.xml diff --git a/dependency-reduced-pom.xml b/dependency-reduced-pom.xml new file mode 100644 index 0000000..1ca7d78 --- /dev/null +++ b/dependency-reduced-pom.xml @@ -0,0 +1,128 @@ + + + 4.0.0 + org.iota + jota + JOTA + 0.9.0-RC1 + JOTA library is a simple Java wrapper around IOTA Node's JSON-REST HTTP interface. + + + Apache License, Version 2.0 + http://www.apache.org/licenses/LICENSE-2.0.txt + repo + + + + + + maven-compiler-plugin + 3.3 + + ${java-version} + ${java-version} + ${java-version} + ${java-version} + + + + maven-shade-plugin + 2.4.3 + + + package + + shade + + + + + + maven-surefire-plugin + 2.12.4 + + true + + + + + + + build-extras + + + + maven-source-plugin + 3.0.1 + + + attach-sources + + jar + + + + + + maven-javadoc-plugin + 2.10.4 + + + attach-javadocs + + jar + + + private + true + -Xdoclint:none + + + + + private + true + -Xdoclint:none + + + + maven-gpg-plugin + 1.6 + + + sign-artifacts + package + + sign + + + + + + + + ${env.GPG_KEYNAME} + ${env.GPG_PASSPHRASE} + + + + + + junit + junit + 4.12 + test + + + hamcrest-core + org.hamcrest + + + + + + 1.7 + UTF-8 + + + diff --git a/pom.xml b/pom.xml index dd03548..becaf24 100644 --- a/pom.xml +++ b/pom.xml @@ -146,6 +146,7 @@ private true + -Xdoclint:none From fcf4bfe86e04c079a8c2e2061d19b9cc4e01d53a Mon Sep 17 00:00:00 2001 From: adrianziser Date: Mon, 13 Feb 2017 00:24:34 +0100 Subject: [PATCH 26/45] Build * fixed typo in travis cfg --- .travis.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3ce7e7e..55859a6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,12 +12,12 @@ deploy: secure: YR8aDGTciBNQgI8GU5DSSm6dzKyZhgmixewIMkbjwrGkdLs/UnD2cfMh2ziNuivpmnIDj2rCMmf6gr1PhQno5nsPPrrFcJs0tIv2LAvAAJst/k32zMK3wv1x54eaTS3SK9VxUdAcnB0N3RvMKLiaqkwTcxa4PY9pWlHnZdc8h9oCqr7JAq8NH/94Ri4AiUc7hDgu6xnZNDqll6gJwdM8kUPQuUsAkkAl2dBVfqB7OeQFkmTvl6Hi5WCn9zbpBpKxE4t/SbgZvH5ccVBKOZveFG38/Mm1ur6VHQ8WvZFnEHps+aq8Sjz8irzcdGHC/hSGvMfsB2LRZHKd8KaRcSCypzuBjNt+ayEaaCd4AcNIsR/cEtC9aOzttNhS6eX4YpdaDjmvlqChjKvR+reKVXK7rb6Z08vHkJC1HOofovfjBP0RXT/O1CsUTpPS0lpNfrNZ0n0GfaHqtqxYrGDsXMFIHX5v39fqwAF2pmpJQaB3CeSLpEM7YbNcPlPRQ/w4XZ5SEN1ENS6a8oenOL+IZNMyspTywG3vQgdc82W5MhjFpUawrReeWd6y5xrHiWBLVPJGsgJQPIY0MkuAGiIGqiT8hSW8x8frYhX9IZ7/x4My6PYL8pCv+zn2V8LBr5KCtjVf3sGrxftlt1eLvQHkw290yRUgcfTAd2Dj8lk8H+jYgXA= file_glob: true file: - - "/home/travis/build/iotaledger/iota.lib.jota/target/jota*.jar" - - "/home/travis/build/iotaledger/iota.lib.jota/target/jota*.jar.asc" - - "/home/travis/build/iotaledger/iota.lib.jota/target/jota*-sources.jar" - - "/home/travis/build/iotaledger/iota.lib.jota/target/jota*-sources.jar.asc" - - "/home/travis/build/iotaledger/iota.lib.jota/target/jota*-javadoc.jar" - - "/home/travis/build/iotaledger/iota.lib.jota/target/jota*-javadoc.jar.asc" + - "/home/travis/build/iotaledger/iota.lib.java/target/jota*.jar" + - "/home/travis/build/iotaledger/iota.lib.java/target/jota*.jar.asc" + - "/home/travis/build/iotaledger/iota.lib.java/target/jota*-sources.jar" + - "/home/travis/build/iotaledger/iota.lib.java/target/jota*-sources.jar.asc" + - "/home/travis/build/iotaledger/iota.lib.java/target/jota*-javadoc.jar" + - "/home/travis/build/iotaledger/iota.lib.java/target/jota*-javadoc.jar.asc" skip_cleanup: true on: tags: true From 6000f702d6a7ff7c3546ddc404f0db6f16ba8120 Mon Sep 17 00:00:00 2001 From: pinpong Date: Mon, 13 Feb 2017 18:06:23 +0100 Subject: [PATCH 27/45] documentation --- .../jota/dto/response/AbstractResponse.java | 5 + src/main/java/jota/model/Bundle.java | 50 ++++++- src/main/java/jota/model/Input.java | 43 +++++- src/main/java/jota/model/Inputs.java | 26 ++++ src/main/java/jota/model/Neighbor.java | 21 +++ src/main/java/jota/model/Signature.java | 25 +++- src/main/java/jota/model/Transaction.java | 137 +++++++++++++++++- src/main/java/jota/model/Transfer.java | 68 +++++++++ 8 files changed, 370 insertions(+), 5 deletions(-) diff --git a/src/main/java/jota/dto/response/AbstractResponse.java b/src/main/java/jota/dto/response/AbstractResponse.java index 752ab90..5b5d3dc 100644 --- a/src/main/java/jota/dto/response/AbstractResponse.java +++ b/src/main/java/jota/dto/response/AbstractResponse.java @@ -20,6 +20,11 @@ public abstract class AbstractResponse { this.duration = duration; } + /** + * Returns a String that represents this object. + * + * @return Returns a string representation of this object. + */ @Override public String toString() { return ToStringBuilder.reflectionToString(this, ToStringStyle.MULTI_LINE_STYLE); diff --git a/src/main/java/jota/model/Bundle.java b/src/main/java/jota/model/Bundle.java index a878fc7..6260bc5 100644 --- a/src/main/java/jota/model/Bundle.java +++ b/src/main/java/jota/model/Bundle.java @@ -20,27 +20,55 @@ public class Bundle implements Comparable { private int length; + /** + * Initializes a new instance of the Bundle class without transactions. + */ public Bundle() { this(new ArrayList(), 0); } + /** + * Initializes a new instance of the Bundle class. + */ public Bundle(List transactions, int length) { this.transactions = transactions; this.length = length; } + /** + * Gets the transactions + * + * @return transactions The transactions. + */ public List getTransactions() { return transactions; } + /** + * Gets the length of the bundle + * + * @return length The length. + */ public int getLength() { return length; } + /** + * Sets the length of the bundle + * @param length The length. + */ public void setLength(int length) { this.length = length; } + /** + * Adds a bundle entry + * @param signatureMessageLength Length of the signature message. + * @param address The address. + * @param value The value. + * @param tag The tag. + * @param timestamp The timestamp. + */ public void addEntry(int signatureMessageLength, String address, long value, String tag, long timestamp) { if (getTransactions() == null) { this.transactions = new ArrayList<>(getTransactions()); @@ -52,6 +80,10 @@ public class Bundle implements Comparable { } } + /** + * Finalizes the bundle using the specified curl implementation + * @param customCurl The custom curl. + */ public void finalize(ICurl customCurl) { ICurl curl = customCurl == null ? new JCurl() : customCurl; @@ -81,7 +113,10 @@ public class Bundle implements Comparable { } } - + /** + * Adds the trytes. + * @param signatureFragments The signature fragments. + */ public void addTrytes(List signatureFragments) { String emptySignatureFragment = ""; String emptyHash = EMPTY_HASH; @@ -103,6 +138,12 @@ public class Bundle implements Comparable { } } + + /** + * Normalized the bundle. + * @param bundleHash The bundle hash. + * @return normalizedBundle A normalized bundle hash. + */ public int[] normalizedBundle(String bundleHash) { int[] normalizedBundle = new int[81]; @@ -141,6 +182,13 @@ public class Bundle implements Comparable { return normalizedBundle; } + + /** + * Compares the current object with another object of the same type. + * @param o An object to compare with this object. + * @return A value that indicates the relative order of the objects being compared. The return value has the following meanings: Value Meaning Less than zero This object is less than the parameter.Zero This object is equal to . Greater than zero This object is greater than . + + */ @Override public int compareTo(Bundle o) { return Long.compare(Long.parseLong(this.getTransactions().get(0).getTimestamp()), Long.parseLong(o.getTransactions().get(0).getTimestamp())); diff --git a/src/main/java/jota/model/Input.java b/src/main/java/jota/model/Input.java index f1e005a..4114195 100644 --- a/src/main/java/jota/model/Input.java +++ b/src/main/java/jota/model/Input.java @@ -8,12 +8,15 @@ import org.apache.commons.lang3.builder.ToStringStyle; * @author Adrian **/ public class Input { + private String address; private long balance; private int keyIndex; private int security; - + /** + * Initializes a new instance of the Input class. + */ public Input(String address, long balance, int keyIndex, int security) { this.address = address; this.balance = balance; @@ -22,39 +25,77 @@ public class Input { } + /** + * Returns a String that represents this object. + * + * @return Returns a string representation of this object. + */ @Override public String toString() { return ToStringBuilder.reflectionToString(this, ToStringStyle.MULTI_LINE_STYLE); } + /** + * Get the address. + * + * @return address The address. + */ public String getAddress() { return address; } + /** + * Get the address. + * @param address The address. + */ public void setAddress(String address) { this.address = address; } + /** + * Get the balance. + * @return address The balance. + */ public long getBalance() { return balance; } + /** + * Get the balance. + * @param balance The balance. + */ public void setBalance(long balance) { this.balance = balance; } + /** + * Get the keyIndex. + * @return keyIndex The keyIndex. + */ public int getKeyIndex() { return keyIndex; } + /** + * Get the keyIndex. + * @param keyIndex The keyIndex. + */ public void setKeyIndex(int keyIndex) { this.keyIndex = keyIndex; } + /** + * Get the security. + * @return security The security. + */ public int getSecurity() { return security; } + /** + * Get the security. + * @param security The security. + */ public void setSecurity(int security) { this.security = security; } diff --git a/src/main/java/jota/model/Inputs.java b/src/main/java/jota/model/Inputs.java index 1485d81..a7d4cb0 100644 --- a/src/main/java/jota/model/Inputs.java +++ b/src/main/java/jota/model/Inputs.java @@ -9,31 +9,57 @@ import java.util.List; * @author Adrian **/ public class Inputs { + private List inputsList; private long totalBalance; + /** + * Initializes a new instance of the Input class. + */ public Inputs(List inputsList, long totalBalance) { this.inputsList = inputsList; this.totalBalance = totalBalance; } + /** + * Returns a Json Object that represents this object. + * + * @return Returns a string representation of this object. + */ @Override public String toString() { return new Gson().toJson(this); } + /** + * Get the input list. + * + * @return inputList The input list. + */ public List getInputsList() { return inputsList; } + /** + * Set the input list. + * @param inputsList The input list. + */ public void setInputsList(List inputsList) { inputsList = inputsList; } + /** + * Get the total balance. + * @return totalBalance The total balance. + */ public long getTotalBalance() { return totalBalance; } + /** + * Set the total balance. + * @param totalBalance The total balance. + */ public void setTotalBalance(long totalBalance) { this.totalBalance = totalBalance; } diff --git a/src/main/java/jota/model/Neighbor.java b/src/main/java/jota/model/Neighbor.java index fdd17ac..1cc4e4f 100644 --- a/src/main/java/jota/model/Neighbor.java +++ b/src/main/java/jota/model/Neighbor.java @@ -11,6 +11,9 @@ public class Neighbor { private Integer numberOfInvalidTransactions; private Integer numberOfNewTransactions; + /** + * Initializes a new instance of the Neighbor class. + */ public Neighbor(String address, Integer numberOfAllTransactions, Integer numberOfInvalidTransactions, Integer numberOfNewTransactions) { this.address = address; this.numberOfAllTransactions = numberOfAllTransactions; @@ -18,18 +21,36 @@ public class Neighbor { this.numberOfNewTransactions = numberOfNewTransactions; } + /** + * Get the address. + * + * @return address The address. + */ public String getAddress() { return address; } + /** + * Get the number of all transactions. + * + * @return numberOfAllTransactions The number of all transactions. + */ public Integer getNumberOfAllTransactions() { return numberOfAllTransactions; } + /** + * Get the number of invalid transactions. + * @return numberOfInvalidTransactions The number of invalid transactions. + */ public Integer getNumberOfInvalidTransactions() { return numberOfInvalidTransactions; } + /** + * Get the number of nwe transactions. + * @return numberOfNewTransactions The number of new transactions. + */ public Integer getNumberOfNewTransactions() { return numberOfNewTransactions; } diff --git a/src/main/java/jota/model/Signature.java b/src/main/java/jota/model/Signature.java index db5e12c..f5f6f9f 100644 --- a/src/main/java/jota/model/Signature.java +++ b/src/main/java/jota/model/Signature.java @@ -9,25 +9,46 @@ import java.util.List; **/ public class Signature { - String address; - List signatureFragments; + private String address; + private List signatureFragments; + /** + * Initializes a new instance of the Signature class. + */ public Signature() { this.signatureFragments = new ArrayList<>(); } + /** + * Get the address. + * + * @return address The address. + */ public String getAddress() { return address; } + /** + * Set the address. + * + * @param address The address. + */ public void setAddress(String address) { this.address = address; } + /** + * Get the signatureFragments. + * @return signatureFragments The signatureFragments. + */ public List getSignatureFragments() { return signatureFragments; } + /** + * Set the signatureFragments. + * @param signatureFragments The signatureFragments. + */ public void setSignatureFragments(List signatureFragments) { this.signatureFragments = signatureFragments; } diff --git a/src/main/java/jota/model/Transaction.java b/src/main/java/jota/model/Transaction.java index b744040..a1fc6ff 100644 --- a/src/main/java/jota/model/Transaction.java +++ b/src/main/java/jota/model/Transaction.java @@ -16,6 +16,7 @@ import java.util.Arrays; * @author pinpong */ public class Transaction { + private static final Logger log = LoggerFactory.getLogger(Transaction.class); private ICurl customCurl; @@ -33,23 +34,38 @@ public class Transaction { private String nonce; private Boolean persistence; + /** + * Initializes a new instance of the Signature class. + */ public Transaction(ICurl curl) { customCurl = curl; } + /** + * Initializes a new instance of the Signature class. + */ public Transaction() { customCurl = null; } + /** + * Initializes a new instance of the Signature class. + */ public Transaction(String trytes) { transactionObject(trytes); } + /** + * Initializes a new instance of the Signature class. + */ public Transaction(String trytes, ICurl customCurl) { transactionObject(trytes); this.customCurl = customCurl; } + /** + * Initializes a new instance of the Signature class. + */ public Transaction(String signatureFragments, String currentIndex, String lastIndex, String nonce, String hash, String tag, String timestamp, String trunkTransaction, String branchTransaction, String address, String value, String bundle) { this.hash = hash; @@ -66,7 +82,9 @@ public class Transaction { this.nonce = nonce; } - + /** + * Initializes a new instance of the Signature class. + */ public Transaction(String address, String value, String tag, String timestamp) { this.address = address; this.value = value; @@ -74,111 +92,221 @@ public class Transaction { this.timestamp = timestamp; } + /** + * Returns a String that represents this object. + * + * @return Returns a string representation of this object. + */ @Override public String toString() { return ToStringBuilder.reflectionToString(this, ToStringStyle.MULTI_LINE_STYLE); } + /** + * Get the hash. + * + * @return hash The hash. + */ public String getHash() { return hash; } + /** + * Set the hash. + * @param hash The hash. + */ public void setHash(String hash) { this.hash = hash; } + /** + * Get the signature fragments. + * @return signatureFragments The signature fragments. + */ public String getSignatureFragments() { return signatureFragments; } + /** + * Set the signature fragments. + * @param signatureFragments The signature fragments. + */ public String setSignatureFragments(String signatureFragments) { return this.signatureFragments = signatureFragments; } + /** + * Get the address. + * @return address The address. + */ public String getAddress() { return address; } + /** + * Set the address. + * @param address The address. + */ public void setAddress(String address) { this.address = address; } + /** + * Get the value. + * @return value The value. + */ public String getValue() { return value; } + /** + * Set the value. + * @param value The value. + */ public void setValue(String value) { this.value = value; } + /** + * Get the tag. + * @return tag The tag. + */ public String getTag() { return tag; } + /** + * Set the tag. + * @param tag The tag. + */ public void setTag(String tag) { this.tag = tag; } + /** + * Get the timestamp. + * @return timestamp The timestamp. + */ public String getTimestamp() { return timestamp; } + /** + * Set the timestamp. + * @param timestamp The timestamp. + */ public void setTimestamp(String timestamp) { this.timestamp = timestamp; } + /** + * Get the current index. + * @return currentIndex The current index. + */ public String getCurrentIndex() { return currentIndex; } + /** + * Set the current index. + * @param currentIndex The current index. + */ public String setCurrentIndex(String currentIndex) { return this.currentIndex = currentIndex; } + /** + * Get the last index. + * @return lastIndex The last index. + */ public String getLastIndex() { return lastIndex; } + /** + * Set the last index. + * @param lastIndex The last index. + */ public String setLastIndex(String lastIndex) { return this.lastIndex = lastIndex; } + /** + * Get the bundle. + * @return bundle The bundle. + */ public String getBundle() { return bundle; } + /** + * Set the bundle. + * @param bundle The bundle. + */ public void setBundle(String bundle) { this.bundle = bundle; } + /** + * Get the trunk transaction. + * @return trunkTransaction The trunk transaction. + */ public String getTrunkTransaction() { return trunkTransaction; } + /** + * Set the trunk transaction. + * @param trunkTransaction The trunk transaction. + */ public void setTrunkTransaction(String trunkTransaction) { this.trunkTransaction = trunkTransaction; } + /** + * Get the branch transaction. + * @return branchTransaction The branch transaction. + */ public String getBranchTransaction() { return branchTransaction; } + /** + * Set the branch transaction. + * @param branchTransaction The branch transaction. + */ public void setBranchTransaction(String branchTransaction) { this.branchTransaction = branchTransaction; } + /** + * Get the nonce. + * @return nonce The nonce. + */ public String getNonce() { return nonce; } + /** + * Set the nonce. + * @param nonce The trunk nonce. + */ public void setNonce(String nonce) { this.nonce = nonce; } + /** + * Get the persistence. + * @return persistence The persistence. + */ public Boolean getPersistence() { return persistence; } + /** + * Set the persistence. + * @param persistence The persistence. + */ public void setPersistence(Boolean persistence) { this.persistence = persistence; } @@ -187,6 +315,10 @@ public class Transaction { return obj != null && ((Transaction) obj).getHash().equals(this.getHash()); } + + /** + * Converts the transaction to the corresponding trytes representation + */ public String toTrytes() { int[] valueTrits = Converter.trits(this.getValue(), 81); @@ -212,6 +344,9 @@ public class Transaction { + this.getNonce(); } + /** + * Initializes a new instance of the Signature class. + */ public void transactionObject(final String trytes) { if (StringUtils.isEmpty(trytes)) { diff --git a/src/main/java/jota/model/Transfer.java b/src/main/java/jota/model/Transfer.java index 645d2c3..50f9310 100644 --- a/src/main/java/jota/model/Transfer.java +++ b/src/main/java/jota/model/Transfer.java @@ -16,6 +16,9 @@ public class Transfer { private String message; private String tag; + /** + * Initializes a new instance of the Transfer class. + */ public Transfer(String timestamp, String address, String hash, Boolean persistence, long value, String message, String tag) { this.timestamp = timestamp; @@ -28,6 +31,9 @@ public class Transfer { } + /** + * Initializes a new instance of the Transfer class. + */ public Transfer(String address, long value, String message, String tag) { this.address = address; this.value = value; @@ -35,63 +41,125 @@ public class Transfer { this.tag = tag; } + /** + * Returns a Json Object that represents this object. + * + * @return Returns a string representation of this object. + */ @Override public String toString() { return new Gson().toJson(this); } + /** + * Get the address. + * + * @return address The address. + */ public String getAddress() { return address; } + /** + * Set the address + * @param address The address. + */ public void setAddress(String address) { this.address = address; } + /** + * Get the hash. + * @return hash The hash. + */ public String getHash() { return hash; } + /** + * Set the hash + * @param hash The hash. + */ public void setHash(String hash) { this.hash = hash; } + /** + * Get the persistence. + * @return persistence The persistence. + */ public Boolean getPersistence() { return persistence; } + /** + * Set the persistence + * @param persistence The persistence. + */ public void setPersistence(Boolean persistence) { this.persistence = persistence; } + /** + * Get the timestamp. + * @return timestamp The timestamp. + */ public String getTimestamp() { return timestamp; } + /** + * Set the timestamp + * @param timestamp The timestamp. + */ public void setTimestamp(String timestamp) { this.timestamp = timestamp; } + /** + * Get the value. + * @return value The value. + */ public long getValue() { return value; } + /** + * Set the value + * @param value The value. + */ public void setValue(long value) { this.value = value; } + /** + * Get the message. + * @return message The message. + */ public String getMessage() { return message; } + /** + * Set the message + * @param message The message. + */ public void setMessage(String message) { this.message = message; } + /** + * Get the tag. + * @return tag The tag. + */ public String getTag() { return tag; } + /** + * Set the tag + * @param tag The tag. + */ public void setTag(String tag) { this.tag = tag; } From 0df6a7c661491b7445a055bef850ba44713a9264 Mon Sep 17 00:00:00 2001 From: Oliver Nitzschke Date: Mon, 13 Feb 2017 18:40:02 +0100 Subject: [PATCH 28/45] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f061cff..aab45c5 100644 --- a/README.md +++ b/README.md @@ -60,7 +60,7 @@ Jota is still *not* in the central maven repository. It will be available when i - This is pre-release software! - There may be performance and stability issues. - You may loose all your money :) - - Please report any issues using the Issue Tracker" + - Please report any issues using the Issue Tracker That's it! From bc451b81aa285ee8bb3f904c133ccaa69006ddee Mon Sep 17 00:00:00 2001 From: pinpong Date: Tue, 14 Feb 2017 20:20:15 +0100 Subject: [PATCH 29/45] documentation --- src/main/java/jota/IotaAPI.java | 88 +++++++++++++---- src/main/java/jota/pow/ICurl.java | 48 ++++++++++ src/main/java/jota/utils/Checksum.java | 13 ++- src/main/java/jota/utils/Constants.java | 13 +++ src/main/java/jota/utils/Converter.java | 99 +++++++++++++++----- src/main/java/jota/utils/InputValidator.java | 63 +++++++------ src/main/java/jota/utils/IotaAPIUtils.java | 1 + src/main/java/jota/utils/IotaUnits.java | 23 ++++- src/test/java/jota/InputValidatorTest.java | 2 +- 9 files changed, 270 insertions(+), 80 deletions(-) diff --git a/src/main/java/jota/IotaAPI.java b/src/main/java/jota/IotaAPI.java index 09eaf94..5653a1c 100644 --- a/src/main/java/jota/IotaAPI.java +++ b/src/main/java/jota/IotaAPI.java @@ -46,6 +46,8 @@ public class IotaAPI extends IotaAPICore { * @param total Optional (default 1)Total number of addresses to generate * @param returnAll If true, it returns all addresses which were deterministically generated (until findTransactions returns null) * @return an array of strings with the specifed number of addresses + * @exception InvalidAddressException is thrown when the specified address is not an valid address + * @exception InvalidSecurityLevelException is thrown when the specified security level is not valid */ public GetNewAddressResponse getNewAddress(final String seed, int security, final int index, final boolean checksum, final int total, final boolean returnAll) throws InvalidSecurityLevelException, InvalidAddressException { @@ -94,7 +96,14 @@ public class IotaAPI extends IotaAPICore { * @param end end Ending key index * @param inclusionStates Optional (default false). If True, it gets the inclusion states of the transfers. * @return Bundle - **/ + * @exception InvalidAddressException is thrown when the specified address is not an valid address + * @throws ArgumentException + * @throws InvalidBundleException + * @throws InvalidSignatureException + * @throws NoNodeInfoException + * @throws NoInclusionStatesExcpection + * @exception InvalidSecurityLevelException is thrown when the specified security level is not valid + */ public GetTransferResponse getTransfers(String seed, int security, Integer start, Integer end, Boolean inclusionStates) throws ArgumentException, InvalidBundleException, InvalidSignatureException, NoNodeInfoException, NoInclusionStatesExcpection, InvalidSecurityLevelException, InvalidAddressException { StopWatch stopWatch = new StopWatch(); // validate & if needed pad seed @@ -317,11 +326,15 @@ public class IotaAPI extends IotaAPICore { * @param remainder Optional (default null). if defined, this address will be used for sending the remainder value (of the inputs) to. * @param inputs the inputs * @return trytes Returns bundle trytes - **/ + * @exception InvalidAddressException is thrown when the specified address is not an valid address + * @throws NotEnoughBalanceException + * @exception InvalidSecurityLevelException is thrown when the specified security level is not valid + * @throws InvalidTransferException + */ public List prepareTransfers(String seed, int security, final List transfers, String remainder, List inputs) throws NotEnoughBalanceException, InvalidSecurityLevelException, InvalidAddressException, InvalidTransferException { // Input validation of transfers object - if (!InputValidator.isTransfersCollectionCorrect(transfers)) { + if (!InputValidator.isTransfersCollectionValid(transfers)) { throw new InvalidTransferException(); } @@ -475,6 +488,9 @@ public class IotaAPI extends IotaAPICore { * @param start start Starting key index * @param end end Ending key index * @param threshold threshold Min balance required + * @exception InvalidAddressException is thrown when the specified address is not an valid address + * @exception InvalidSecurityLevelException + **/ public GetBalancesAndFormatResponse getInputs(String seed, int security, int start, int end, long threshold) throws InvalidSecurityLevelException, InvalidAddressException { StopWatch stopWatch = new StopWatch(); @@ -525,7 +541,6 @@ public class IotaAPI extends IotaAPICore { } } - /** * Gets the balances and formats the output * @@ -536,6 +551,7 @@ public class IotaAPI extends IotaAPICore { * @param stopWatch the stopwatch * @param security security secuirty level of private key / seed * @return Inputs object + * @exception InvalidSecurityLevelException is thrown when the specified security level is not valid **/ public GetBalancesAndFormatResponse getBalanceAndFormat(final List addresses, long threshold, int start, int end, StopWatch stopWatch, int security) throws InvalidSecurityLevelException { @@ -583,7 +599,10 @@ public class IotaAPI extends IotaAPICore { * Does validation of signatures, total sum as well as bundle order * @param transaction the transaction encoded in trytes * @return an array of bundle, if there are multiple arrays it means that there are conflicting bundles. - **/ + * @throws ArgumentException + * @throws InvalidBundleException + * @throws InvalidSignatureException + */ public GetBundleResponse getBundle(String transaction) throws ArgumentException, InvalidBundleException, InvalidSignatureException { StopWatch stopWatch = new StopWatch(); @@ -666,7 +685,11 @@ public class IotaAPI extends IotaAPICore { * @param depth the depth * @param minWeightMagnitude the minimum weight magnitude * @return analyzed Transaction objects - **/ + * @throws InvalidBundleException + * @throws ArgumentException + * @throws InvalidSignatureException + * @throws InvalidTrytesException + */ public ReplayBundleResponse replayBundle(String transaction, int depth, int minWeightMagnitude) throws InvalidBundleException, ArgumentException, InvalidSignatureException, InvalidTrytesException { StopWatch stopWatch = new StopWatch(); @@ -699,7 +722,8 @@ public class IotaAPI extends IotaAPICore { * * @param hashes the hashes * @return inclusion state - **/ + * @throws NoNodeInfoException + */ public GetInclusionStateResponse getLatestInclusion(String[] hashes) throws NoNodeInfoException { GetNodeInfoResponse getNodeInfoResponse = getNodeInfo(); if (getNodeInfoResponse == null) throw new NoNodeInfoException(); @@ -712,16 +736,21 @@ public class IotaAPI extends IotaAPICore { /** * Wrapper function that basically does prepareTransfers, as well as attachToTangle and finally, it broadcasts and stores the transactions locally. * - * @param seed tryte-encoded seed - * @param security security secuirty level of private key / seed - * @param depth the depth + * @param seed tryte-encoded seed + * @param security security secuirty level of private key / seed + * @param depth the depth * @param minWeightMagnitude the minimum weight magnitude - * @param transfers array of transfer objects - * @param inputs Option (default null). List of inputs used for funding the transfer - * @param address if defined, this address will be used for sending the remainder value (of the inputs) to + * @param transfers array of transfer objects + * @param inputs List of inputs used for funding the transfer + * @param address if defined, this address will be used for sending the remainder value (of the inputs) to * @return array of Transaction objects - **/ - + * @exception InvalidAddressException is thrown when the specified address is not an valid address + * @throws NotEnoughBalanceException + * @exception InvalidSecurityLevelException is thrown when the specified security level is not valid + * @throws InvalidTrytesException + * @throws InvalidAddressException + * @throws InvalidTransferException + */ public SendTransferResponse sendTransfer(String seed, int security, int depth, int minWeightMagnitude, final List transfers, Input[] inputs, String address) throws NotEnoughBalanceException, InvalidSecurityLevelException, InvalidTrytesException, InvalidAddressException, InvalidTransferException { if (security < 1 || security > 3) { @@ -754,7 +783,8 @@ public class IotaAPI extends IotaAPICore { * @param bundleHash the bundle hashes * @param bundle List of bundles to be populated * @return bundle Transaction objects - **/ + * @throws ArgumentException + */ public Bundle traverseBundle(String trunkTx, String bundleHash, Bundle bundle) throws ArgumentException { GetTrytesResponse gtr = getTrytes(trunkTx); @@ -805,7 +835,10 @@ public class IotaAPI extends IotaAPICore { * @param inputAddress array of input addresses as well as the securitySum * @param remainderAddress has to be generated by the cosigners before initiating the transfer, can be null if fully spent * @return bundle of transaction objects - **/ + * @throws InvalidAddressException + * @throws InvalidBundleException + * @exception InvalidAddressException is thrown when the specified address is not an valid address + */ private GetTransferResponse initiateTransfer(int securitySum, final List inputAddress, String remainderAddress, final List transfers) throws InvalidAddressException, InvalidBundleException, InvalidTransferException { StopWatch sw = new StopWatch(); @@ -824,7 +857,7 @@ public class IotaAPI extends IotaAPICore { } // Input validation of transfers object - if (!InputValidator.isTransfersCollectionCorrect(transfers)) { + if (!InputValidator.isTransfersCollectionValid(transfers)) { throw new InvalidTransferException(); } @@ -970,6 +1003,11 @@ public class IotaAPI extends IotaAPICore { } + /** + * @param hash The hash. + * @return + * @throws ArgumentException + */ public String findTailTransactionHash(String hash) throws ArgumentException { GetTrytesResponse gtr = getTrytes(hash); @@ -987,6 +1025,20 @@ public class IotaAPI extends IotaAPICore { else return findTailTransactionHash(trx.getBundle()); } + /** + * @param seed tryte-encoded seed + * @param security security secuirty level of private key / seed + * @param inputs List of inputs used for funding the transfer + * @param bundle to be populated + * @param tag the tag. + * @param totalValue The total value. + * @param remainderAddress if defined, this address will be used for sending the remainder value (of the inputs) to + * @param signatureFragments The signature fragments. + * @return + * @throws NotEnoughBalanceException + * @throws InvalidSecurityLevelException is thrown when the specified security level is not valid + * @throws InvalidAddressException is thrown when the specified address is not an valid address + */ public List addRemainder(final String seed, final int security, final List inputs, diff --git a/src/main/java/jota/pow/ICurl.java b/src/main/java/jota/pow/ICurl.java index 0933ab1..bfaf113 100644 --- a/src/main/java/jota/pow/ICurl.java +++ b/src/main/java/jota/pow/ICurl.java @@ -1,24 +1,72 @@ package jota.pow; /** + * This interface abstracts the curl hashing algorithm * @author Adrian */ public interface ICurl { + + /** + * Absorbs the specified trits. + * + * @param trits The trits. + * @param offset The offset to start from. + * @param length The length. + * @return + */ ICurl absorb(final int[] trits, int offset, int length); + /** + * Absorbs the specified trits. + * + * @param trits The trits. + * @return + */ ICurl absorb(final int[] trits); + /** + * Squeezes the specified trits. + * @param trits The trits. + * @param offset The offset to start from. + * @param length The length. + * @return + */ int[] squeeze(final int[] trits, int offset, int length); + /** + * Squeezes the specified trits. + * @param trits The trits. + * @return + */ int[] squeeze(final int[] trits); + /** + * Transforms this instance. + * @return + */ ICurl transform(); + /** + * Resets this state. + * @return + */ ICurl reset(); + /** + * Gets or sets the state. + * @return + */ int[] getState(); + /** + * Sets or sets the state. + * @param state + */ void setState(int[] state); + /** + * Clones this instance. + * @return + */ ICurl clone(); } diff --git a/src/main/java/jota/utils/Checksum.java b/src/main/java/jota/utils/Checksum.java index e33bd21..ff901b3 100644 --- a/src/main/java/jota/utils/Checksum.java +++ b/src/main/java/jota/utils/Checksum.java @@ -10,10 +10,11 @@ import jota.pow.JCurl; public class Checksum { /** - * adds the checksum to the specified address + * Adds the checksum to the specified address * * @param address address without checksum * @return the address with the appended checksum + * @exception InvalidAddressException is thrown when the specified address is not an valid address **/ public static String addChecksum(String address) throws InvalidAddressException { InputValidator.checkAddress(address); @@ -23,10 +24,11 @@ public class Checksum { } /** - * remove the checksum to the specified address + * Remove the checksum to the specified address * * @param address address with checksum * @return the address without checksum + * @exception InvalidAddressException is thrown when the specified address is not an address with checksum **/ public static String removeChecksum(String address) throws InvalidAddressException { if (isAddressWithChecksum(address)) { @@ -46,10 +48,11 @@ public class Checksum { } /** - * check if checksum is valid + * Determines whether the specified address with checksum has a valid checksum. * * @param addressWithChecksum address - * @return boolean + * @return true if the specified address with checksum has a valid checksum [the specified address with checksum]; otherwise, false. + * @exception InvalidAddressException is thrown when the specified address is not an valid address **/ public static boolean isValidChecksum(String addressWithChecksum) throws InvalidAddressException { String addressWithoutChecksum = removeChecksum(addressWithChecksum); @@ -63,6 +66,7 @@ public class Checksum { * * @param address address * @return boolean + * @exception InvalidAddressException is thrown when the specified address is not an valid address **/ public static boolean isAddressWithChecksum(String address) throws InvalidAddressException { return InputValidator.checkAddress(address) && address.length() == Constants.ADDRESS_LENGTH_WITH_CHECKSUM; @@ -74,6 +78,7 @@ public class Checksum { * * @param address address * @return boolean + * @exception InvalidAddressException is thrown when the specified address is not an valid address **/ public static boolean isAddressWithoutChecksum(String address) throws InvalidAddressException { return InputValidator.checkAddress(address) && address.length() == Constants.ADDRESS_LENGTH_WITHOUT_CHECKSUM; diff --git a/src/main/java/jota/utils/Constants.java b/src/main/java/jota/utils/Constants.java index 8a3a393..bdcd419 100644 --- a/src/main/java/jota/utils/Constants.java +++ b/src/main/java/jota/utils/Constants.java @@ -6,10 +6,23 @@ package jota.utils; */ public class Constants { + /** + * This String contains all possible characters of the tryte alphabet + */ public static final String TRYTE_ALPHABET = "9ABCDEFGHIJKLMNOPQRSTUVWXYZ"; + /** + * The maximum seed length + */ public static final int SEED_LENGTH_MAX = 81; + /** + * The length of an address without checksum + */ public static int ADDRESS_LENGTH_WITHOUT_CHECKSUM = 81; + + /** + * The length of an address with checksum + */ public static int ADDRESS_LENGTH_WITH_CHECKSUM = 90; } diff --git a/src/main/java/jota/utils/Converter.java b/src/main/java/jota/utils/Converter.java index 31628fd..3bbc888 100644 --- a/src/main/java/jota/utils/Converter.java +++ b/src/main/java/jota/utils/Converter.java @@ -4,12 +4,29 @@ import java.util.Arrays; import java.util.LinkedList; import java.util.List; +/** + * This class provides a set of utility methods to are used to convert between different formats + */ public class Converter { + /** + * The radix + */ private static final int RADIX = 3; + + /** + * The maximum trit value + */ private static final int MAX_TRIT_VALUE = (RADIX - 1) / 2, MIN_TRIT_VALUE = -MAX_TRIT_VALUE; + /** + * The number of trits in a byte + */ private static final int NUMBER_OF_TRITS_IN_A_BYTE = 5; + + /** + * The number of trits in a tryte + */ private static final int NUMBER_OF_TRITS_IN_A_TRYTE = 3; private static final int[][] BYTE_TO_TRITS_MAPPINGS = new int[243][]; private static final int[][] TRYTE_TO_TRITS_MAPPINGS = new int[27][]; @@ -29,6 +46,14 @@ public class Converter { } } + /** + * Converts the specified trits array to bytes + * + * @param trits The trits. + * @param offset The offset to start from. + * @param size The size. + * @return bytes + */ public static byte[] bytes(final int[] trits, final int offset, final int size) { final byte[] bytes = new byte[(size + NUMBER_OF_TRITS_IN_A_BYTE - 1) / NUMBER_OF_TRITS_IN_A_BYTE]; @@ -48,6 +73,12 @@ public class Converter { return bytes(trits, 0, trits.length); } + /** + * Gets the trits from the specified bytes and stores it into the provided trits array + * + * @param bytes The bytes. + * @param trits The trits. + */ public static void getTrits(final byte[] bytes, final int[] trits) { int offset = 0; @@ -68,6 +99,13 @@ public class Converter { return ret; } + /** + * Converts the specified trinary encoded string into a trits array of the specified length. + * + * @param trytes The trytes. + * @param length The length + * @return a trits array. + */ public static int[] trits(final String trytes, int length) { int[] trits = trits(trytes); @@ -82,6 +120,12 @@ public class Converter { return convertToIntArray(tritsList); } + /** + * Converts the specified trinary encoded trytes string to trits + * + * @param trytes The trytes. + * @return a trits array + */ public static int[] tritsString(final String trytes) { int[] d = new int[3 * trytes.length()]; for (int i = 0; i < trytes.length(); i++) { @@ -133,29 +177,13 @@ public class Converter { return convertToIntArray(trits); } - public static void copyTrits(final long value, final int[] destination, final int offset, final int size) { - - long absoluteValue = value < 0 ? -value : value; - for (int i = 0; i < size; i++) { - - int remainder = (int) (absoluteValue % RADIX); - absoluteValue /= RADIX; - if (remainder > MAX_TRIT_VALUE) { - - remainder = MIN_TRIT_VALUE; - absoluteValue++; - } - destination[offset + i] = remainder; - } - - if (value < 0) { - - for (int i = 0; i < size; i++) { - destination[offset + i] = -destination[offset + i]; - } - } - } - + /** + * Copies the trits from the input string into the destination array + * + * @param input The input String. + * @param destination The destination array. + * @return destination The destination. + */ public static int[] copyTrits(final String input, final int[] destination) { for (int i = 0; i < input.length(); i++) { int index = Constants.TRYTE_ALPHABET.indexOf(input.charAt(i)); @@ -193,10 +221,23 @@ public class Converter { return trytes(trits, 0, trits.length); } + /** + * Converts the specified trits array to trytes in integer representation + * + * @param trits The trits. + * @param offset The offset. + * @return value The value. + */ public static int tryteValue(final int[] trits, final int offset) { return trits[offset] + trits[offset + 1] * 3 + trits[offset + 2] * 9; } + /** + * Converts the specified trits to its corresponding integer value + * + * @param trits The trits. + * @return value The value. + */ public static int value(final int[] trits) { int value = 0; @@ -206,6 +247,12 @@ public class Converter { return value; } + /** + * Converts the specified trits to its corresponding integer value + * + * @param trits The trits. + * @return value The value + */ public static long longValue(final int[] trits) { long value = 0; @@ -215,6 +262,12 @@ public class Converter { return value; } + /** + * Increments the specified trits. + * + * @param trits The trits. + * @param size The size. + */ public static void increment(final int[] trits, final int size) { for (int i = 0; i < size; i++) { diff --git a/src/main/java/jota/utils/InputValidator.java b/src/main/java/jota/utils/InputValidator.java index f1a2dea..2c5f3c0 100644 --- a/src/main/java/jota/utils/InputValidator.java +++ b/src/main/java/jota/utils/InputValidator.java @@ -14,10 +14,10 @@ import java.util.List; public class InputValidator { /** - * validates an address + * Determines whether the specified string is an adrdress. * * @param address address to validate - * @return boolean + * @return true if the specified string is an address; otherwise, false. **/ public static boolean isAddress(String address) { return (address.length() == Constants.ADDRESS_LENGTH_WITHOUT_CHECKSUM || @@ -25,10 +25,11 @@ public class InputValidator { } /** - * checks whether the specified address is an address + * Checks whether the specified address is an address and throws and exception if the address is invalid * * @param address address to validate - * @return boolean + * @return true if the specified string is an address; otherwise, false. + * @exception InvalidAddressException is thrown when the specified address is not an valid address **/ public static boolean checkAddress(String address) throws InvalidAddressException { if (!isAddress(address)) { @@ -38,42 +39,42 @@ public class InputValidator { } /** - * checks if input is correct trytes consisting of A-Z9 optionally validates length + * Determines whether the specified string contains only characters from the trytes alphabet (see ) * * @param trytes the trytes * @param length the length - * @return boolean + * @return true if the specified trytes are trytes otherwise, false. **/ public static boolean isTrytes(final String trytes, final int length) { return trytes.matches("^[A-Z9]{" + (length == 0 ? "0," : length) + "}$"); } /** - * checks if input is correct trytes consisting of 9 optionally validates length + * Determines whether the specified string consist only of '9'. * - * @param trytes the trytes - * @param length the length - * @return boolean + * @param trytes The trytes. + * @param length The length. + * @return true if the specified string consist only of '9'; otherwise, false. **/ public static boolean isNinesTrytes(final String trytes, final int length) { return trytes.matches("^[9]{" + (length == 0 ? "0," : length) + "}$"); } /** - * determines whether the specified string represents a signed integer + * Determines whether the specified string represents a signed integer * * @param value the value - * @return boolean + * @return true the specified string represents an integer value; otherwise, false. **/ public static boolean isValue(final String value) { return NumberUtils.isNumber(value); } /** - * determines whether the specified string represents a signed integer + * Determines whether the specified string array contains only trytes * - * @param trytes the trytes - * @return boolean + * @param trytes The trytes. + * @return true if the specified array contains only valid trytes otherwise, false. **/ public static boolean isArrayOfTrytes(String[] trytes){ for (String tryte : trytes) { @@ -86,10 +87,10 @@ public class InputValidator { } /** - * checks if input is array of hashes + * Determines whether the specified array contains only valid hashes * - * @param hashes - * @return boolean + * @param hashes The hashes. + * @return true the specified array contains only valid hashes; otherwise, false. **/ public static boolean isArrayOfHashes(String[] hashes) { if (hashes == null) @@ -111,15 +112,15 @@ public class InputValidator { } /** - * checks if input is correct hash collections + * Determines whether the specified transfers are valid * - * @param transfers - * @return boolean + * @param transfers The transfers. + * @return true if the specified transfers are valid; otherwise, false. **/ - public static boolean isTransfersCollectionCorrect(final List transfers) { + public static boolean isTransfersCollectionValid(final List transfers) { for (final Transfer transfer : transfers) { - if (!isTransfer(transfer)) { + if (!isValidTransfer(transfer)) { return false; } } @@ -127,12 +128,12 @@ public class InputValidator { } /** - * checks if input is correct transfer + * Determines whether the specified transfer is valid. * - * @param transfer - * @return boolean + * @param transfer The transfer. + * @return true if the specified transfer is valid; otherwise, false. **/ - public static boolean isTransfer(final Transfer transfer) { + public static boolean isValidTransfer(final Transfer transfer) { if (!isAddress(transfer.getAddress())) { return false; @@ -148,14 +149,18 @@ public class InputValidator { } /** - * validate the seed + * Checks if the seed is valid. If not, an exception is thrown. * * @param seed the seed * @return validated seed + * @exception IllegalStateException Format not in trytes or Invalid Seed: Seed too long **/ public static String validateSeed(String seed) { if (seed.length() > 81) - return null; + throw new IllegalStateException("Invalid Seed: Seed too long"); + + if (!isTrytes(seed, seed.length())) + throw new IllegalStateException("Invalid Seed: Format not in trytes"); seed = StringUtils.rightPad(seed, 81, '9'); diff --git a/src/main/java/jota/utils/IotaAPIUtils.java b/src/main/java/jota/utils/IotaAPIUtils.java index 0fdf9d8..db38396 100644 --- a/src/main/java/jota/utils/IotaAPIUtils.java +++ b/src/main/java/jota/utils/IotaAPIUtils.java @@ -27,6 +27,7 @@ public class IotaAPIUtils { * @param checksum adds 9-tryte address checksum * @param curl * @return an String with address + * @exception InvalidAddressException is thrown when the specified address is not an valid address */ public static String newAddress(String seed, int security, int index, boolean checksum, ICurl curl) throws InvalidAddressException { Signing signing = new Signing(curl); diff --git a/src/main/java/jota/utils/IotaUnits.java b/src/main/java/jota/utils/IotaUnits.java index bb7bb09..8860f63 100644 --- a/src/main/java/jota/utils/IotaUnits.java +++ b/src/main/java/jota/utils/IotaUnits.java @@ -7,24 +7,37 @@ package jota.utils; public enum IotaUnits { IOTA("i", 0), - KILO_IOTA("Ki", 3), - MEGA_IOTA("Mi", 6), - GIGA_IOTA("Gi", 9), - TERA_IOTA("Ti", 12), - PETA_IOTA("Pi", 15); + KILO_IOTA("Ki", 3), // 10^3 + MEGA_IOTA("Mi", 6), // 10^6 + GIGA_IOTA("Gi", 9), // 10^9 + TERA_IOTA("Ti", 12), // 10^12 + PETA_IOTA("Pi", 15); // 10^15 private String unit; private long value; + /** + * Initializes a new instance of the IotaUnit class. + */ IotaUnits(String unit, long value) { this.unit = unit; this.value = value; } + /** + * Gets the unit. + * + * @return unit The IOTA Unit. + */ public String getUnit() { return unit; } + /** + * Gets the value. + * + * @return unit The value. + */ public long getValue() { return value; } diff --git a/src/test/java/jota/InputValidatorTest.java b/src/test/java/jota/InputValidatorTest.java index 244dacc..a636ca9 100644 --- a/src/test/java/jota/InputValidatorTest.java +++ b/src/test/java/jota/InputValidatorTest.java @@ -52,6 +52,6 @@ public class InputValidatorTest { List transfers = new ArrayList<>(); transfers.add(new jota.model.Transfer(TEST_ADDRESS_WITH_CHECKSUM, 0, TEST_MESSAGE, TEST_TAG)); transfers.add(new jota.model.Transfer(TEST_ADDRESS_WITH_CHECKSUM, 0, TEST_MESSAGE, TEST_TAG)); - assertEquals(InputValidator.isTransfersCollectionCorrect(transfers), true); + assertEquals(InputValidator.isTransfersCollectionValid(transfers), true); } } \ No newline at end of file From 8cb20c2792f76a396b0b2da4ec3d7faeaac2f58c Mon Sep 17 00:00:00 2001 From: pinpong Date: Tue, 14 Feb 2017 20:58:35 +0100 Subject: [PATCH 30/45] documentation --- .../request/IotaAttachToTangleRequest.java | 40 +++++++++++ .../IotaBroadcastTransactionRequest.java | 16 +++++ .../request/IotaFindTransactionsRequest.java | 40 +++++++++++ .../dto/request/IotaGetBalancesRequest.java | 24 +++++++ .../request/IotaGetInclusionStateRequest.java | 27 ++++++++ .../IotaGetTransactionsToApproveRequest.java | 16 +++++ .../dto/request/IotaGetTrytesRequest.java | 16 +++++ .../dto/request/IotaNeighborsRequest.java | 19 ++++++ .../request/IotaStoreTransactionsRequest.java | 16 +++++ .../dto/response/AddNeighborsResponse.java | 5 ++ .../response/AnalyzeTransactionResponse.java | 5 ++ .../dto/response/FindTransactionResponse.java | 6 ++ .../response/GetAttachToTangleResponse.java | 8 +++ .../GetBalancesAndFormatResponse.java | 21 ++++++ .../dto/response/GetBalancesResponse.java | 14 ++++ .../jota/dto/response/GetBundleResponse.java | 9 ++- .../response/GetInclusionStateResponse.java | 5 ++ .../dto/response/GetNeighborsResponse.java | 5 ++ .../dto/response/GetNewAddressResponse.java | 8 +++ .../dto/response/GetNodeInfoResponse.java | 68 +++++++++++++++++++ .../jota/dto/response/GetTipsResponse.java | 5 ++ .../GetTransactionsToApproveResponse.java | 10 +++ .../dto/response/GetTransferResponse.java | 8 +++ .../jota/dto/response/GetTrytesResponse.java | 5 ++ .../dto/response/RemoveNeighborsResponse.java | 5 ++ .../dto/response/ReplayBundleResponse.java | 13 ++++ .../dto/response/SendTransferResponse.java | 13 ++++ .../response/StoreTransactionsResponse.java | 4 ++ .../java/jota/error/ArgumentException.java | 3 + src/main/java/jota/error/BaseException.java | 3 + .../jota/error/NotEnoughBalanceException.java | 3 + 31 files changed, 439 insertions(+), 1 deletion(-) diff --git a/src/main/java/jota/dto/request/IotaAttachToTangleRequest.java b/src/main/java/jota/dto/request/IotaAttachToTangleRequest.java index 6767a33..7542f48 100644 --- a/src/main/java/jota/dto/request/IotaAttachToTangleRequest.java +++ b/src/main/java/jota/dto/request/IotaAttachToTangleRequest.java @@ -13,6 +13,9 @@ public class IotaAttachToTangleRequest extends IotaCommandRequest { private Integer minWeightMagnitude; private String[] trytes; + /** + * Initializes a new instance of the IotaAttachedToTangleRequest class. + */ private IotaAttachToTangleRequest(final String trunkTransaction, final String branchTransaction, final Integer minWeightMagnitude, final String... trytes) { super(IotaAPICommands.ATTACH_TO_TANGLE); this.trunkTransaction = trunkTransaction; @@ -21,38 +24,75 @@ public class IotaAttachToTangleRequest extends IotaCommandRequest { this.trytes = trytes; } + /** + * Create a new instance of the IotaAttachedToTangleRequest class. + */ public static IotaAttachToTangleRequest createAttachToTangleRequest(final String trunkTransaction, final String branchTransaction, final Integer minWeightMagnitude, final String... trytes) { return new IotaAttachToTangleRequest(trunkTransaction, branchTransaction, minWeightMagnitude, trytes); } + /** + * Gets the trunk transaction. + * + * @return trunkTransaction The trunk transaction. + */ public String getTrunkTransaction() { return trunkTransaction; } + /** + * Sets the trunk transaction. + * + * @param trunkTransaction The trunk transaction. + */ public void setTrunkTransaction(String trunkTransaction) { this.trunkTransaction = trunkTransaction; } + /** + * Gets the brancht ransaction. + * @return branchTransaction The branch transaction. + */ public String getBranchTransaction() { return branchTransaction; } + /** + * Sets the branch transaction. + * @param branchTransaction the branch transaction. + */ public void setBranchTransaction(String branchTransaction) { this.branchTransaction = branchTransaction; } + /** + * Gets the min weight magnitude. + * @return minWeightMagnitude The min weight magnitude. + */ public Integer getMinWeightMagnitude() { return minWeightMagnitude; } + /** + * Sets the min weight magnitude. + * @param minWeightMagnitude The min weight magnitude. + */ public void setMinWeightMagnitude(Integer minWeightMagnitude) { this.minWeightMagnitude = minWeightMagnitude; } + /** + * Gets the trytes. + * @return trytes The trytes. + */ public String[] getTrytes() { return trytes; } + /** + * Sets the trytes. + * @param trytes The trytes. + */ public void setTrytes(String[] trytes) { this.trytes = trytes; } diff --git a/src/main/java/jota/dto/request/IotaBroadcastTransactionRequest.java b/src/main/java/jota/dto/request/IotaBroadcastTransactionRequest.java index e416151..3885981 100644 --- a/src/main/java/jota/dto/request/IotaBroadcastTransactionRequest.java +++ b/src/main/java/jota/dto/request/IotaBroadcastTransactionRequest.java @@ -9,19 +9,35 @@ public class IotaBroadcastTransactionRequest extends IotaCommandRequest { private String[] trytes; + /** + * Initializes a new instance of the IotaBroadcastTransactionRequest class. + */ private IotaBroadcastTransactionRequest(final String... trytes) { super(IotaAPICommands.BROADCAST_TRANSACTIONS); this.trytes = trytes; } + /** + * Initializes a new instance of the IotaBroadcastTransactionRequest class. + */ public static IotaBroadcastTransactionRequest createBroadcastTransactionsRequest(final String... trytes) { return new IotaBroadcastTransactionRequest(trytes); } + /** + * Gets the trytes. + * + * @return trytes The trytes. + */ public String[] getTrytes() { return trytes; } + /** + * Sets the trytes. + * + * @param trytes The trytes. + */ public void setTrytes(String[] trytes) { this.trytes = trytes; } diff --git a/src/main/java/jota/dto/request/IotaFindTransactionsRequest.java b/src/main/java/jota/dto/request/IotaFindTransactionsRequest.java index c3c92cb..9f8fa09 100644 --- a/src/main/java/jota/dto/request/IotaFindTransactionsRequest.java +++ b/src/main/java/jota/dto/request/IotaFindTransactionsRequest.java @@ -12,42 +12,82 @@ public class IotaFindTransactionsRequest extends IotaCommandRequest { private String[] tags; private String[] approvees; + /** + * Initializes a new instance of the IotaFindTransactionsRequest class. + */ private IotaFindTransactionsRequest() { super(IotaAPICommands.FIND_TRANSACTIONS); } + /** + * Create a new instance of the IotaFindTransactionsRequest class. + */ public static IotaFindTransactionsRequest createFindTransactionRequest() { return new IotaFindTransactionsRequest(); } + /** + * Gets the bundles. + * + * @return bundles The bundles. + */ public String[] getBundles() { return bundles; } + /** + * Sets the bundles. + * + * @param bundles The bundles. + */ public void setBundles(String[] bundles) { this.bundles = bundles; } + /** + * Gets the addresses. + * @return addresses The addresses. + */ public String[] getAddresses() { return addresses; } + /** + * Sets the addresses. + * @param addresses The addresses. + */ public void setAddresses(String[] addresses) { this.addresses = addresses; } + /** + * Gets the tags. + * @return tags The tags. + */ public String[] getTags() { return tags; } + /** + * Sets the tags. + * @param tags The tags. + */ public void setTags(String[] tags) { this.tags = tags; } + /** + * Gets the approvees. + * @return approvees The approvees. + */ public String[] getApprovees() { return approvees; } + /** + * Sets the approvees. + * @param approvees The approvees. + */ public void setApprovees(String[] approvees) { this.approvees = approvees; } diff --git a/src/main/java/jota/dto/request/IotaGetBalancesRequest.java b/src/main/java/jota/dto/request/IotaGetBalancesRequest.java index c71105d..017a8f4 100644 --- a/src/main/java/jota/dto/request/IotaGetBalancesRequest.java +++ b/src/main/java/jota/dto/request/IotaGetBalancesRequest.java @@ -10,28 +10,52 @@ public class IotaGetBalancesRequest extends IotaCommandRequest { private String[] addresses; private Integer threshold; + /** + * Initializes a new instance of the IotaGetBalancesRequest class. + */ private IotaGetBalancesRequest(final Integer threshold, final String... addresses) { super(IotaAPICommands.GET_BALANCES); this.addresses = addresses; this.threshold = threshold; } + /** + * Create a new instance of the IotaGetBalancesRequest class. + */ public static IotaGetBalancesRequest createIotaGetBalancesRequest(final Integer threshold, final String... addresses) { return new IotaGetBalancesRequest(threshold, addresses); } + /** + * Gets the addresses. + * + * @return addresses The addresses. + */ public String[] getAddresses() { return addresses; } + /** + * Sets the addresses. + * + * @param addresses The addresses. + */ public void setAddresses(String[] addresses) { this.addresses = addresses; } + /** + * Gets the threshold. + * @return threshold The threshold. + */ public Integer getThreshold() { return threshold; } + /** + * Sets the threshold. + * @param threshold The threshold. + */ public void setThreshold(Integer threshold) { this.threshold = threshold; } diff --git a/src/main/java/jota/dto/request/IotaGetInclusionStateRequest.java b/src/main/java/jota/dto/request/IotaGetInclusionStateRequest.java index 30eb870..b6e7ca9 100644 --- a/src/main/java/jota/dto/request/IotaGetInclusionStateRequest.java +++ b/src/main/java/jota/dto/request/IotaGetInclusionStateRequest.java @@ -12,34 +12,61 @@ public class IotaGetInclusionStateRequest extends IotaCommandRequest { private String[] transactions; private String[] tips; + /** + * Initializes a new instance of the IotaGetInclusionStateRequest class. + */ private IotaGetInclusionStateRequest(final String[] transactions, final String[] tips) { super(IotaAPICommands.GET_INCLUSIONS_STATES); this.transactions = transactions; this.tips = tips; } + /** + * Create a new instance of the IotaGetInclusionStateRequest class. + */ public static IotaGetInclusionStateRequest createGetInclusionStateRequest(String[] transactions, String[] tips) { return new IotaGetInclusionStateRequest(transactions, tips); } + /** + * Create a new instance of the IotaGetInclusionStateRequest class. + */ public static IotaGetInclusionStateRequest createGetInclusionStateRequest(Collection transactions, Collection tips) { return createGetInclusionStateRequest( transactions.toArray(new String[]{}), tips.toArray(new String[]{})); } + /** + * Gets the transactions. + * + * @return transactions The transactions. + */ public String[] getTransactions() { return transactions; } + /** + * Sets the transactions. + * + * @param transactions The transactions. + */ public void setTransactions(String[] transactions) { this.transactions = transactions; } + /** + * Gets the tips. + * @return tips The tips. + */ public String[] getTips() { return tips; } + /** + * Sets the tips. + * @param tips The tips. + */ public void setTips(String[] tips) { this.tips = tips; } diff --git a/src/main/java/jota/dto/request/IotaGetTransactionsToApproveRequest.java b/src/main/java/jota/dto/request/IotaGetTransactionsToApproveRequest.java index 7d8d090..250ff74 100644 --- a/src/main/java/jota/dto/request/IotaGetTransactionsToApproveRequest.java +++ b/src/main/java/jota/dto/request/IotaGetTransactionsToApproveRequest.java @@ -9,19 +9,35 @@ public class IotaGetTransactionsToApproveRequest extends IotaCommandRequest { private Integer depth; + /** + * Initializes a new instance of the IotaGetTransactionsToApproveRequest class. + */ private IotaGetTransactionsToApproveRequest(final Integer depth) { super(IotaAPICommands.GET_TRANSACTIONS_TO_APPROVE); this.depth = depth; } + /** + * Create a new instance of the IotaGetTransactionsToApproveRequest class. + */ public static IotaGetTransactionsToApproveRequest createIotaGetTransactionsToApproveRequest(Integer depth) { return new IotaGetTransactionsToApproveRequest(depth); } + /** + * Gets the depth. + * + * @return depth The depth. + */ public Integer getDepth() { return depth; } + /** + * Sets the depth. + * + * @param depth The depth. + */ public void setDepth(Integer depth) { this.depth = depth; } diff --git a/src/main/java/jota/dto/request/IotaGetTrytesRequest.java b/src/main/java/jota/dto/request/IotaGetTrytesRequest.java index fa33cba..f4738c2 100644 --- a/src/main/java/jota/dto/request/IotaGetTrytesRequest.java +++ b/src/main/java/jota/dto/request/IotaGetTrytesRequest.java @@ -9,19 +9,35 @@ public class IotaGetTrytesRequest extends IotaCommandRequest { private String[] hashes; + /** + * Initializes a new instance of the IotaGetTrytesRequest class. + */ private IotaGetTrytesRequest(final String... hashes) { super(IotaAPICommands.GET_TRYTES); this.hashes = hashes; } + /** + * Create a new instance of the IotaGetTrytesRequest class. + */ public static IotaGetTrytesRequest createGetTrytesRequest(String... hashes) { return new IotaGetTrytesRequest(hashes); } + /** + * Gets the hashes. + * + * @return hashes The hashes. + */ public String[] getHashes() { return hashes; } + /** + * Sets the hashes. + * + * @param hashes The hashes. + */ public void setHashes(String[] hashes) { this.hashes = hashes; } diff --git a/src/main/java/jota/dto/request/IotaNeighborsRequest.java b/src/main/java/jota/dto/request/IotaNeighborsRequest.java index 9edd43f..06a916b 100644 --- a/src/main/java/jota/dto/request/IotaNeighborsRequest.java +++ b/src/main/java/jota/dto/request/IotaNeighborsRequest.java @@ -9,23 +9,42 @@ public class IotaNeighborsRequest extends IotaCommandRequest { private String[] uris; + /** + * Initializes a new instance of the IotaNeighborsRequest class. + */ private IotaNeighborsRequest(IotaAPICommands type, final String... uris) { super(type); this.uris = uris; } + /** + * Create a new instance of the IotaNeighborsRequest class. + */ public static IotaNeighborsRequest createAddNeighborsRequest(String... uris) { return new IotaNeighborsRequest(IotaAPICommands.ADD_NEIGHBORS, uris); } + /** + * Create a new instance of the IotaNeighborsRequest class. + */ public static IotaNeighborsRequest createRemoveNeighborsRequest(String... uris) { return new IotaNeighborsRequest(IotaAPICommands.REMOVE_NEIGHBORS, uris); } + /** + * Gets the uris. + * + * @return uris The uris. + */ public String[] getUris() { return uris; } + /** + * Sets the uris. + * + * @param uris The uris. + */ public void setUris(String[] uris) { this.uris = uris; } diff --git a/src/main/java/jota/dto/request/IotaStoreTransactionsRequest.java b/src/main/java/jota/dto/request/IotaStoreTransactionsRequest.java index 67baa29..fb39eba 100644 --- a/src/main/java/jota/dto/request/IotaStoreTransactionsRequest.java +++ b/src/main/java/jota/dto/request/IotaStoreTransactionsRequest.java @@ -10,19 +10,35 @@ public class IotaStoreTransactionsRequest extends IotaCommandRequest { private String[] trytes; + /** + * Initializes a new instance of the IotaStoreTransactionsRequest class. + */ private IotaStoreTransactionsRequest(final String... trytes) { super(IotaAPICommands.STORE_TRANSACTIONS); this.trytes = trytes; } + /** + * Create a new instance of the IotaStoreTransactionsRequest class. + */ public static IotaStoreTransactionsRequest createStoreTransactionsRequest(final String... trytes) { return new IotaStoreTransactionsRequest(trytes); } + /** + * Gets the trytes. + * + * @return trytes The trytes. + */ public String[] getTrytes() { return trytes; } + /** + * Sets the trytes. + * + * @param trytes The trytes. + */ public void setTrytes(String[] trytes) { this.trytes = trytes; } diff --git a/src/main/java/jota/dto/response/AddNeighborsResponse.java b/src/main/java/jota/dto/response/AddNeighborsResponse.java index 5583132..235deb6 100644 --- a/src/main/java/jota/dto/response/AddNeighborsResponse.java +++ b/src/main/java/jota/dto/response/AddNeighborsResponse.java @@ -7,6 +7,11 @@ public class AddNeighborsResponse extends AbstractResponse { private int addedNeighbors; + /** + * Gets the number of added neighbors. + * + * @return addedNeighbors The number of added neighbors. + */ public int getAddedNeighbors() { return addedNeighbors; } diff --git a/src/main/java/jota/dto/response/AnalyzeTransactionResponse.java b/src/main/java/jota/dto/response/AnalyzeTransactionResponse.java index d7154d3..bbcb8ee 100644 --- a/src/main/java/jota/dto/response/AnalyzeTransactionResponse.java +++ b/src/main/java/jota/dto/response/AnalyzeTransactionResponse.java @@ -12,6 +12,11 @@ public class AnalyzeTransactionResponse extends AbstractResponse { private List transactions = new ArrayList<>(); + /** + * Gets the transactions. + * + * @return transactions trytes The transactions. + */ public List getTransactions() { return transactions; } diff --git a/src/main/java/jota/dto/response/FindTransactionResponse.java b/src/main/java/jota/dto/response/FindTransactionResponse.java index a590b46..79a45f4 100644 --- a/src/main/java/jota/dto/response/FindTransactionResponse.java +++ b/src/main/java/jota/dto/response/FindTransactionResponse.java @@ -7,6 +7,12 @@ public class FindTransactionResponse extends AbstractResponse { String[] hashes; + + /** + * Gets the hashes. + * + * @return hashes trytes The hashes. + */ public String[] getHashes() { return hashes; } diff --git a/src/main/java/jota/dto/response/GetAttachToTangleResponse.java b/src/main/java/jota/dto/response/GetAttachToTangleResponse.java index 079a762..52ce61d 100644 --- a/src/main/java/jota/dto/response/GetAttachToTangleResponse.java +++ b/src/main/java/jota/dto/response/GetAttachToTangleResponse.java @@ -7,10 +7,18 @@ public class GetAttachToTangleResponse extends AbstractResponse { private String[] trytes; + /** + * Initializes a new instance of the GetAttachToTangleResponse class. + */ public GetAttachToTangleResponse(long duration) { setDuration(duration); } + /** + * Gets the rytes. + * + * @return trytes The trytes. + */ public String[] getTrytes() { return trytes; } diff --git a/src/main/java/jota/dto/response/GetBalancesAndFormatResponse.java b/src/main/java/jota/dto/response/GetBalancesAndFormatResponse.java index 71ddb5e..65480de 100644 --- a/src/main/java/jota/dto/response/GetBalancesAndFormatResponse.java +++ b/src/main/java/jota/dto/response/GetBalancesAndFormatResponse.java @@ -12,6 +12,9 @@ public class GetBalancesAndFormatResponse extends AbstractResponse { private List input; private long totalBalance; + /** + * Initializes a new instance of the GetBalancesAndFormatResponse class. + */ public static GetBalancesAndFormatResponse create(List inputs, long totalBalance2, long duration) { GetBalancesAndFormatResponse res = new GetBalancesAndFormatResponse(); res.setInput(inputs); @@ -20,18 +23,36 @@ public class GetBalancesAndFormatResponse extends AbstractResponse { return res; } + /** + * Gets the input. + * + * @return transactions The transactions. + */ public List getInput() { return input; } + /** + * Sets the input. + * + * @param input The input. + */ public void setInput(List input) { this.input = input; } + /** + * Gets the total balance. + * @return totalBalance The total balance. + */ public long getTotalBalance() { return totalBalance; } + /** + * Sets the total balance. + * @param totalBalance The total balance. + */ public void setTotalBalance(long totalBalance) { this.totalBalance = totalBalance; } diff --git a/src/main/java/jota/dto/response/GetBalancesResponse.java b/src/main/java/jota/dto/response/GetBalancesResponse.java index 1de88bf..714565d 100644 --- a/src/main/java/jota/dto/response/GetBalancesResponse.java +++ b/src/main/java/jota/dto/response/GetBalancesResponse.java @@ -9,14 +9,28 @@ public class GetBalancesResponse extends AbstractResponse { private String milestone; private int milestoneIndex; + /** + * Gets the milestone index. + * + * @return milestoneIndex The milestone index. + */ public int getMilestoneIndex() { return milestoneIndex; } + /** + * Gets the milestone. + * + * @return milestone The milestone. + */ public String getMilestone() { return milestone; } + /** + * Gets the balances. + * @return balances The balances. + */ public String[] getBalances() { return balances; } diff --git a/src/main/java/jota/dto/response/GetBundleResponse.java b/src/main/java/jota/dto/response/GetBundleResponse.java index b183ea0..8a6adfd 100644 --- a/src/main/java/jota/dto/response/GetBundleResponse.java +++ b/src/main/java/jota/dto/response/GetBundleResponse.java @@ -12,6 +12,9 @@ public class GetBundleResponse extends AbstractResponse { private List transactions = new ArrayList<>(); + /** + * Initializes a new instance of the GetBundleResponse class. + */ public static GetBundleResponse create(List transactions, long duration) { GetBundleResponse res = new GetBundleResponse(); res.transactions = transactions; @@ -19,7 +22,11 @@ public class GetBundleResponse extends AbstractResponse { return res; } - + /** + * Gets the transactions. + * + * @return transactions The transactions. + */ public List getTransactions() { return transactions; } diff --git a/src/main/java/jota/dto/response/GetInclusionStateResponse.java b/src/main/java/jota/dto/response/GetInclusionStateResponse.java index 856ff00..17d0dc4 100644 --- a/src/main/java/jota/dto/response/GetInclusionStateResponse.java +++ b/src/main/java/jota/dto/response/GetInclusionStateResponse.java @@ -7,6 +7,11 @@ public class GetInclusionStateResponse extends AbstractResponse { boolean[] states; + /** + * Gets the states. + * + * @return states The states. + */ public boolean[] getStates() { return states; } diff --git a/src/main/java/jota/dto/response/GetNeighborsResponse.java b/src/main/java/jota/dto/response/GetNeighborsResponse.java index 8191305..4e3c155 100644 --- a/src/main/java/jota/dto/response/GetNeighborsResponse.java +++ b/src/main/java/jota/dto/response/GetNeighborsResponse.java @@ -12,6 +12,11 @@ public class GetNeighborsResponse extends AbstractResponse { private List neighbors = new ArrayList<>(); + /** + * Gets the neighbors. + * + * @return neighbors The neighbors. + */ public List getNeighbors() { return neighbors; } diff --git a/src/main/java/jota/dto/response/GetNewAddressResponse.java b/src/main/java/jota/dto/response/GetNewAddressResponse.java index aed7e98..9fa1d36 100644 --- a/src/main/java/jota/dto/response/GetNewAddressResponse.java +++ b/src/main/java/jota/dto/response/GetNewAddressResponse.java @@ -9,6 +9,9 @@ public class GetNewAddressResponse extends AbstractResponse { private List addresses; + /** + * Initializes a new instance of the GetNewAddressResponse class. + */ public static GetNewAddressResponse create(List addresses, long duration) { GetNewAddressResponse res = new GetNewAddressResponse(); res.addresses = addresses; @@ -16,6 +19,11 @@ public class GetNewAddressResponse extends AbstractResponse { return res; } + /** + * Gets the addresses. + * + * @return addresses The addresses. + */ public List getAddresses() { return addresses; } diff --git a/src/main/java/jota/dto/response/GetNodeInfoResponse.java b/src/main/java/jota/dto/response/GetNodeInfoResponse.java index b66fc44..c8fcac7 100644 --- a/src/main/java/jota/dto/response/GetNodeInfoResponse.java +++ b/src/main/java/jota/dto/response/GetNodeInfoResponse.java @@ -22,66 +22,134 @@ public class GetNodeInfoResponse extends AbstractResponse { private int tips; private int transactionsToRequest; + /** + * Name of the IOTA software you're currently using (IRI stands for Initial Reference Implementation). + * + * @return appName + */ public String getAppName() { return appName; } + /** + * The version of the IOTA software you're currently running. + * + * @return + */ public String getAppVersion() { return appVersion; } + /** + * The version of running java version. + * @return + */ public String getJreVersion() { return jreVersion; } + /** + * Available cores on your machine for JRE. + * @return + */ public Integer getJreAvailableProcessors() { return jreAvailableProcessors; } + /** + * The amount of free memory in the Java Virtual Machine. + * @return + */ public long getJreFreeMemory() { return jreFreeMemory; } + /** + * The maximum amount of memory that the Java virtual machine will attempt to use. + * @return + */ public long getJreMaxMemory() { return jreMaxMemory; } + /** + * The total amount of memory in the Java virtual machine. + * @return + */ public long getJreTotalMemory() { return jreTotalMemory; } + /** + * Latest milestone that was signed off by the coordinator. + * @return + */ public String getLatestMilestone() { return latestMilestone; } + /** + * Index of the latest milestone. + * @return + */ public int getLatestMilestoneIndex() { return latestMilestoneIndex; } + /** + * The latest milestone which is solid and is used for sending transactions. + * For a milestone to become solid your local node must basically approve the subtangle of coordinator-approved transactions, + * and have a consistent view of all referenced transactions. + * @return + */ public String getLatestSolidSubtangleMilestone() { return latestSolidSubtangleMilestone; } + /** + * Index of the latest solid subtangle. + * @return + */ public int getLatestSolidSubtangleMilestoneIndex() { return latestSolidSubtangleMilestoneIndex; } + /** + * Number of neighbors you are directly connected with. + * @return + */ public int getNeighbors() { return neighbors; } + /** + * Packets which are currently queued up + * @return + */ public int getPacketsQueueSize() { return packetsQueueSize; } + /** + * Current UNIX timestamp. + * @return + */ public Long getTime() { return time; } + /** + * Number of tips in the network. + * @return + */ public int getTips() { return tips; } + /** + * Transactions to request during syncing process. + * @return + */ public int getTransactionsToRequest() { return transactionsToRequest; } diff --git a/src/main/java/jota/dto/response/GetTipsResponse.java b/src/main/java/jota/dto/response/GetTipsResponse.java index b6a0d0d..225252a 100644 --- a/src/main/java/jota/dto/response/GetTipsResponse.java +++ b/src/main/java/jota/dto/response/GetTipsResponse.java @@ -7,6 +7,11 @@ public class GetTipsResponse extends AbstractResponse { private String[] hashes; + /** + * Gets the hashes. + * + * @return hashes The hashes. + */ public String[] getHashes() { return hashes; } diff --git a/src/main/java/jota/dto/response/GetTransactionsToApproveResponse.java b/src/main/java/jota/dto/response/GetTransactionsToApproveResponse.java index 3354000..c4c9192 100644 --- a/src/main/java/jota/dto/response/GetTransactionsToApproveResponse.java +++ b/src/main/java/jota/dto/response/GetTransactionsToApproveResponse.java @@ -8,10 +8,20 @@ public class GetTransactionsToApproveResponse extends AbstractResponse { private String trunkTransaction; private String branchTransaction; + /** + * Gets the trunk transaction. + * + * @return trunkTransaction The trunk transaction. + */ public String getTrunkTransaction() { return trunkTransaction; } + /** + * Gets the branch transaction. + * + * @return branchTransaction The branch transaction. + */ public String getBranchTransaction() { return branchTransaction; } diff --git a/src/main/java/jota/dto/response/GetTransferResponse.java b/src/main/java/jota/dto/response/GetTransferResponse.java index ee8cf11..762c640 100644 --- a/src/main/java/jota/dto/response/GetTransferResponse.java +++ b/src/main/java/jota/dto/response/GetTransferResponse.java @@ -9,12 +9,20 @@ public class GetTransferResponse extends AbstractResponse { private Bundle[] transferBundle; + /** + * Initializes a new instance of the GetTransferResponse class. + */ public static GetTransferResponse create(Bundle[] transferBundle, long duration) { GetTransferResponse res = new GetTransferResponse(); res.transferBundle = transferBundle; return res; } + /** + * Gets the transfer bundle. + * + * @return transferBundle The transfer bundle. + */ public Bundle[] getTransfers() { return transferBundle; } diff --git a/src/main/java/jota/dto/response/GetTrytesResponse.java b/src/main/java/jota/dto/response/GetTrytesResponse.java index 48101b5..fef997a 100644 --- a/src/main/java/jota/dto/response/GetTrytesResponse.java +++ b/src/main/java/jota/dto/response/GetTrytesResponse.java @@ -7,6 +7,11 @@ public class GetTrytesResponse extends AbstractResponse { private String[] trytes; + /** + * Gets the trytes. + * + * @return trytes The trytes. + */ public String[] getTrytes() { return trytes; } diff --git a/src/main/java/jota/dto/response/RemoveNeighborsResponse.java b/src/main/java/jota/dto/response/RemoveNeighborsResponse.java index 51556fa..8e8d7a9 100644 --- a/src/main/java/jota/dto/response/RemoveNeighborsResponse.java +++ b/src/main/java/jota/dto/response/RemoveNeighborsResponse.java @@ -7,6 +7,11 @@ public class RemoveNeighborsResponse extends AbstractResponse { private int removedNeighbors; + /** + * Gets the number of removed neighbors. + * + * @return removedNeighbors The number of removed neighbors. + */ public int getRemovedNeighbors() { return removedNeighbors; } diff --git a/src/main/java/jota/dto/response/ReplayBundleResponse.java b/src/main/java/jota/dto/response/ReplayBundleResponse.java index 563d701..f549ed8 100644 --- a/src/main/java/jota/dto/response/ReplayBundleResponse.java +++ b/src/main/java/jota/dto/response/ReplayBundleResponse.java @@ -7,6 +7,9 @@ public class ReplayBundleResponse extends AbstractResponse { private Boolean[] successfully; + /** + * Initializes a new instance of the ReplayBundleResponse class. + */ public static ReplayBundleResponse create(Boolean[] successfully, long duration) { ReplayBundleResponse res = new ReplayBundleResponse(); res.successfully = successfully; @@ -14,10 +17,20 @@ public class ReplayBundleResponse extends AbstractResponse { return res; } + /** + * Gets the successfully. + * + * @return successfully The successfully. + */ public Boolean[] getSuccessfully() { return successfully; } + /** + * Sets the successfully. + * + * @param successfully The successfully. + */ public void setSuccessfully(Boolean[] successfully) { this.successfully = successfully; } diff --git a/src/main/java/jota/dto/response/SendTransferResponse.java b/src/main/java/jota/dto/response/SendTransferResponse.java index 2422a14..7b840e2 100644 --- a/src/main/java/jota/dto/response/SendTransferResponse.java +++ b/src/main/java/jota/dto/response/SendTransferResponse.java @@ -7,6 +7,9 @@ public class SendTransferResponse extends AbstractResponse { private Boolean[] successfully; + /** + * Initializes a new instance of the SendTransferResponse class. + */ public static SendTransferResponse create(Boolean[] successfully, long duration) { SendTransferResponse res = new SendTransferResponse(); res.successfully = successfully; @@ -14,10 +17,20 @@ public class SendTransferResponse extends AbstractResponse { return res; } + /** + * Gets the successfully. + * + * @return successfully The successfully. + */ public Boolean[] getSuccessfully() { return successfully; } + /** + * Sets the successfully. + * + * @param successfully The successfully. + */ public void setSuccessfully(Boolean[] successfully) { this.successfully = successfully; } diff --git a/src/main/java/jota/dto/response/StoreTransactionsResponse.java b/src/main/java/jota/dto/response/StoreTransactionsResponse.java index 767048e..518d1f5 100644 --- a/src/main/java/jota/dto/response/StoreTransactionsResponse.java +++ b/src/main/java/jota/dto/response/StoreTransactionsResponse.java @@ -4,6 +4,10 @@ package jota.dto.response; * Response of {@link jota.dto.request.IotaStoreTransactionsRequest} **/ public class StoreTransactionsResponse extends AbstractResponse { + + /** + * Initializes a new instance of the StoreTransactionsResponse class. + */ public StoreTransactionsResponse(long duration) { setDuration(duration); } diff --git a/src/main/java/jota/error/ArgumentException.java b/src/main/java/jota/error/ArgumentException.java index fafb454..8931953 100644 --- a/src/main/java/jota/error/ArgumentException.java +++ b/src/main/java/jota/error/ArgumentException.java @@ -5,6 +5,9 @@ package jota.error; */ public class ArgumentException extends BaseException { + /** + * Serial version UID + */ private static final long serialVersionUID = -7850044681919575720L; public ArgumentException() { diff --git a/src/main/java/jota/error/BaseException.java b/src/main/java/jota/error/BaseException.java index bbfd5ea..b1f91cc 100644 --- a/src/main/java/jota/error/BaseException.java +++ b/src/main/java/jota/error/BaseException.java @@ -9,6 +9,9 @@ import java.util.Collection; */ public class BaseException extends Exception { + /** + * Serial version UID + */ private static final long serialVersionUID = 5617085097507773343L; protected Collection messages; diff --git a/src/main/java/jota/error/NotEnoughBalanceException.java b/src/main/java/jota/error/NotEnoughBalanceException.java index a26d615..f417482 100644 --- a/src/main/java/jota/error/NotEnoughBalanceException.java +++ b/src/main/java/jota/error/NotEnoughBalanceException.java @@ -5,6 +5,9 @@ package jota.error; */ public class NotEnoughBalanceException extends BaseException { + /** + * Serial version UID + */ private static final long serialVersionUID = -3807270816402226476L; public NotEnoughBalanceException() { From 8c2a36bacf7f123792f0b3956bb0e2bf2e7c46ed Mon Sep 17 00:00:00 2001 From: pinpong Date: Tue, 14 Feb 2017 21:05:27 +0100 Subject: [PATCH 31/45] documentation --- .../request/IotaAttachToTangleRequest.java | 6 ++ .../request/IotaFindTransactionsRequest.java | 58 ++++++++++++------- .../dto/request/IotaGetBalancesRequest.java | 2 + .../request/IotaGetInclusionStateRequest.java | 2 + .../GetBalancesAndFormatResponse.java | 2 + .../dto/response/GetNodeInfoResponse.java | 14 +++++ 6 files changed, 64 insertions(+), 20 deletions(-) diff --git a/src/main/java/jota/dto/request/IotaAttachToTangleRequest.java b/src/main/java/jota/dto/request/IotaAttachToTangleRequest.java index 7542f48..04ec504 100644 --- a/src/main/java/jota/dto/request/IotaAttachToTangleRequest.java +++ b/src/main/java/jota/dto/request/IotaAttachToTangleRequest.java @@ -51,6 +51,7 @@ public class IotaAttachToTangleRequest extends IotaCommandRequest { /** * Gets the brancht ransaction. + * * @return branchTransaction The branch transaction. */ public String getBranchTransaction() { @@ -59,6 +60,7 @@ public class IotaAttachToTangleRequest extends IotaCommandRequest { /** * Sets the branch transaction. + * * @param branchTransaction the branch transaction. */ public void setBranchTransaction(String branchTransaction) { @@ -67,6 +69,7 @@ public class IotaAttachToTangleRequest extends IotaCommandRequest { /** * Gets the min weight magnitude. + * * @return minWeightMagnitude The min weight magnitude. */ public Integer getMinWeightMagnitude() { @@ -75,6 +78,7 @@ public class IotaAttachToTangleRequest extends IotaCommandRequest { /** * Sets the min weight magnitude. + * * @param minWeightMagnitude The min weight magnitude. */ public void setMinWeightMagnitude(Integer minWeightMagnitude) { @@ -83,6 +87,7 @@ public class IotaAttachToTangleRequest extends IotaCommandRequest { /** * Gets the trytes. + * * @return trytes The trytes. */ public String[] getTrytes() { @@ -91,6 +96,7 @@ public class IotaAttachToTangleRequest extends IotaCommandRequest { /** * Sets the trytes. + * * @param trytes The trytes. */ public void setTrytes(String[] trytes) { diff --git a/src/main/java/jota/dto/request/IotaFindTransactionsRequest.java b/src/main/java/jota/dto/request/IotaFindTransactionsRequest.java index 9f8fa09..20dd73e 100644 --- a/src/main/java/jota/dto/request/IotaFindTransactionsRequest.java +++ b/src/main/java/jota/dto/request/IotaFindTransactionsRequest.java @@ -26,6 +26,38 @@ public class IotaFindTransactionsRequest extends IotaCommandRequest { return new IotaFindTransactionsRequest(); } + /** + * Initializes a new instance of the IotaFindTransactionsRequest class. + */ + public IotaFindTransactionsRequest byBundles(String... bundles) { + this.bundles = bundles; + return this; + } + + /** + * Initializes a new instance of the IotaFindTransactionsRequest class. + */ + public IotaFindTransactionsRequest byAddresses(String... addresses) { + this.addresses = addresses; + return this; + } + + /** + * Initializes a new instance of the IotaFindTransactionsRequest class. + */ + public IotaFindTransactionsRequest byTags(String... tags) { + this.tags = tags; + return this; + } + + /** + * Initializes a new instance of the IotaFindTransactionsRequest class. + */ + public IotaFindTransactionsRequest byApprovees(String... approvees) { + this.approvees = approvees; + return this; + } + /** * Gets the bundles. * @@ -46,6 +78,7 @@ public class IotaFindTransactionsRequest extends IotaCommandRequest { /** * Gets the addresses. + * * @return addresses The addresses. */ public String[] getAddresses() { @@ -54,6 +87,7 @@ public class IotaFindTransactionsRequest extends IotaCommandRequest { /** * Sets the addresses. + * * @param addresses The addresses. */ public void setAddresses(String[] addresses) { @@ -62,6 +96,7 @@ public class IotaFindTransactionsRequest extends IotaCommandRequest { /** * Gets the tags. + * * @return tags The tags. */ public String[] getTags() { @@ -70,6 +105,7 @@ public class IotaFindTransactionsRequest extends IotaCommandRequest { /** * Sets the tags. + * * @param tags The tags. */ public void setTags(String[] tags) { @@ -78,6 +114,7 @@ public class IotaFindTransactionsRequest extends IotaCommandRequest { /** * Gets the approvees. + * * @return approvees The approvees. */ public String[] getApprovees() { @@ -86,29 +123,10 @@ public class IotaFindTransactionsRequest extends IotaCommandRequest { /** * Sets the approvees. + * * @param approvees The approvees. */ public void setApprovees(String[] approvees) { this.approvees = approvees; } - - public IotaFindTransactionsRequest byBundles(String... bundles) { - this.bundles = bundles; - return this; - } - - public IotaFindTransactionsRequest byAddresses(String... addresses) { - this.addresses = addresses; - return this; - } - - public IotaFindTransactionsRequest byTags(String... tags) { - this.tags = tags; - return this; - } - - public IotaFindTransactionsRequest byApprovees(String... approvees) { - this.approvees = approvees; - return this; - } } diff --git a/src/main/java/jota/dto/request/IotaGetBalancesRequest.java b/src/main/java/jota/dto/request/IotaGetBalancesRequest.java index 017a8f4..8528365 100644 --- a/src/main/java/jota/dto/request/IotaGetBalancesRequest.java +++ b/src/main/java/jota/dto/request/IotaGetBalancesRequest.java @@ -46,6 +46,7 @@ public class IotaGetBalancesRequest extends IotaCommandRequest { /** * Gets the threshold. + * * @return threshold The threshold. */ public Integer getThreshold() { @@ -54,6 +55,7 @@ public class IotaGetBalancesRequest extends IotaCommandRequest { /** * Sets the threshold. + * * @param threshold The threshold. */ public void setThreshold(Integer threshold) { diff --git a/src/main/java/jota/dto/request/IotaGetInclusionStateRequest.java b/src/main/java/jota/dto/request/IotaGetInclusionStateRequest.java index b6e7ca9..0aa0027 100644 --- a/src/main/java/jota/dto/request/IotaGetInclusionStateRequest.java +++ b/src/main/java/jota/dto/request/IotaGetInclusionStateRequest.java @@ -57,6 +57,7 @@ public class IotaGetInclusionStateRequest extends IotaCommandRequest { /** * Gets the tips. + * * @return tips The tips. */ public String[] getTips() { @@ -65,6 +66,7 @@ public class IotaGetInclusionStateRequest extends IotaCommandRequest { /** * Sets the tips. + * * @param tips The tips. */ public void setTips(String[] tips) { diff --git a/src/main/java/jota/dto/response/GetBalancesAndFormatResponse.java b/src/main/java/jota/dto/response/GetBalancesAndFormatResponse.java index 65480de..28f29f0 100644 --- a/src/main/java/jota/dto/response/GetBalancesAndFormatResponse.java +++ b/src/main/java/jota/dto/response/GetBalancesAndFormatResponse.java @@ -43,6 +43,7 @@ public class GetBalancesAndFormatResponse extends AbstractResponse { /** * Gets the total balance. + * * @return totalBalance The total balance. */ public long getTotalBalance() { @@ -51,6 +52,7 @@ public class GetBalancesAndFormatResponse extends AbstractResponse { /** * Sets the total balance. + * * @param totalBalance The total balance. */ public void setTotalBalance(long totalBalance) { diff --git a/src/main/java/jota/dto/response/GetNodeInfoResponse.java b/src/main/java/jota/dto/response/GetNodeInfoResponse.java index c8fcac7..d7f9db8 100644 --- a/src/main/java/jota/dto/response/GetNodeInfoResponse.java +++ b/src/main/java/jota/dto/response/GetNodeInfoResponse.java @@ -42,6 +42,7 @@ public class GetNodeInfoResponse extends AbstractResponse { /** * The version of running java version. + * * @return */ public String getJreVersion() { @@ -50,6 +51,7 @@ public class GetNodeInfoResponse extends AbstractResponse { /** * Available cores on your machine for JRE. + * * @return */ public Integer getJreAvailableProcessors() { @@ -58,6 +60,7 @@ public class GetNodeInfoResponse extends AbstractResponse { /** * The amount of free memory in the Java Virtual Machine. + * * @return */ public long getJreFreeMemory() { @@ -66,6 +69,7 @@ public class GetNodeInfoResponse extends AbstractResponse { /** * The maximum amount of memory that the Java virtual machine will attempt to use. + * * @return */ public long getJreMaxMemory() { @@ -74,6 +78,7 @@ public class GetNodeInfoResponse extends AbstractResponse { /** * The total amount of memory in the Java virtual machine. + * * @return */ public long getJreTotalMemory() { @@ -82,6 +87,7 @@ public class GetNodeInfoResponse extends AbstractResponse { /** * Latest milestone that was signed off by the coordinator. + * * @return */ public String getLatestMilestone() { @@ -90,6 +96,7 @@ public class GetNodeInfoResponse extends AbstractResponse { /** * Index of the latest milestone. + * * @return */ public int getLatestMilestoneIndex() { @@ -100,6 +107,7 @@ public class GetNodeInfoResponse extends AbstractResponse { * The latest milestone which is solid and is used for sending transactions. * For a milestone to become solid your local node must basically approve the subtangle of coordinator-approved transactions, * and have a consistent view of all referenced transactions. + * * @return */ public String getLatestSolidSubtangleMilestone() { @@ -108,6 +116,7 @@ public class GetNodeInfoResponse extends AbstractResponse { /** * Index of the latest solid subtangle. + * * @return */ public int getLatestSolidSubtangleMilestoneIndex() { @@ -116,6 +125,7 @@ public class GetNodeInfoResponse extends AbstractResponse { /** * Number of neighbors you are directly connected with. + * * @return */ public int getNeighbors() { @@ -124,6 +134,7 @@ public class GetNodeInfoResponse extends AbstractResponse { /** * Packets which are currently queued up + * * @return */ public int getPacketsQueueSize() { @@ -132,6 +143,7 @@ public class GetNodeInfoResponse extends AbstractResponse { /** * Current UNIX timestamp. + * * @return */ public Long getTime() { @@ -140,6 +152,7 @@ public class GetNodeInfoResponse extends AbstractResponse { /** * Number of tips in the network. + * * @return */ public int getTips() { @@ -148,6 +161,7 @@ public class GetNodeInfoResponse extends AbstractResponse { /** * Transactions to request during syncing process. + * * @return */ public int getTransactionsToRequest() { From d0f2a5517cdbe62e508e9e9f83680fd1928e5be5 Mon Sep 17 00:00:00 2001 From: pinpong Date: Wed, 15 Feb 2017 18:16:25 +0100 Subject: [PATCH 32/45] documentation --- src/main/java/jota/IotaAPI.java | 288 +++++++++--------- src/main/java/jota/IotaAPICommands.java | 11 + src/main/java/jota/IotaAPICore.java | 40 +++ .../request/IotaAttachToTangleRequest.java | 10 +- .../IotaBroadcastTransactionRequest.java | 2 +- .../jota/dto/request/IotaCommandRequest.java | 23 ++ .../request/IotaFindTransactionsRequest.java | 8 +- .../dto/request/IotaGetBalancesRequest.java | 4 +- .../request/IotaGetInclusionStateRequest.java | 6 +- .../IotaGetTransactionsToApproveRequest.java | 2 +- .../dto/request/IotaGetTrytesRequest.java | 2 +- .../dto/request/IotaNeighborsRequest.java | 2 +- .../request/IotaStoreTransactionsRequest.java | 2 +- .../jota/dto/response/AbstractResponse.java | 10 + .../dto/response/AddNeighborsResponse.java | 2 +- .../dto/response/FindTransactionResponse.java | 2 +- .../response/GetAttachToTangleResponse.java | 2 +- .../GetBalancesAndFormatResponse.java | 6 +- .../dto/response/GetBalancesResponse.java | 6 +- .../jota/dto/response/GetBundleResponse.java | 2 +- .../response/GetInclusionStateResponse.java | 4 +- .../dto/response/GetNeighborsResponse.java | 2 +- .../dto/response/GetNewAddressResponse.java | 2 +- .../dto/response/GetNodeInfoResponse.java | 32 +- .../jota/dto/response/GetTipsResponse.java | 2 +- .../GetTransactionsToApproveResponse.java | 4 +- .../dto/response/GetTransferResponse.java | 2 +- .../jota/dto/response/GetTrytesResponse.java | 2 +- .../dto/response/RemoveNeighborsResponse.java | 2 +- .../dto/response/ReplayBundleResponse.java | 2 +- .../dto/response/SendTransferResponse.java | 2 +- .../java/jota/error/ArgumentException.java | 8 + .../error/BroadcastAndStoreException.java | 5 + .../jota/error/InvalidAddressException.java | 6 + .../jota/error/InvalidBundleException.java | 8 + .../error/InvalidSecurityLevelException.java | 5 + .../jota/error/InvalidSignatureException.java | 6 + .../jota/error/InvalidTransferException.java | 6 + .../jota/error/InvalidTrytesException.java | 6 +- .../error/NoInclusionStatesException.java | 16 + .../error/NoInclusionStatesExcpection.java | 11 - .../java/jota/error/NoNodeInfoException.java | 4 + .../jota/error/NotEnoughBalanceException.java | 5 + src/main/java/jota/model/Bundle.java | 13 +- src/main/java/jota/model/Input.java | 26 +- src/main/java/jota/model/Inputs.java | 10 +- src/main/java/jota/model/Neighbor.java | 13 +- src/main/java/jota/model/Signature.java | 9 +- src/main/java/jota/model/Transaction.java | 53 +++- src/main/java/jota/model/Transfer.java | 44 ++- src/main/java/jota/pow/ICurl.java | 28 +- src/main/java/jota/pow/JCurl.java | 57 +++- src/main/java/jota/utils/Checksum.java | 51 ++-- src/main/java/jota/utils/Constants.java | 3 +- src/main/java/jota/utils/Converter.java | 52 ++-- src/main/java/jota/utils/InputValidator.java | 63 ++-- src/main/java/jota/utils/IotaAPIUtils.java | 16 +- .../java/jota/utils/IotaUnitConverter.java | 61 ++-- src/main/java/jota/utils/IotaUnits.java | 7 +- src/main/java/jota/utils/Multisig.java | 2 +- .../java/jota/utils/NamedThreadFactory.java | 8 + src/main/java/jota/utils/Parallel.java | 17 +- .../java/jota/utils/SeedRandomGenerator.java | 7 +- src/main/java/jota/utils/Signing.java | 4 + src/main/java/jota/utils/StopWatch.java | 40 ++- src/main/java/jota/utils/TrytesConverter.java | 5 +- src/test/java/jota/IotaAPITest.java | 2 +- 67 files changed, 748 insertions(+), 415 deletions(-) create mode 100644 src/main/java/jota/error/NoInclusionStatesException.java delete mode 100644 src/main/java/jota/error/NoInclusionStatesExcpection.java diff --git a/src/main/java/jota/IotaAPI.java b/src/main/java/jota/IotaAPI.java index 5653a1c..924e4c3 100644 --- a/src/main/java/jota/IotaAPI.java +++ b/src/main/java/jota/IotaAPI.java @@ -37,17 +37,17 @@ public class IotaAPI extends IotaAPICore { /** * Generates a new address from a seed and returns the remainderAddress. - * This is either done deterministically, or by providing the index of the new remainderAddress + * This is either done deterministically, or by providing the index of the new remainderAddress. * - * @param seed Tryte-encoded seed. It should be noted that this seed is not transferred - * @param security Security level to be used for the private key / address. Can be 1, 2 or 3 - * @param index Optional (default null). Key index to start search from. If the index is provided, the generation of the address is not deterministic. - * @param checksum Optional (default false). Adds 9-tryte address checksum - * @param total Optional (default 1)Total number of addresses to generate - * @param returnAll If true, it returns all addresses which were deterministically generated (until findTransactions returns null) - * @return an array of strings with the specifed number of addresses - * @exception InvalidAddressException is thrown when the specified address is not an valid address - * @exception InvalidSecurityLevelException is thrown when the specified security level is not valid + * @param seed Tryte-encoded seed. It should be noted that this seed is not transferred. + * @param security Security level to be used for the private key / address. Can be 1, 2 or 3. + * @param index Key index to start search from. If the index is provided, the generation of the address is not deterministic. + * @param checksum Adds 9-tryte address checksum. + * @param total Total number of addresses to generate. + * @param returnAll If true, it returns all addresses which were deterministically generated (until findTransactions returns null). + * @return An array of strings with the specifed number of addresses. + * @throws InvalidAddressException is thrown when the specified address is not an valid address. + * @throws InvalidSecurityLevelException is thrown when the specified security level is not valid. */ public GetNewAddressResponse getNewAddress(final String seed, int security, final int index, final boolean checksum, final int total, final boolean returnAll) throws InvalidSecurityLevelException, InvalidAddressException { @@ -90,21 +90,21 @@ public class IotaAPI extends IotaAPICore { } /** - * @param seed tryte-encoded seed. It should be noted that this seed is not transferred - * @param security security secuirty level of private key / seed - * @param start start Starting key index - * @param end end Ending key index - * @param inclusionStates Optional (default false). If True, it gets the inclusion states of the transfers. - * @return Bundle - * @exception InvalidAddressException is thrown when the specified address is not an valid address - * @throws ArgumentException - * @throws InvalidBundleException - * @throws InvalidSignatureException - * @throws NoNodeInfoException - * @throws NoInclusionStatesExcpection - * @exception InvalidSecurityLevelException is thrown when the specified security level is not valid + * @param seed Tryte-encoded seed. It should be noted that this seed is not transferred. + * @param security The security level of private key / seed. + * @param start Starting key index. + * @param end Ending key index. + * @param inclusionStates If true, it gets the inclusion states of the transfers. + * @return Bundle of transfers. + * @throws InvalidAddressException is thrown when the specified address is not an valid address. + * @throws ArgumentException is thrown when an invalid argument is provided. + * @throws InvalidBundleException is thrown if an invalid bundle was found or provided. + * @throws InvalidSignatureException is thrown when an invalid signature is encountered. + * @throws NoNodeInfoException is thrown when its not possible to get node info. + * @throws NoInclusionStatesException when it not possible to get a inclusion state. + * @throws InvalidSecurityLevelException is thrown when the specified security level is not valid. */ - public GetTransferResponse getTransfers(String seed, int security, Integer start, Integer end, Boolean inclusionStates) throws ArgumentException, InvalidBundleException, InvalidSignatureException, NoNodeInfoException, NoInclusionStatesExcpection, InvalidSecurityLevelException, InvalidAddressException { + public GetTransferResponse getTransfers(String seed, int security, Integer start, Integer end, Boolean inclusionStates) throws ArgumentException, InvalidBundleException, InvalidSignatureException, NoNodeInfoException, NoInclusionStatesException, InvalidSecurityLevelException, InvalidAddressException { StopWatch stopWatch = new StopWatch(); // validate & if needed pad seed if ((seed = InputValidator.validateSeed(seed)) == null) { @@ -131,13 +131,18 @@ public class IotaAPI extends IotaAPICore { } /** - * Internal function to get the formatted bundles of a list of addresses * - * @param addresses List of addresses - * @param inclusionStates Optional (default false). If True, it gets the inclusion states of the transfers. - * @return bundles Transaction objects - **/ - public Bundle[] bundlesFromAddresses(String[] addresses, final Boolean inclusionStates) throws ArgumentException, InvalidBundleException, InvalidSignatureException, NoNodeInfoException, NoInclusionStatesExcpection { + * Internal function to get the formatted bundles of a list of addresses. + * @param addresses List of addresses. + * @param inclusionStates If true, it gets the inclusion states of the transfers. + * @return A Transaction objects. + * @throws ArgumentException is thrown when an invalid argument is provided. + * @throws InvalidBundleException is thrown if an invalid bundle was found or provided. + * @throws InvalidSignatureException is thrown when an invalid signature is encountered. + * @throws NoNodeInfoException is thrown when its not possible to get node info. + * @throws NoInclusionStatesException when it not possible to get a inclusion state. + */ + public Bundle[] bundlesFromAddresses(String[] addresses, final Boolean inclusionStates) throws ArgumentException, InvalidBundleException, InvalidSignatureException, NoNodeInfoException, NoInclusionStatesException { List trxs = findTransactionObjects(addresses); // set of tail transactions @@ -175,10 +180,10 @@ public class IotaAPI extends IotaAPICore { try { gisr = getLatestInclusion(tailTxArray); } catch (IllegalAccessError ignored) { - throw new NoInclusionStatesExcpection(); + throw new NoInclusionStatesException(); } if (gisr == null || gisr.getStates() == null || gisr.getStates().length == 0) { - throw new NoInclusionStatesExcpection(); + throw new NoInclusionStatesException(); } } final GetInclusionStateResponse finalInclusionStates = gisr; @@ -217,8 +222,11 @@ public class IotaAPI extends IotaAPICore { } /** - * @param trytes the trytes - * @return a StoreTransactionsResponse + * Wrapper function that broadcasts and stores the specified trytes. + * + * @param trytes The trytes. + * @return A StoreTransactionsResponse. + * @throws BroadcastAndStoreException is thrown if its not possible to broadcast and store. */ public StoreTransactionsResponse broadcastAndStore(final String... trytes) throws BroadcastAndStoreException { @@ -232,12 +240,13 @@ public class IotaAPI extends IotaAPICore { } /** - * Facade method: Gets transactions to approve, attaches to Tangle, broadcasts and stores + * Facade method: Gets transactions to approve, attaches to Tangle, broadcasts and stores. * - * @param trytes the trytes - * @param depth the depth - * @param minWeightMagnitude the minimum weight magnitude - * @return Transactions objects + * @param trytes The trytes. + * @param depth The depth. + * @param minWeightMagnitude The minimum weight magnitude. + * @return Transactions objects. + * @throws InvalidTrytesException is thrown when invalid trytes is provided. */ public List sendTrytes(final String[] trytes, final int depth, final int minWeightMagnitude) throws InvalidTrytesException { final GetTransactionsToApproveResponse txs = getTransactionsToApprove(depth); @@ -260,12 +269,11 @@ public class IotaAPI extends IotaAPICore { } /** - * Wrapper function for getTrytes and transactionObjects - * gets the trytes and transaction object from a list of transaction hashes + * Wrapper function for getTrytes and transactionObjects. + * Gets the trytes and transaction object from a list of transaction hashes. * - * @method getTransactionsObjects - * @param hashes the hashes - * @return Transaction objects + * @param hashes The hashes + * @return Transaction objects. **/ public List getTransactionsObjects(String[] hashes) { @@ -284,13 +292,11 @@ public class IotaAPI extends IotaAPICore { } /** - * Wrapper function for findTransactions, getTrytes and transactionObjects - * Returns the transactionObject of a transaction hash. The input can be a valid - * findTransactions input + * Wrapper function for findTransactions, getTrytes and transactionObjects. + * Returns the transactionObject of a transaction hash. The input can be a valid findTransactions input. * - * @method getTransactionsObjects - * @param input the inputs - * @return Transactions + * @param input The inputs. + * @return Transactions. **/ public List findTransactionObjects(String[] input) { FindTransactionResponse ftr = findTransactions(input, null, null, null); @@ -301,12 +307,12 @@ public class IotaAPI extends IotaAPICore { } /** - * Wrapper function for findTransactions, getTrytes and transactionObjects - * Returns the transactionObject of a transaction hash. The input can be a valid + * Wrapper function for findTransactions, getTrytes and transactionObjects. + * Returns the transactionObject of a transaction hash. The input can be a valid. * findTransactions input - * @method getTransactionsObjects - * @param input the inputs - * @return Transactions + * + * @param input The inputs. + * @return Transactions. **/ public List findTransactionObjectsByBundle(String[] input) { FindTransactionResponse ftr = findTransactions(null, null, null, input); @@ -318,18 +324,18 @@ public class IotaAPI extends IotaAPICore { } /** - * Prepares transfer by generating bundle, finding and signing inputs + * Prepares transfer by generating bundle, finding and signing inputs. * - * @param seed 81-tryte encoded address of recipient - * @param security security secuirty level of private key / seed - * @param transfers Array of transfer objects - * @param remainder Optional (default null). if defined, this address will be used for sending the remainder value (of the inputs) to. - * @param inputs the inputs - * @return trytes Returns bundle trytes - * @exception InvalidAddressException is thrown when the specified address is not an valid address - * @throws NotEnoughBalanceException - * @exception InvalidSecurityLevelException is thrown when the specified security level is not valid - * @throws InvalidTransferException + * @param seed 81-tryte encoded address of recipient. + * @param security The security level of private key / seed. + * @param transfers Array of transfer objects. + * @param remainder If defined, this address will be used for sending the remainder value (of the inputs) to. + * @param inputs The inputs. + * @return Returns bundle trytes. + * @throws InvalidAddressException is thrown when the specified address is not an valid address. + * @throws NotEnoughBalanceException is thrown when a transfer fails because their is not enough balance to perform the transfer. + * @throws InvalidSecurityLevelException is thrown when the specified security level is not valid. + * @throws InvalidTransferException is thrown when an invalid transfer is provided. */ public List prepareTransfers(String seed, int security, final List transfers, String remainder, List inputs) throws NotEnoughBalanceException, InvalidSecurityLevelException, InvalidAddressException, InvalidTransferException { @@ -483,13 +489,13 @@ public class IotaAPI extends IotaAPICore { /** * Gets the inputs of a seed * - * @param seed tryte-encoded seed. It should be noted that this seed is not transferred - * @param security security secuirty level of private key / seed - * @param start start Starting key index - * @param end end Ending key index - * @param threshold threshold Min balance required - * @exception InvalidAddressException is thrown when the specified address is not an valid address - * @exception InvalidSecurityLevelException + * @param seed Tryte-encoded seed. It should be noted that this seed is not transferred. + * @param security The Security level of private key / seed. + * @param start Starting key index. + * @param end Ending key index. + * @param threshold Min balance required. + * @throws InvalidAddressException is thrown when the specified address is not an valid address. + * @throws InvalidSecurityLevelException is thrown when the specified security level is not valid. **/ public GetBalancesAndFormatResponse getInputs(String seed, int security, int start, int end, long threshold) throws InvalidSecurityLevelException, InvalidAddressException { @@ -542,16 +548,16 @@ public class IotaAPI extends IotaAPICore { } /** - * Gets the balances and formats the output + * Gets the balances and formats the output. * - * @param addresses the addresses - * @param threshold threshold Min balance required - * @param start start Starting key index - * @param end end Ending key index - * @param stopWatch the stopwatch - * @param security security secuirty level of private key / seed - * @return Inputs object - * @exception InvalidSecurityLevelException is thrown when the specified security level is not valid + * @param addresses The addresses. + * @param threshold Min balance required. + * @param start Starting key index. + * @param end Ending key index. + * @param stopWatch the stopwatch. + * @param security The security level of private key / seed. + * @return Inputs object. + * @throws InvalidSecurityLevelException is thrown when the specified security level is not valid. **/ public GetBalancesAndFormatResponse getBalanceAndFormat(final List addresses, long threshold, int start, int end, StopWatch stopWatch, int security) throws InvalidSecurityLevelException { @@ -595,13 +601,14 @@ public class IotaAPI extends IotaAPICore { } /** - * Gets the associated bundle transactions of a single transaction - * Does validation of signatures, total sum as well as bundle order - * @param transaction the transaction encoded in trytes + * Gets the associated bundle transactions of a single transaction. + * Does validation of signatures, total sum as well as bundle order. + * + * @param transaction The transaction encoded in trytes. * @return an array of bundle, if there are multiple arrays it means that there are conflicting bundles. - * @throws ArgumentException - * @throws InvalidBundleException - * @throws InvalidSignatureException + * @throws ArgumentException is thrown when an invalid argument is provided. + * @throws InvalidBundleException is thrown if an invalid bundle was found or provided. + * @throws InvalidSignatureException is thrown when an invalid signature is encountered. */ public GetBundleResponse getBundle(String transaction) throws ArgumentException, InvalidBundleException, InvalidSignatureException { StopWatch stopWatch = new StopWatch(); @@ -679,16 +686,16 @@ public class IotaAPI extends IotaAPICore { } /** - * Replays a transfer by doing Proof of Work again + * Replays a transfer by doing Proof of Work again. * - * @param transaction the transaction - * @param depth the depth - * @param minWeightMagnitude the minimum weight magnitude - * @return analyzed Transaction objects - * @throws InvalidBundleException - * @throws ArgumentException - * @throws InvalidSignatureException - * @throws InvalidTrytesException + * @param transaction The transaction. + * @param depth The depth. + * @param minWeightMagnitude The minimum weight magnitude. + * @return Analyzed Transaction objects. + * @throws InvalidBundleException is thrown if an invalid bundle was found or provided. + * @throws ArgumentException is thrown when an invalid argument is provided. + * @throws InvalidSignatureException is thrown when an invalid signature is encountered. + * @throws InvalidTransferException is thrown when an invalid transfer is provided. */ public ReplayBundleResponse replayBundle(String transaction, int depth, int minWeightMagnitude) throws InvalidBundleException, ArgumentException, InvalidSignatureException, InvalidTrytesException { StopWatch stopWatch = new StopWatch(); @@ -720,9 +727,9 @@ public class IotaAPI extends IotaAPICore { /** * Wrapper function for getNodeInfo and getInclusionStates * - * @param hashes the hashes - * @return inclusion state - * @throws NoNodeInfoException + * @param hashes The hashes. + * @return Inclusion state. + * @throws NoNodeInfoException is thrown when its not possible to get node info. */ public GetInclusionStateResponse getLatestInclusion(String[] hashes) throws NoNodeInfoException { GetNodeInfoResponse getNodeInfoResponse = getNodeInfo(); @@ -736,20 +743,20 @@ public class IotaAPI extends IotaAPICore { /** * Wrapper function that basically does prepareTransfers, as well as attachToTangle and finally, it broadcasts and stores the transactions locally. * - * @param seed tryte-encoded seed - * @param security security secuirty level of private key / seed - * @param depth the depth - * @param minWeightMagnitude the minimum weight magnitude - * @param transfers array of transfer objects - * @param inputs List of inputs used for funding the transfer - * @param address if defined, this address will be used for sending the remainder value (of the inputs) to - * @return array of Transaction objects - * @exception InvalidAddressException is thrown when the specified address is not an valid address - * @throws NotEnoughBalanceException - * @exception InvalidSecurityLevelException is thrown when the specified security level is not valid - * @throws InvalidTrytesException - * @throws InvalidAddressException - * @throws InvalidTransferException + * @param seed Tryte-encoded seed + * @param security The security level of private key / seed. + * @param depth The depth. + * @param minWeightMagnitude The minimum weight magnitude. + * @param transfers Array of transfer objects. + * @param inputs List of inputs used for funding the transfer. + * @param address If defined, this address will be used for sending the remainder value (of the inputs) to. + * @return Array of Transaction objects. + * @throws InvalidAddressException is thrown when the specified address is not an valid address. + * @throws NotEnoughBalanceException is thrown when a transfer fails because their is not enough balance to perform the transfer. + * @throws InvalidSecurityLevelException is thrown when the specified security level is not valid. + * @throws InvalidTrytesException is thrown when invalid trytes is provided. + * @throws InvalidAddressException is thrown when the specified address is not an valid address. + * @throws InvalidTransferException is thrown when an invalid transfer is provided. */ public SendTransferResponse sendTransfer(String seed, int security, int depth, int minWeightMagnitude, final List transfers, Input[] inputs, String address) throws NotEnoughBalanceException, InvalidSecurityLevelException, InvalidTrytesException, InvalidAddressException, InvalidTransferException { @@ -779,11 +786,11 @@ public class IotaAPI extends IotaAPICore { * the bundle hash of the transaction is no longer the same. In case the input * transaction hash is not a tail, we return an error. * - * @param trunkTx Hash of a trunk or a tail transaction of a bundle - * @param bundleHash the bundle hashes - * @param bundle List of bundles to be populated - * @return bundle Transaction objects - * @throws ArgumentException + * @param trunkTx Hash of a trunk or a tail transaction of a bundle. + * @param bundleHash The bundle hashes. + * @param bundle List of bundles to be populated. + * @return Transaction objects. + * @throws ArgumentException is thrown when an invalid argument is provided. */ public Bundle traverseBundle(String trunkTx, String bundleHash, Bundle bundle) throws ArgumentException { GetTrytesResponse gtr = getTrytes(trunkTx); @@ -828,16 +835,15 @@ public class IotaAPI extends IotaAPICore { /** - * Prepares transfer by generating the bundle with the corresponding cosigner transactions - * Does not contain signatures + * Prepares transfer by generating the bundle with the corresponding cosigner transactions. + * Does not contain signatures. * - * @param securitySum sum of security levels used by all co-signers - * @param inputAddress array of input addresses as well as the securitySum - * @param remainderAddress has to be generated by the cosigners before initiating the transfer, can be null if fully spent - * @return bundle of transaction objects - * @throws InvalidAddressException - * @throws InvalidBundleException - * @exception InvalidAddressException is thrown when the specified address is not an valid address + * @param securitySum The sum of security levels used by all co-signers. + * @param inputAddress Array of input addresses as well as the securitySum. + * @param remainderAddress Has to be generated by the cosigners before initiating the transfer, can be null if fully spent. + * @return Bundle of transaction objects. + * @throws InvalidBundleException is thrown if an invalid bundle was found or provided. + * @throws InvalidAddressException is thrown when the specified address is not an valid address. */ private GetTransferResponse initiateTransfer(int securitySum, final List inputAddress, String remainderAddress, final List transfers) throws InvalidAddressException, InvalidBundleException, InvalidTransferException { StopWatch sw = new StopWatch(); @@ -1005,8 +1011,8 @@ public class IotaAPI extends IotaAPICore { /** * @param hash The hash. - * @return - * @throws ArgumentException + * @return A bundle. + * @throws ArgumentException is thrown when an invalid argument is provided. */ public String findTailTransactionHash(String hash) throws ArgumentException { GetTrytesResponse gtr = getTrytes(hash); @@ -1026,18 +1032,18 @@ public class IotaAPI extends IotaAPICore { } /** - * @param seed tryte-encoded seed - * @param security security secuirty level of private key / seed - * @param inputs List of inputs used for funding the transfer - * @param bundle to be populated - * @param tag the tag. - * @param totalValue The total value. - * @param remainderAddress if defined, this address will be used for sending the remainder value (of the inputs) to + * @param seed Tryte-encoded seed. + * @param security The security level of private key / seed. + * @param inputs List of inputs used for funding the transfer. + * @param bundle To be populated. + * @param tag The tag. + * @param totalValue The total value. + * @param remainderAddress If defined, this address will be used for sending the remainder value (of the inputs) to. * @param signatureFragments The signature fragments. - * @return - * @throws NotEnoughBalanceException - * @throws InvalidSecurityLevelException is thrown when the specified security level is not valid - * @throws InvalidAddressException is thrown when the specified address is not an valid address + * + * @throws NotEnoughBalanceException is thrown when a transfer fails because their is not enough balance to perform the transfer. + * @throws InvalidSecurityLevelException is thrown when the specified security level is not valid. + * @throws InvalidAddressException is thrown when the specified address is not an valid address. */ public List addRemainder(final String seed, final int security, diff --git a/src/main/java/jota/IotaAPICommands.java b/src/main/java/jota/IotaAPICommands.java index bcb9b58..3995251 100644 --- a/src/main/java/jota/IotaAPICommands.java +++ b/src/main/java/jota/IotaAPICommands.java @@ -25,15 +25,26 @@ public enum IotaAPICommands { private String command; private int params; + /** + * @param command + * @param params + */ IotaAPICommands(String command, int params) { this.command = command; this.params = params; } + /** + * @return + */ public String command() { return command; } + /** + * + * @return + */ public int params() { return params; } diff --git a/src/main/java/jota/IotaAPICore.java b/src/main/java/jota/IotaAPICore.java index 7264b46..9a54fc9 100644 --- a/src/main/java/jota/IotaAPICore.java +++ b/src/main/java/jota/IotaAPICore.java @@ -30,6 +30,11 @@ public class IotaAPICore { private IotaAPIService service; private String protocol, host, port; + /** + * Build the API core. + * + * @param builder The builder. + */ protected IotaAPICore(final Builder builder) { protocol = builder.protocol; host = builder.host; @@ -37,6 +42,11 @@ public class IotaAPICore { postConstruct(); } + /** + * @param call + * @param + * @return + */ protected static Response wrapCheckedException(final Call call) { try { final Response res = call.execute(); @@ -54,6 +64,12 @@ public class IotaAPICore { } } + /** + * + * @param env + * @param def + * @return + */ private static String env(String env, String def) { final String value = System.getenv(env); if (value == null) { @@ -64,6 +80,9 @@ public class IotaAPICore { return value; } + /** + * + */ private void postConstruct() { final String nodeUrl = protocol + "://" + host + ":" + port; @@ -208,6 +227,9 @@ public class IotaAPICore { return new IotaAPICore(this); } + /** + * @return + */ private boolean checkPropertiesFiles() { try { @@ -236,22 +258,40 @@ public class IotaAPICore { return (port != null && protocol != null && host != null); } + /** + * + */ private void checkEnviromentVariables() { protocol = env("IOTA_NODE_PROTOCOL", "http"); host = env("IOTA_NODE_HOST", "localhost"); port = env("IOTA_NODE_PORT", "14265"); } + /** + * + * @param host + * @return + */ public T host(String host) { this.host = host; return (T) this; } + /** + * + * @param port + * @return + */ public T port(String port) { this.port = port; return (T) this; } + /** + * + * @param protocol + * @return + */ public T protocol(String protocol) { this.protocol = protocol; return (T) this; diff --git a/src/main/java/jota/dto/request/IotaAttachToTangleRequest.java b/src/main/java/jota/dto/request/IotaAttachToTangleRequest.java index 04ec504..6ff6f96 100644 --- a/src/main/java/jota/dto/request/IotaAttachToTangleRequest.java +++ b/src/main/java/jota/dto/request/IotaAttachToTangleRequest.java @@ -34,7 +34,7 @@ public class IotaAttachToTangleRequest extends IotaCommandRequest { /** * Gets the trunk transaction. * - * @return trunkTransaction The trunk transaction. + * @return The trunk transaction. */ public String getTrunkTransaction() { return trunkTransaction; @@ -50,9 +50,9 @@ public class IotaAttachToTangleRequest extends IotaCommandRequest { } /** - * Gets the brancht ransaction. + * Gets the branch transaction. * - * @return branchTransaction The branch transaction. + * @return The branch transaction. */ public String getBranchTransaction() { return branchTransaction; @@ -70,7 +70,7 @@ public class IotaAttachToTangleRequest extends IotaCommandRequest { /** * Gets the min weight magnitude. * - * @return minWeightMagnitude The min weight magnitude. + * @return The min weight magnitude. */ public Integer getMinWeightMagnitude() { return minWeightMagnitude; @@ -88,7 +88,7 @@ public class IotaAttachToTangleRequest extends IotaCommandRequest { /** * Gets the trytes. * - * @return trytes The trytes. + * @return The trytes. */ public String[] getTrytes() { return trytes; diff --git a/src/main/java/jota/dto/request/IotaBroadcastTransactionRequest.java b/src/main/java/jota/dto/request/IotaBroadcastTransactionRequest.java index 3885981..bd25ef4 100644 --- a/src/main/java/jota/dto/request/IotaBroadcastTransactionRequest.java +++ b/src/main/java/jota/dto/request/IotaBroadcastTransactionRequest.java @@ -27,7 +27,7 @@ public class IotaBroadcastTransactionRequest extends IotaCommandRequest { /** * Gets the trytes. * - * @return trytes The trytes. + * @return The trytes. */ public String[] getTrytes() { return trytes; diff --git a/src/main/java/jota/dto/request/IotaCommandRequest.java b/src/main/java/jota/dto/request/IotaCommandRequest.java index 261797e..b22d266 100644 --- a/src/main/java/jota/dto/request/IotaCommandRequest.java +++ b/src/main/java/jota/dto/request/IotaCommandRequest.java @@ -9,22 +9,45 @@ public class IotaCommandRequest { final String command; + /** + * @param command + */ protected IotaCommandRequest(IotaAPICommands command) { this.command = command.command(); } + /** + * Get information about the node. + * + * @return The Node info. + */ public static IotaCommandRequest createNodeInfoRequest() { return new IotaCommandRequest(IotaAPICommands.GET_NODE_INFO); } + /** + * Gets the tips of the node. + * + * @return The tips of the node. + */ public static IotaCommandRequest createGetTipsRequest() { return new IotaCommandRequest(IotaAPICommands.GET_TIPS); } + /** + * Gets the neighbours of the node. + * + * @return The list of neighbors. + */ public static IotaCommandRequest createGetNeighborsRequest() { return new IotaCommandRequest(IotaAPICommands.GET_NEIGHBORS); } + /** + * Interrupt attaching to the tangle + * + * @return + */ public static IotaCommandRequest createInterruptAttachToTangleRequest() { return new IotaCommandRequest(IotaAPICommands.INTERRUPT_ATTACHING_TO_TANGLE); } diff --git a/src/main/java/jota/dto/request/IotaFindTransactionsRequest.java b/src/main/java/jota/dto/request/IotaFindTransactionsRequest.java index 20dd73e..620c131 100644 --- a/src/main/java/jota/dto/request/IotaFindTransactionsRequest.java +++ b/src/main/java/jota/dto/request/IotaFindTransactionsRequest.java @@ -61,7 +61,7 @@ public class IotaFindTransactionsRequest extends IotaCommandRequest { /** * Gets the bundles. * - * @return bundles The bundles. + * @return The bundles. */ public String[] getBundles() { return bundles; @@ -79,7 +79,7 @@ public class IotaFindTransactionsRequest extends IotaCommandRequest { /** * Gets the addresses. * - * @return addresses The addresses. + * @return The addresses. */ public String[] getAddresses() { return addresses; @@ -97,7 +97,7 @@ public class IotaFindTransactionsRequest extends IotaCommandRequest { /** * Gets the tags. * - * @return tags The tags. + * @return The tags. */ public String[] getTags() { return tags; @@ -115,7 +115,7 @@ public class IotaFindTransactionsRequest extends IotaCommandRequest { /** * Gets the approvees. * - * @return approvees The approvees. + * @return The approvees. */ public String[] getApprovees() { return approvees; diff --git a/src/main/java/jota/dto/request/IotaGetBalancesRequest.java b/src/main/java/jota/dto/request/IotaGetBalancesRequest.java index 8528365..56457cb 100644 --- a/src/main/java/jota/dto/request/IotaGetBalancesRequest.java +++ b/src/main/java/jota/dto/request/IotaGetBalancesRequest.java @@ -29,7 +29,7 @@ public class IotaGetBalancesRequest extends IotaCommandRequest { /** * Gets the addresses. * - * @return addresses The addresses. + * @return The addresses. */ public String[] getAddresses() { return addresses; @@ -47,7 +47,7 @@ public class IotaGetBalancesRequest extends IotaCommandRequest { /** * Gets the threshold. * - * @return threshold The threshold. + * @return The threshold. */ public Integer getThreshold() { return threshold; diff --git a/src/main/java/jota/dto/request/IotaGetInclusionStateRequest.java b/src/main/java/jota/dto/request/IotaGetInclusionStateRequest.java index 0aa0027..82cfe75 100644 --- a/src/main/java/jota/dto/request/IotaGetInclusionStateRequest.java +++ b/src/main/java/jota/dto/request/IotaGetInclusionStateRequest.java @@ -40,7 +40,7 @@ public class IotaGetInclusionStateRequest extends IotaCommandRequest { /** * Gets the transactions. * - * @return transactions The transactions. + * @return The transactions. */ public String[] getTransactions() { return transactions; @@ -58,7 +58,7 @@ public class IotaGetInclusionStateRequest extends IotaCommandRequest { /** * Gets the tips. * - * @return tips The tips. + * @return The tips. */ public String[] getTips() { return tips; @@ -67,7 +67,7 @@ public class IotaGetInclusionStateRequest extends IotaCommandRequest { /** * Sets the tips. * - * @param tips The tips. + * @param tips The tips. */ public void setTips(String[] tips) { this.tips = tips; diff --git a/src/main/java/jota/dto/request/IotaGetTransactionsToApproveRequest.java b/src/main/java/jota/dto/request/IotaGetTransactionsToApproveRequest.java index 250ff74..e9cca7c 100644 --- a/src/main/java/jota/dto/request/IotaGetTransactionsToApproveRequest.java +++ b/src/main/java/jota/dto/request/IotaGetTransactionsToApproveRequest.java @@ -27,7 +27,7 @@ public class IotaGetTransactionsToApproveRequest extends IotaCommandRequest { /** * Gets the depth. * - * @return depth The depth. + * @return The depth. */ public Integer getDepth() { return depth; diff --git a/src/main/java/jota/dto/request/IotaGetTrytesRequest.java b/src/main/java/jota/dto/request/IotaGetTrytesRequest.java index f4738c2..35f5f8d 100644 --- a/src/main/java/jota/dto/request/IotaGetTrytesRequest.java +++ b/src/main/java/jota/dto/request/IotaGetTrytesRequest.java @@ -27,7 +27,7 @@ public class IotaGetTrytesRequest extends IotaCommandRequest { /** * Gets the hashes. * - * @return hashes The hashes. + * @return The hashes. */ public String[] getHashes() { return hashes; diff --git a/src/main/java/jota/dto/request/IotaNeighborsRequest.java b/src/main/java/jota/dto/request/IotaNeighborsRequest.java index 06a916b..c6059b8 100644 --- a/src/main/java/jota/dto/request/IotaNeighborsRequest.java +++ b/src/main/java/jota/dto/request/IotaNeighborsRequest.java @@ -34,7 +34,7 @@ public class IotaNeighborsRequest extends IotaCommandRequest { /** * Gets the uris. * - * @return uris The uris. + * @return The uris. */ public String[] getUris() { return uris; diff --git a/src/main/java/jota/dto/request/IotaStoreTransactionsRequest.java b/src/main/java/jota/dto/request/IotaStoreTransactionsRequest.java index fb39eba..7e9972c 100644 --- a/src/main/java/jota/dto/request/IotaStoreTransactionsRequest.java +++ b/src/main/java/jota/dto/request/IotaStoreTransactionsRequest.java @@ -28,7 +28,7 @@ public class IotaStoreTransactionsRequest extends IotaCommandRequest { /** * Gets the trytes. * - * @return trytes The trytes. + * @return The trytes. */ public String[] getTrytes() { return trytes; diff --git a/src/main/java/jota/dto/response/AbstractResponse.java b/src/main/java/jota/dto/response/AbstractResponse.java index 5b5d3dc..4184265 100644 --- a/src/main/java/jota/dto/response/AbstractResponse.java +++ b/src/main/java/jota/dto/response/AbstractResponse.java @@ -12,10 +12,20 @@ public abstract class AbstractResponse { private Long duration; + /** + * Gets the duration. + * + * @return The duration. + */ public Long getDuration() { return duration; } + /** + * Sets the duration. + * + * @param duration The duration + */ public void setDuration(Long duration) { this.duration = duration; } diff --git a/src/main/java/jota/dto/response/AddNeighborsResponse.java b/src/main/java/jota/dto/response/AddNeighborsResponse.java index 235deb6..4e4e485 100644 --- a/src/main/java/jota/dto/response/AddNeighborsResponse.java +++ b/src/main/java/jota/dto/response/AddNeighborsResponse.java @@ -10,7 +10,7 @@ public class AddNeighborsResponse extends AbstractResponse { /** * Gets the number of added neighbors. * - * @return addedNeighbors The number of added neighbors. + * @return The number of added neighbors. */ public int getAddedNeighbors() { return addedNeighbors; diff --git a/src/main/java/jota/dto/response/FindTransactionResponse.java b/src/main/java/jota/dto/response/FindTransactionResponse.java index 79a45f4..1082421 100644 --- a/src/main/java/jota/dto/response/FindTransactionResponse.java +++ b/src/main/java/jota/dto/response/FindTransactionResponse.java @@ -11,7 +11,7 @@ public class FindTransactionResponse extends AbstractResponse { /** * Gets the hashes. * - * @return hashes trytes The hashes. + * @return The hashes. */ public String[] getHashes() { return hashes; diff --git a/src/main/java/jota/dto/response/GetAttachToTangleResponse.java b/src/main/java/jota/dto/response/GetAttachToTangleResponse.java index 52ce61d..7b44506 100644 --- a/src/main/java/jota/dto/response/GetAttachToTangleResponse.java +++ b/src/main/java/jota/dto/response/GetAttachToTangleResponse.java @@ -17,7 +17,7 @@ public class GetAttachToTangleResponse extends AbstractResponse { /** * Gets the rytes. * - * @return trytes The trytes. + * @return The trytes. */ public String[] getTrytes() { return trytes; diff --git a/src/main/java/jota/dto/response/GetBalancesAndFormatResponse.java b/src/main/java/jota/dto/response/GetBalancesAndFormatResponse.java index 28f29f0..d118c96 100644 --- a/src/main/java/jota/dto/response/GetBalancesAndFormatResponse.java +++ b/src/main/java/jota/dto/response/GetBalancesAndFormatResponse.java @@ -26,7 +26,7 @@ public class GetBalancesAndFormatResponse extends AbstractResponse { /** * Gets the input. * - * @return transactions The transactions. + * @return The transactions. */ public List getInput() { return input; @@ -44,7 +44,7 @@ public class GetBalancesAndFormatResponse extends AbstractResponse { /** * Gets the total balance. * - * @return totalBalance The total balance. + * @return The total balance. */ public long getTotalBalance() { return totalBalance; @@ -53,7 +53,7 @@ public class GetBalancesAndFormatResponse extends AbstractResponse { /** * Sets the total balance. * - * @param totalBalance The total balance. + * @param totalBalance The total balance. */ public void setTotalBalance(long totalBalance) { this.totalBalance = totalBalance; diff --git a/src/main/java/jota/dto/response/GetBalancesResponse.java b/src/main/java/jota/dto/response/GetBalancesResponse.java index 714565d..c06bf50 100644 --- a/src/main/java/jota/dto/response/GetBalancesResponse.java +++ b/src/main/java/jota/dto/response/GetBalancesResponse.java @@ -12,7 +12,7 @@ public class GetBalancesResponse extends AbstractResponse { /** * Gets the milestone index. * - * @return milestoneIndex The milestone index. + * @return The milestone index. */ public int getMilestoneIndex() { return milestoneIndex; @@ -21,7 +21,7 @@ public class GetBalancesResponse extends AbstractResponse { /** * Gets the milestone. * - * @return milestone The milestone. + * @return The milestone. */ public String getMilestone() { return milestone; @@ -29,7 +29,7 @@ public class GetBalancesResponse extends AbstractResponse { /** * Gets the balances. - * @return balances The balances. + * @return The balances. */ public String[] getBalances() { return balances; diff --git a/src/main/java/jota/dto/response/GetBundleResponse.java b/src/main/java/jota/dto/response/GetBundleResponse.java index 8a6adfd..c32659d 100644 --- a/src/main/java/jota/dto/response/GetBundleResponse.java +++ b/src/main/java/jota/dto/response/GetBundleResponse.java @@ -25,7 +25,7 @@ public class GetBundleResponse extends AbstractResponse { /** * Gets the transactions. * - * @return transactions The transactions. + * @return The transactions. */ public List getTransactions() { return transactions; diff --git a/src/main/java/jota/dto/response/GetInclusionStateResponse.java b/src/main/java/jota/dto/response/GetInclusionStateResponse.java index 17d0dc4..e73e725 100644 --- a/src/main/java/jota/dto/response/GetInclusionStateResponse.java +++ b/src/main/java/jota/dto/response/GetInclusionStateResponse.java @@ -5,12 +5,12 @@ package jota.dto.response; **/ public class GetInclusionStateResponse extends AbstractResponse { - boolean[] states; + private boolean[] states; /** * Gets the states. * - * @return states The states. + * @return The states. */ public boolean[] getStates() { return states; diff --git a/src/main/java/jota/dto/response/GetNeighborsResponse.java b/src/main/java/jota/dto/response/GetNeighborsResponse.java index 4e3c155..14fcb64 100644 --- a/src/main/java/jota/dto/response/GetNeighborsResponse.java +++ b/src/main/java/jota/dto/response/GetNeighborsResponse.java @@ -15,7 +15,7 @@ public class GetNeighborsResponse extends AbstractResponse { /** * Gets the neighbors. * - * @return neighbors The neighbors. + * @return The neighbors. */ public List getNeighbors() { return neighbors; diff --git a/src/main/java/jota/dto/response/GetNewAddressResponse.java b/src/main/java/jota/dto/response/GetNewAddressResponse.java index 9fa1d36..24ef29b 100644 --- a/src/main/java/jota/dto/response/GetNewAddressResponse.java +++ b/src/main/java/jota/dto/response/GetNewAddressResponse.java @@ -22,7 +22,7 @@ public class GetNewAddressResponse extends AbstractResponse { /** * Gets the addresses. * - * @return addresses The addresses. + * @return The addresses. */ public List getAddresses() { return addresses; diff --git a/src/main/java/jota/dto/response/GetNodeInfoResponse.java b/src/main/java/jota/dto/response/GetNodeInfoResponse.java index d7f9db8..acf72c2 100644 --- a/src/main/java/jota/dto/response/GetNodeInfoResponse.java +++ b/src/main/java/jota/dto/response/GetNodeInfoResponse.java @@ -34,7 +34,7 @@ public class GetNodeInfoResponse extends AbstractResponse { /** * The version of the IOTA software you're currently running. * - * @return + * @return The version of the IOTA software you're currently running. */ public String getAppVersion() { return appVersion; @@ -43,7 +43,7 @@ public class GetNodeInfoResponse extends AbstractResponse { /** * The version of running java version. * - * @return + * @return The version of running java version. */ public String getJreVersion() { return jreVersion; @@ -52,7 +52,7 @@ public class GetNodeInfoResponse extends AbstractResponse { /** * Available cores on your machine for JRE. * - * @return + * @return Available cores on your machine for JRE. */ public Integer getJreAvailableProcessors() { return jreAvailableProcessors; @@ -61,7 +61,7 @@ public class GetNodeInfoResponse extends AbstractResponse { /** * The amount of free memory in the Java Virtual Machine. * - * @return + * @return The amount of free memory in the Java Virtual Machine. */ public long getJreFreeMemory() { return jreFreeMemory; @@ -70,7 +70,7 @@ public class GetNodeInfoResponse extends AbstractResponse { /** * The maximum amount of memory that the Java virtual machine will attempt to use. * - * @return + * @return The maximum amount of memory that the Java virtual machine will attempt to use. */ public long getJreMaxMemory() { return jreMaxMemory; @@ -79,7 +79,7 @@ public class GetNodeInfoResponse extends AbstractResponse { /** * The total amount of memory in the Java virtual machine. * - * @return + * @return The total amount of memory in the Java virtual machine. */ public long getJreTotalMemory() { return jreTotalMemory; @@ -88,7 +88,7 @@ public class GetNodeInfoResponse extends AbstractResponse { /** * Latest milestone that was signed off by the coordinator. * - * @return + * @return Latest milestone that was signed off by the coordinator. */ public String getLatestMilestone() { return latestMilestone; @@ -97,7 +97,7 @@ public class GetNodeInfoResponse extends AbstractResponse { /** * Index of the latest milestone. * - * @return + * @return Index of the latest milestone. */ public int getLatestMilestoneIndex() { return latestMilestoneIndex; @@ -108,7 +108,7 @@ public class GetNodeInfoResponse extends AbstractResponse { * For a milestone to become solid your local node must basically approve the subtangle of coordinator-approved transactions, * and have a consistent view of all referenced transactions. * - * @return + * @return The latest milestone which is solid and is used for sending transactions. */ public String getLatestSolidSubtangleMilestone() { return latestSolidSubtangleMilestone; @@ -117,7 +117,7 @@ public class GetNodeInfoResponse extends AbstractResponse { /** * Index of the latest solid subtangle. * - * @return + * @return Index of the latest solid subtangle. */ public int getLatestSolidSubtangleMilestoneIndex() { return latestSolidSubtangleMilestoneIndex; @@ -126,16 +126,16 @@ public class GetNodeInfoResponse extends AbstractResponse { /** * Number of neighbors you are directly connected with. * - * @return + * @return Number of neighbors you are directly connected with. */ public int getNeighbors() { return neighbors; } /** - * Packets which are currently queued up + * Packets which are currently queued up. * - * @return + * @return Packets which are currently queued up. */ public int getPacketsQueueSize() { return packetsQueueSize; @@ -144,7 +144,7 @@ public class GetNodeInfoResponse extends AbstractResponse { /** * Current UNIX timestamp. * - * @return + * @return Current UNIX timestamp. */ public Long getTime() { return time; @@ -153,7 +153,7 @@ public class GetNodeInfoResponse extends AbstractResponse { /** * Number of tips in the network. * - * @return + * @return Number of tips in the network. */ public int getTips() { return tips; @@ -162,7 +162,7 @@ public class GetNodeInfoResponse extends AbstractResponse { /** * Transactions to request during syncing process. * - * @return + * @return Transactions to request during syncing process. */ public int getTransactionsToRequest() { return transactionsToRequest; diff --git a/src/main/java/jota/dto/response/GetTipsResponse.java b/src/main/java/jota/dto/response/GetTipsResponse.java index 225252a..0054563 100644 --- a/src/main/java/jota/dto/response/GetTipsResponse.java +++ b/src/main/java/jota/dto/response/GetTipsResponse.java @@ -10,7 +10,7 @@ public class GetTipsResponse extends AbstractResponse { /** * Gets the hashes. * - * @return hashes The hashes. + * @return The hashes. */ public String[] getHashes() { return hashes; diff --git a/src/main/java/jota/dto/response/GetTransactionsToApproveResponse.java b/src/main/java/jota/dto/response/GetTransactionsToApproveResponse.java index c4c9192..2aa3adc 100644 --- a/src/main/java/jota/dto/response/GetTransactionsToApproveResponse.java +++ b/src/main/java/jota/dto/response/GetTransactionsToApproveResponse.java @@ -11,7 +11,7 @@ public class GetTransactionsToApproveResponse extends AbstractResponse { /** * Gets the trunk transaction. * - * @return trunkTransaction The trunk transaction. + * @return The trunk transaction. */ public String getTrunkTransaction() { return trunkTransaction; @@ -20,7 +20,7 @@ public class GetTransactionsToApproveResponse extends AbstractResponse { /** * Gets the branch transaction. * - * @return branchTransaction The branch transaction. + * @return The branch transaction. */ public String getBranchTransaction() { return branchTransaction; diff --git a/src/main/java/jota/dto/response/GetTransferResponse.java b/src/main/java/jota/dto/response/GetTransferResponse.java index 762c640..8f143ed 100644 --- a/src/main/java/jota/dto/response/GetTransferResponse.java +++ b/src/main/java/jota/dto/response/GetTransferResponse.java @@ -21,7 +21,7 @@ public class GetTransferResponse extends AbstractResponse { /** * Gets the transfer bundle. * - * @return transferBundle The transfer bundle. + * @return The transfer bundle. */ public Bundle[] getTransfers() { return transferBundle; diff --git a/src/main/java/jota/dto/response/GetTrytesResponse.java b/src/main/java/jota/dto/response/GetTrytesResponse.java index fef997a..7af55c8 100644 --- a/src/main/java/jota/dto/response/GetTrytesResponse.java +++ b/src/main/java/jota/dto/response/GetTrytesResponse.java @@ -10,7 +10,7 @@ public class GetTrytesResponse extends AbstractResponse { /** * Gets the trytes. * - * @return trytes The trytes. + * @return The trytes. */ public String[] getTrytes() { return trytes; diff --git a/src/main/java/jota/dto/response/RemoveNeighborsResponse.java b/src/main/java/jota/dto/response/RemoveNeighborsResponse.java index 8e8d7a9..24bd67b 100644 --- a/src/main/java/jota/dto/response/RemoveNeighborsResponse.java +++ b/src/main/java/jota/dto/response/RemoveNeighborsResponse.java @@ -10,7 +10,7 @@ public class RemoveNeighborsResponse extends AbstractResponse { /** * Gets the number of removed neighbors. * - * @return removedNeighbors The number of removed neighbors. + * @return The number of removed neighbors. */ public int getRemovedNeighbors() { return removedNeighbors; diff --git a/src/main/java/jota/dto/response/ReplayBundleResponse.java b/src/main/java/jota/dto/response/ReplayBundleResponse.java index f549ed8..5141de1 100644 --- a/src/main/java/jota/dto/response/ReplayBundleResponse.java +++ b/src/main/java/jota/dto/response/ReplayBundleResponse.java @@ -20,7 +20,7 @@ public class ReplayBundleResponse extends AbstractResponse { /** * Gets the successfully. * - * @return successfully The successfully. + * @return The successfully. */ public Boolean[] getSuccessfully() { return successfully; diff --git a/src/main/java/jota/dto/response/SendTransferResponse.java b/src/main/java/jota/dto/response/SendTransferResponse.java index 7b840e2..109aecd 100644 --- a/src/main/java/jota/dto/response/SendTransferResponse.java +++ b/src/main/java/jota/dto/response/SendTransferResponse.java @@ -20,7 +20,7 @@ public class SendTransferResponse extends AbstractResponse { /** * Gets the successfully. * - * @return successfully The successfully. + * @return The successfully. */ public Boolean[] getSuccessfully() { return successfully; diff --git a/src/main/java/jota/error/ArgumentException.java b/src/main/java/jota/error/ArgumentException.java index 8931953..28fe374 100644 --- a/src/main/java/jota/error/ArgumentException.java +++ b/src/main/java/jota/error/ArgumentException.java @@ -1,6 +1,8 @@ package jota.error; /** + * This exception occurs when an invalid argument is provided. + * * @author Adrian */ public class ArgumentException extends BaseException { @@ -10,10 +12,16 @@ public class ArgumentException extends BaseException { */ private static final long serialVersionUID = -7850044681919575720L; + /** + * Initializes a new instance of the ArgumentException. + */ public ArgumentException() { super("Wrong arguments passed to function"); } + /** + * Initializes a new instance of the ArgumentException. + */ public ArgumentException(String msg) { super(msg); } diff --git a/src/main/java/jota/error/BroadcastAndStoreException.java b/src/main/java/jota/error/BroadcastAndStoreException.java index d5dbd52..8ad2c20 100644 --- a/src/main/java/jota/error/BroadcastAndStoreException.java +++ b/src/main/java/jota/error/BroadcastAndStoreException.java @@ -1,10 +1,15 @@ package jota.error; /** + * This exceptions occurs if its not possible to broadcast and store. + * * @author Adrian */ public class BroadcastAndStoreException extends BaseException { + /** + * Initializes a new instance of the BroadcastAndStoreException. + */ public BroadcastAndStoreException() { super("Impossible to broadcastAndStore, aborting."); } diff --git a/src/main/java/jota/error/InvalidAddressException.java b/src/main/java/jota/error/InvalidAddressException.java index b410951..9c6b591 100644 --- a/src/main/java/jota/error/InvalidAddressException.java +++ b/src/main/java/jota/error/InvalidAddressException.java @@ -1,9 +1,15 @@ package jota.error; /** + * This exception occurs when an invalid address is provided. + * * @author Adrian */ public class InvalidAddressException extends BaseException { + + /** + * Initializes a new instance of the InvalidAddressException. + */ public InvalidAddressException() { super("Invalid Address!"); } diff --git a/src/main/java/jota/error/InvalidBundleException.java b/src/main/java/jota/error/InvalidBundleException.java index 6d5017e..55da93b 100644 --- a/src/main/java/jota/error/InvalidBundleException.java +++ b/src/main/java/jota/error/InvalidBundleException.java @@ -1,14 +1,22 @@ package jota.error; /** + * This exceptions occurs if an invalid bundle was found or provided. + * * @author Adrian */ public class InvalidBundleException extends BaseException { + /** + * Initializes a new instance of the InvalidBundleException. + */ public InvalidBundleException() { super("Invalid Bundle"); } + /** + * Initializes a new instance of the InvalidBundleException. + */ public InvalidBundleException(String msg) { super(msg); } diff --git a/src/main/java/jota/error/InvalidSecurityLevelException.java b/src/main/java/jota/error/InvalidSecurityLevelException.java index d000376..b48e6af 100644 --- a/src/main/java/jota/error/InvalidSecurityLevelException.java +++ b/src/main/java/jota/error/InvalidSecurityLevelException.java @@ -1,10 +1,15 @@ package jota.error; /** + * This exception occurs when an invalid security level is provided. + * * @author pinpong */ public class InvalidSecurityLevelException extends BaseException { + /** + * Initializes a new instance of the InvalidSecurityLevelException. + */ public InvalidSecurityLevelException() { super("Invalid security level"); } diff --git a/src/main/java/jota/error/InvalidSignatureException.java b/src/main/java/jota/error/InvalidSignatureException.java index 9a30602..79944ea 100644 --- a/src/main/java/jota/error/InvalidSignatureException.java +++ b/src/main/java/jota/error/InvalidSignatureException.java @@ -1,9 +1,15 @@ package jota.error; /** + * This exception occurs when an invalid signature is encountered. + * * @author Adrian */ public class InvalidSignatureException extends BaseException { + + /** + * Initializes a new instance of the InvalidSignatureException. + */ public InvalidSignatureException() { super("Invalid Signatures!"); } diff --git a/src/main/java/jota/error/InvalidTransferException.java b/src/main/java/jota/error/InvalidTransferException.java index 6d8e501..0da3d9b 100644 --- a/src/main/java/jota/error/InvalidTransferException.java +++ b/src/main/java/jota/error/InvalidTransferException.java @@ -1,9 +1,15 @@ package jota.error; /** + * This exception occurs when an invalid transfer is provided. + * * @author pinpong */ public class InvalidTransferException extends BaseException { + + /** + * Initializes a new instance of the InvalidTransferException. + */ public InvalidTransferException() { super("Invalid Transfer!"); } diff --git a/src/main/java/jota/error/InvalidTrytesException.java b/src/main/java/jota/error/InvalidTrytesException.java index c610afb..7b56b12 100644 --- a/src/main/java/jota/error/InvalidTrytesException.java +++ b/src/main/java/jota/error/InvalidTrytesException.java @@ -1,11 +1,15 @@ package jota.error; /** + * This exception occurs when invalid trytes is provided. * @author Adrian */ public class InvalidTrytesException extends BaseException { + /** + * Initializes a new instance of the InvalidTrytesException. + */ public InvalidTrytesException() { super("Invalid input trytes"); } -} +} \ No newline at end of file diff --git a/src/main/java/jota/error/NoInclusionStatesException.java b/src/main/java/jota/error/NoInclusionStatesException.java new file mode 100644 index 0000000..65dd2d4 --- /dev/null +++ b/src/main/java/jota/error/NoInclusionStatesException.java @@ -0,0 +1,16 @@ +package jota.error; + +/** + * This exception occurs when it not possible to get a inclusion state. + * + * @author Adrian + */ +public class NoInclusionStatesException extends BaseException { + + /** + * Initializes a new instance of the NoInclusionStatesException. + */ + public NoInclusionStatesException() { + super("No inclusion states for the provided seed"); + } +} diff --git a/src/main/java/jota/error/NoInclusionStatesExcpection.java b/src/main/java/jota/error/NoInclusionStatesExcpection.java deleted file mode 100644 index 35fc61a..0000000 --- a/src/main/java/jota/error/NoInclusionStatesExcpection.java +++ /dev/null @@ -1,11 +0,0 @@ -package jota.error; - -/** - * @author Adrian - */ -public class NoInclusionStatesExcpection extends BaseException { - - public NoInclusionStatesExcpection() { - super("No inclusion states for the provided seed"); - } -} diff --git a/src/main/java/jota/error/NoNodeInfoException.java b/src/main/java/jota/error/NoNodeInfoException.java index 4df4ff8..fc18040 100644 --- a/src/main/java/jota/error/NoNodeInfoException.java +++ b/src/main/java/jota/error/NoNodeInfoException.java @@ -1,10 +1,14 @@ package jota.error; /** + * This exception occurs when its not possible to get node info. * @author Adrian */ public class NoNodeInfoException extends BaseException { + /** + * Initializes a new instance of the NoNodeInfoException. + */ public NoNodeInfoException() { super("Node info could not be retrieved"); } diff --git a/src/main/java/jota/error/NotEnoughBalanceException.java b/src/main/java/jota/error/NotEnoughBalanceException.java index f417482..3abe9f8 100644 --- a/src/main/java/jota/error/NotEnoughBalanceException.java +++ b/src/main/java/jota/error/NotEnoughBalanceException.java @@ -1,6 +1,8 @@ package jota.error; /** + * This exception occurs when a transfer fails because their is not enough balance to perform the transfer. + * * @author Adrian */ public class NotEnoughBalanceException extends BaseException { @@ -10,6 +12,9 @@ public class NotEnoughBalanceException extends BaseException { */ private static final long serialVersionUID = -3807270816402226476L; + /** + * Initializes a new instance of the NotEnoughBalanceException. + */ public NotEnoughBalanceException() { super("Not enough balance"); } diff --git a/src/main/java/jota/model/Bundle.java b/src/main/java/jota/model/Bundle.java index 6260bc5..0633ad8 100644 --- a/src/main/java/jota/model/Bundle.java +++ b/src/main/java/jota/model/Bundle.java @@ -10,7 +10,8 @@ import java.util.List; /** - * This class represents a Bundle, a set of transactions + * This class represents a Bundle, a set of transactions. + * * @author pinpong **/ public class Bundle implements Comparable { @@ -55,6 +56,7 @@ public class Bundle implements Comparable { /** * Sets the length of the bundle + * * @param length The length. */ public void setLength(int length) { @@ -62,7 +64,8 @@ public class Bundle implements Comparable { } /** - * Adds a bundle entry + * Adds a bundle entry. + * * @param signatureMessageLength Length of the signature message. * @param address The address. * @param value The value. @@ -81,7 +84,8 @@ public class Bundle implements Comparable { } /** - * Finalizes the bundle using the specified curl implementation + * Finalizes the bundle using the specified curl implementation, + * * @param customCurl The custom curl. */ public void finalize(ICurl customCurl) { @@ -115,6 +119,7 @@ public class Bundle implements Comparable { /** * Adds the trytes. + * * @param signatureFragments The signature fragments. */ public void addTrytes(List signatureFragments) { @@ -141,6 +146,7 @@ public class Bundle implements Comparable { /** * Normalized the bundle. + * * @param bundleHash The bundle hash. * @return normalizedBundle A normalized bundle hash. */ @@ -185,6 +191,7 @@ public class Bundle implements Comparable { /** * Compares the current object with another object of the same type. + * * @param o An object to compare with this object. * @return A value that indicates the relative order of the objects being compared. The return value has the following meanings: Value Meaning Less than zero This object is less than the parameter.Zero This object is equal to . Greater than zero This object is greater than . diff --git a/src/main/java/jota/model/Input.java b/src/main/java/jota/model/Input.java index 4114195..0e33c38 100644 --- a/src/main/java/jota/model/Input.java +++ b/src/main/java/jota/model/Input.java @@ -4,7 +4,8 @@ import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; /** - * This class represents an Input + * This class represents an Input. + * * @author Adrian **/ public class Input { @@ -38,7 +39,7 @@ public class Input { /** * Get the address. * - * @return address The address. + * @return The address. */ public String getAddress() { return address; @@ -46,7 +47,8 @@ public class Input { /** * Get the address. - * @param address The address. + * + * @param address The address. */ public void setAddress(String address) { this.address = address; @@ -54,7 +56,8 @@ public class Input { /** * Get the balance. - * @return address The balance. + * + * @return The balance. */ public long getBalance() { return balance; @@ -62,7 +65,8 @@ public class Input { /** * Get the balance. - * @param balance The balance. + * + * @param balance The balance. */ public void setBalance(long balance) { this.balance = balance; @@ -70,7 +74,8 @@ public class Input { /** * Get the keyIndex. - * @return keyIndex The keyIndex. + * + * @return The keyIndex. */ public int getKeyIndex() { return keyIndex; @@ -78,7 +83,8 @@ public class Input { /** * Get the keyIndex. - * @param keyIndex The keyIndex. + * + * @param keyIndex The keyIndex. */ public void setKeyIndex(int keyIndex) { this.keyIndex = keyIndex; @@ -86,7 +92,8 @@ public class Input { /** * Get the security. - * @return security The security. + * + * @return The security. */ public int getSecurity() { return security; @@ -94,7 +101,8 @@ public class Input { /** * Get the security. - * @param security The security. + * + * @param security The security. */ public void setSecurity(int security) { this.security = security; diff --git a/src/main/java/jota/model/Inputs.java b/src/main/java/jota/model/Inputs.java index a7d4cb0..aad6bb4 100644 --- a/src/main/java/jota/model/Inputs.java +++ b/src/main/java/jota/model/Inputs.java @@ -5,7 +5,8 @@ import com.google.gson.Gson; import java.util.List; /** - * This class represents an Inputs + * This class represents an Inputs. + * * @author Adrian **/ public class Inputs { @@ -34,7 +35,7 @@ public class Inputs { /** * Get the input list. * - * @return inputList The input list. + * @return The input list. */ public List getInputsList() { return inputsList; @@ -42,6 +43,7 @@ public class Inputs { /** * Set the input list. + * * @param inputsList The input list. */ public void setInputsList(List inputsList) { @@ -50,7 +52,8 @@ public class Inputs { /** * Get the total balance. - * @return totalBalance The total balance. + * + * @return The total balance. */ public long getTotalBalance() { return totalBalance; @@ -58,6 +61,7 @@ public class Inputs { /** * Set the total balance. + * * @param totalBalance The total balance. */ public void setTotalBalance(long totalBalance) { diff --git a/src/main/java/jota/model/Neighbor.java b/src/main/java/jota/model/Neighbor.java index 1cc4e4f..9937bc0 100644 --- a/src/main/java/jota/model/Neighbor.java +++ b/src/main/java/jota/model/Neighbor.java @@ -1,7 +1,8 @@ package jota.model; /** - * This class represents an Neighbor + * This class represents an Neighbor. + * * @author pinpong **/ public class Neighbor { @@ -24,7 +25,7 @@ public class Neighbor { /** * Get the address. * - * @return address The address. + * @return The address. */ public String getAddress() { return address; @@ -33,7 +34,7 @@ public class Neighbor { /** * Get the number of all transactions. * - * @return numberOfAllTransactions The number of all transactions. + * @return The number of all transactions. */ public Integer getNumberOfAllTransactions() { return numberOfAllTransactions; @@ -41,7 +42,8 @@ public class Neighbor { /** * Get the number of invalid transactions. - * @return numberOfInvalidTransactions The number of invalid transactions. + * + * @return The number of invalid transactions. */ public Integer getNumberOfInvalidTransactions() { return numberOfInvalidTransactions; @@ -49,7 +51,8 @@ public class Neighbor { /** * Get the number of nwe transactions. - * @return numberOfNewTransactions The number of new transactions. + * + * @return The number of new transactions. */ public Integer getNumberOfNewTransactions() { return numberOfNewTransactions; diff --git a/src/main/java/jota/model/Signature.java b/src/main/java/jota/model/Signature.java index f5f6f9f..de10ef2 100644 --- a/src/main/java/jota/model/Signature.java +++ b/src/main/java/jota/model/Signature.java @@ -4,7 +4,8 @@ import java.util.ArrayList; import java.util.List; /** - * This class represents an Signature + * This class represents an Signature. + * * @author Adrian **/ public class Signature { @@ -22,7 +23,7 @@ public class Signature { /** * Get the address. * - * @return address The address. + * @return The address. */ public String getAddress() { return address; @@ -39,7 +40,8 @@ public class Signature { /** * Get the signatureFragments. - * @return signatureFragments The signatureFragments. + * + * @return The signatureFragments. */ public List getSignatureFragments() { return signatureFragments; @@ -47,6 +49,7 @@ public class Signature { /** * Set the signatureFragments. + * * @param signatureFragments The signatureFragments. */ public void setSignatureFragments(List signatureFragments) { diff --git a/src/main/java/jota/model/Transaction.java b/src/main/java/jota/model/Transaction.java index a1fc6ff..ed7090d 100644 --- a/src/main/java/jota/model/Transaction.java +++ b/src/main/java/jota/model/Transaction.java @@ -12,7 +12,8 @@ import org.slf4j.LoggerFactory; import java.util.Arrays; /** - * This class represents an iota transaction + * This class represents an iota transaction. + * * @author pinpong */ public class Transaction { @@ -105,7 +106,7 @@ public class Transaction { /** * Get the hash. * - * @return hash The hash. + * @return The hash. */ public String getHash() { return hash; @@ -113,6 +114,7 @@ public class Transaction { /** * Set the hash. + * * @param hash The hash. */ public void setHash(String hash) { @@ -121,7 +123,8 @@ public class Transaction { /** * Get the signature fragments. - * @return signatureFragments The signature fragments. + * + * @return The signature fragments. */ public String getSignatureFragments() { return signatureFragments; @@ -129,6 +132,7 @@ public class Transaction { /** * Set the signature fragments. + * * @param signatureFragments The signature fragments. */ public String setSignatureFragments(String signatureFragments) { @@ -137,7 +141,8 @@ public class Transaction { /** * Get the address. - * @return address The address. + * + * @return The address. */ public String getAddress() { return address; @@ -145,6 +150,7 @@ public class Transaction { /** * Set the address. + * * @param address The address. */ public void setAddress(String address) { @@ -153,7 +159,8 @@ public class Transaction { /** * Get the value. - * @return value The value. + * + * @return The value. */ public String getValue() { return value; @@ -161,6 +168,7 @@ public class Transaction { /** * Set the value. + * * @param value The value. */ public void setValue(String value) { @@ -169,7 +177,8 @@ public class Transaction { /** * Get the tag. - * @return tag The tag. + * + * @return The tag. */ public String getTag() { return tag; @@ -177,6 +186,7 @@ public class Transaction { /** * Set the tag. + * * @param tag The tag. */ public void setTag(String tag) { @@ -185,7 +195,8 @@ public class Transaction { /** * Get the timestamp. - * @return timestamp The timestamp. + * + * @return The timestamp. */ public String getTimestamp() { return timestamp; @@ -193,6 +204,7 @@ public class Transaction { /** * Set the timestamp. + * * @param timestamp The timestamp. */ public void setTimestamp(String timestamp) { @@ -201,7 +213,8 @@ public class Transaction { /** * Get the current index. - * @return currentIndex The current index. + * + * @return The current index. */ public String getCurrentIndex() { return currentIndex; @@ -217,7 +230,8 @@ public class Transaction { /** * Get the last index. - * @return lastIndex The last index. + * + * @return The last index. */ public String getLastIndex() { return lastIndex; @@ -225,6 +239,7 @@ public class Transaction { /** * Set the last index. + * * @param lastIndex The last index. */ public String setLastIndex(String lastIndex) { @@ -233,7 +248,8 @@ public class Transaction { /** * Get the bundle. - * @return bundle The bundle. + * + * @return The bundle. */ public String getBundle() { return bundle; @@ -241,6 +257,7 @@ public class Transaction { /** * Set the bundle. + * * @param bundle The bundle. */ public void setBundle(String bundle) { @@ -249,7 +266,8 @@ public class Transaction { /** * Get the trunk transaction. - * @return trunkTransaction The trunk transaction. + * + * @return The trunk transaction. */ public String getTrunkTransaction() { return trunkTransaction; @@ -257,6 +275,7 @@ public class Transaction { /** * Set the trunk transaction. + * * @param trunkTransaction The trunk transaction. */ public void setTrunkTransaction(String trunkTransaction) { @@ -265,7 +284,8 @@ public class Transaction { /** * Get the branch transaction. - * @return branchTransaction The branch transaction. + * + * @return The branch transaction. */ public String getBranchTransaction() { return branchTransaction; @@ -273,6 +293,7 @@ public class Transaction { /** * Set the branch transaction. + * * @param branchTransaction The branch transaction. */ public void setBranchTransaction(String branchTransaction) { @@ -281,7 +302,8 @@ public class Transaction { /** * Get the nonce. - * @return nonce The nonce. + * + * @return The nonce. */ public String getNonce() { return nonce; @@ -289,6 +311,7 @@ public class Transaction { /** * Set the nonce. + * * @param nonce The trunk nonce. */ public void setNonce(String nonce) { @@ -297,7 +320,8 @@ public class Transaction { /** * Get the persistence. - * @return persistence The persistence. + * + * @return The persistence. */ public Boolean getPersistence() { return persistence; @@ -305,6 +329,7 @@ public class Transaction { /** * Set the persistence. + * * @param persistence The persistence. */ public void setPersistence(Boolean persistence) { diff --git a/src/main/java/jota/model/Transfer.java b/src/main/java/jota/model/Transfer.java index 50f9310..545e6e0 100644 --- a/src/main/java/jota/model/Transfer.java +++ b/src/main/java/jota/model/Transfer.java @@ -3,7 +3,8 @@ package jota.model; import com.google.gson.Gson; /** - * This class represents a Transfer + * This class represents a Transfer. + * * @author pinpong */ public class Transfer { @@ -54,14 +55,15 @@ public class Transfer { /** * Get the address. * - * @return address The address. + * @return The address. */ public String getAddress() { return address; } /** - * Set the address + * Set the address. + * * @param address The address. */ public void setAddress(String address) { @@ -70,14 +72,16 @@ public class Transfer { /** * Get the hash. - * @return hash The hash. + * + * @return The hash. */ public String getHash() { return hash; } /** - * Set the hash + * Set the hash. + * * @param hash The hash. */ public void setHash(String hash) { @@ -86,14 +90,16 @@ public class Transfer { /** * Get the persistence. - * @return persistence The persistence. + * + * @return The persistence. */ public Boolean getPersistence() { return persistence; } /** - * Set the persistence + * Set the persistence. + * * @param persistence The persistence. */ public void setPersistence(Boolean persistence) { @@ -102,14 +108,16 @@ public class Transfer { /** * Get the timestamp. - * @return timestamp The timestamp. + * + * @return The timestamp. */ public String getTimestamp() { return timestamp; } /** - * Set the timestamp + * Set the timestamp. + * * @param timestamp The timestamp. */ public void setTimestamp(String timestamp) { @@ -118,14 +126,16 @@ public class Transfer { /** * Get the value. - * @return value The value. + * + * @return The value. */ public long getValue() { return value; } /** - * Set the value + * Set the value. + * * @param value The value. */ public void setValue(long value) { @@ -134,14 +144,16 @@ public class Transfer { /** * Get the message. - * @return message The message. + * + * @return The message. */ public String getMessage() { return message; } /** - * Set the message + * Set the message. + * * @param message The message. */ public void setMessage(String message) { @@ -150,14 +162,16 @@ public class Transfer { /** * Get the tag. - * @return tag The tag. + * + * @return The tag. */ public String getTag() { return tag; } /** - * Set the tag + * Set the tag. + * * @param tag The tag. */ public void setTag(String tag) { diff --git a/src/main/java/jota/pow/ICurl.java b/src/main/java/jota/pow/ICurl.java index bfaf113..01ab12c 100644 --- a/src/main/java/jota/pow/ICurl.java +++ b/src/main/java/jota/pow/ICurl.java @@ -1,7 +1,8 @@ package jota.pow; /** - * This interface abstracts the curl hashing algorithm + * This interface abstracts the curl hashing algorithm. + * * @author Adrian */ public interface ICurl { @@ -12,7 +13,7 @@ public interface ICurl { * @param trits The trits. * @param offset The offset to start from. * @param length The length. - * @return + * @return The ICurl instance (used for method chaining). */ ICurl absorb(final int[] trits, int offset, int length); @@ -20,53 +21,60 @@ public interface ICurl { * Absorbs the specified trits. * * @param trits The trits. - * @return + * @return The ICurl instance (used for method chaining). */ ICurl absorb(final int[] trits); /** * Squeezes the specified trits. + * * @param trits The trits. * @param offset The offset to start from. * @param length The length. - * @return + * @return The squeezed trits. */ int[] squeeze(final int[] trits, int offset, int length); /** * Squeezes the specified trits. + * * @param trits The trits. - * @return + * @return The squeezed trits. */ int[] squeeze(final int[] trits); /** * Transforms this instance. - * @return + * + * @return The ICurl instance (used for method chaining). */ ICurl transform(); /** * Resets this state. - * @return + * + * @return The ICurl instance (used for method chaining). */ ICurl reset(); /** * Gets or sets the state. - * @return + * + * @return The stae. */ int[] getState(); /** * Sets or sets the state. - * @param state + * + * @param state The state. */ void setState(int[] state); /** * Clones this instance. - * @return + * + * @return A new instance. */ ICurl clone(); } diff --git a/src/main/java/jota/pow/JCurl.java b/src/main/java/jota/pow/JCurl.java index f08a537..b23d3d7 100644 --- a/src/main/java/jota/pow/JCurl.java +++ b/src/main/java/jota/pow/JCurl.java @@ -7,6 +7,9 @@ package jota.pow; */ public class JCurl implements ICurl { + /** + * The hash length. + */ public static final int HASH_LENGTH = 243; private static final int STATE_LENGTH = 3 * HASH_LENGTH; @@ -15,6 +18,14 @@ public class JCurl implements ICurl { private int[] state = new int[STATE_LENGTH]; + /** + * Absorbs the specified trits. + * + * @param trits The trits. + * @param offset The offset to start from. + * @param length The length. + * @return The ICurl instance (used for method chaining). + */ public JCurl absorb(final int[] trits, int offset, int length) { do { @@ -26,11 +37,21 @@ public class JCurl implements ICurl { return this; } - + /** + * Absorbs the specified trits. + * + * @param trits The trits. + * @return The ICurl instance (used for method chaining). + */ public JCurl absorb(final int[] trits) { return absorb(trits, 0, trits.length); } + /** + * Transforms this instance. + * + * @return The ICurl instance (used for method chaining). + */ public JCurl transform() { final int[] scratchpad = new int[STATE_LENGTH]; @@ -44,6 +65,11 @@ public class JCurl implements ICurl { return this; } + /** + * Resets this state. + * + * @return The ICurl instance (used for method chaining). + */ public JCurl reset() { for (int stateIndex = 0; stateIndex < STATE_LENGTH; stateIndex++) { state[stateIndex] = 0; @@ -51,6 +77,14 @@ public class JCurl implements ICurl { return this; } + /** + * Squeezes the specified trits. + * + * @param trits The trits. + * @param offset The offset to start from. + * @param length The length. + * @return The squeezes trits. + */ public int[] squeeze(final int[] trits, int offset, int length) { do { @@ -62,18 +96,39 @@ public class JCurl implements ICurl { return state; } + /** + * Squeezes the specified trits. + * + * @param trits The trits. + * @return The squeezes trits. + */ public int[] squeeze(final int[] trits) { return squeeze(trits, 0, trits.length); } + /** + * Gets the states. + * + * @return The state. + */ public int[] getState() { return state; } + /** + * Sets the state. + * + * @param state The states. + */ public void setState(int[] state) { this.state = state; } + /** + * Clones this instance. + * + * @return A new instance. + */ @Override public ICurl clone() { return new JCurl(); diff --git a/src/main/java/jota/utils/Checksum.java b/src/main/java/jota/utils/Checksum.java index ff901b3..7627570 100644 --- a/src/main/java/jota/utils/Checksum.java +++ b/src/main/java/jota/utils/Checksum.java @@ -4,17 +4,18 @@ import jota.error.InvalidAddressException; import jota.pow.JCurl; /** - * This class defines utility methods to add/remove the checksum to/from an address + * This class defines utility methods to add/remove the checksum to/from an address. + * * @author pinpong */ public class Checksum { /** - * Adds the checksum to the specified address + * Adds the checksum to the specified address. * - * @param address address without checksum - * @return the address with the appended checksum - * @exception InvalidAddressException is thrown when the specified address is not an valid address + * @param address The address without checksum. + * @return The address with the appended checksum. + * @throws InvalidAddressException is thrown when the specified address is not an valid address. **/ public static String addChecksum(String address) throws InvalidAddressException { InputValidator.checkAddress(address); @@ -24,35 +25,29 @@ public class Checksum { } /** - * Remove the checksum to the specified address + * Remove the checksum to the specified address. * - * @param address address with checksum - * @return the address without checksum - * @exception InvalidAddressException is thrown when the specified address is not an address with checksum + * @param address The address with checksum. + * @return The address without checksum. + * @throws InvalidAddressException is thrown when the specified address is not an address with checksum. **/ public static String removeChecksum(String address) throws InvalidAddressException { if (isAddressWithChecksum(address)) { - return getAddress(address); + return removeChecksumFromAddress(address); } throw new InvalidAddressException(); } - /** - * remove checksum length - * - * @param addressWithChecksum address with checksum - * @return address without checksum - **/ - private static String getAddress(String addressWithChecksum) { + private static String removeChecksumFromAddress(String addressWithChecksum) { return addressWithChecksum.substring(0, Constants.ADDRESS_LENGTH_WITHOUT_CHECKSUM); } /** * Determines whether the specified address with checksum has a valid checksum. * - * @param addressWithChecksum address - * @return true if the specified address with checksum has a valid checksum [the specified address with checksum]; otherwise, false. - * @exception InvalidAddressException is thrown when the specified address is not an valid address + * @param addressWithChecksum The address with checksum. + * @return true if the specified address with checksum has a valid checksum [the specified address with checksum]; otherwise, false. + * @throws InvalidAddressException is thrown when the specified address is not an valid address. **/ public static boolean isValidChecksum(String addressWithChecksum) throws InvalidAddressException { String addressWithoutChecksum = removeChecksum(addressWithChecksum); @@ -62,11 +57,11 @@ public class Checksum { /** - * check if specified address is a address with checksum + * Check if specified address is a address with checksum. * - * @param address address - * @return boolean - * @exception InvalidAddressException is thrown when the specified address is not an valid address + * @param address The address to check. + * @return true if the specified address is with checksum ; otherwise, false. + * @throws InvalidAddressException is thrown when the specified address is not an valid address **/ public static boolean isAddressWithChecksum(String address) throws InvalidAddressException { return InputValidator.checkAddress(address) && address.length() == Constants.ADDRESS_LENGTH_WITH_CHECKSUM; @@ -78,18 +73,12 @@ public class Checksum { * * @param address address * @return boolean - * @exception InvalidAddressException is thrown when the specified address is not an valid address + * @throws InvalidAddressException is thrown when the specified address is not an valid address **/ public static boolean isAddressWithoutChecksum(String address) throws InvalidAddressException { return InputValidator.checkAddress(address) && address.length() == Constants.ADDRESS_LENGTH_WITHOUT_CHECKSUM; } - /** - * calculate the checksum to the specified address - * - * @param address address - * @return the checksum - **/ private static String calculateChecksum(String address) { JCurl curl = new JCurl(); curl.reset(); diff --git a/src/main/java/jota/utils/Constants.java b/src/main/java/jota/utils/Constants.java index bdcd419..5781486 100644 --- a/src/main/java/jota/utils/Constants.java +++ b/src/main/java/jota/utils/Constants.java @@ -1,7 +1,8 @@ package jota.utils; /** - * This class defines the global constants + * This class defines the global constants. + * * @author pinpong */ public class Constants { diff --git a/src/main/java/jota/utils/Converter.java b/src/main/java/jota/utils/Converter.java index 3bbc888..3500154 100644 --- a/src/main/java/jota/utils/Converter.java +++ b/src/main/java/jota/utils/Converter.java @@ -5,7 +5,7 @@ import java.util.LinkedList; import java.util.List; /** - * This class provides a set of utility methods to are used to convert between different formats + * This class provides a set of utility methods to are used to convert between different formats. */ public class Converter { @@ -47,12 +47,12 @@ public class Converter { } /** - * Converts the specified trits array to bytes + * Converts the specified trits array to bytes. * - * @param trits The trits. + * @param trits The trits. * @param offset The offset to start from. - * @param size The size. - * @return bytes + * @param size The size. + * @return The bytes. */ public static byte[] bytes(final int[] trits, final int offset, final int size) { @@ -74,7 +74,7 @@ public class Converter { } /** - * Gets the trits from the specified bytes and stores it into the provided trits array + * Gets the trits from the specified bytes and stores it into the provided trits array. * * @param bytes The bytes. * @param trits The trits. @@ -104,7 +104,7 @@ public class Converter { * * @param trytes The trytes. * @param length The length - * @return a trits array. + * @return A trits array. */ public static int[] trits(final String trytes, int length) { int[] trits = trits(trytes); @@ -121,10 +121,10 @@ public class Converter { } /** - * Converts the specified trinary encoded trytes string to trits + * Converts the specified trinary encoded trytes string to trits. * * @param trytes The trytes. - * @return a trits array + * @return A trits array. */ public static int[] tritsString(final String trytes) { int[] d = new int[3 * trytes.length()]; @@ -135,10 +135,10 @@ public class Converter { } /** - * Converts trytes into trits + * Converts trytes into trits. * - * @param trytes trytes to be converted - * @return array of trits + * @param trytes The trytes to be converted. + * @return Array of trits. **/ public static int[] trits(final String trytes) { final List trits = new LinkedList<>(); @@ -180,9 +180,9 @@ public class Converter { /** * Copies the trits from the input string into the destination array * - * @param input The input String. + * @param input The input String. * @param destination The destination array. - * @return destination The destination. + * @return The destination. */ public static int[] copyTrits(final String input, final int[] destination) { for (int i = 0; i < input.length(); i++) { @@ -195,12 +195,12 @@ public class Converter { } /** - * Converts trites to trytes + * Converts trites to trytes. * - * @param trits trits to be converted - * @param offset - * @param size - * @return trytes + * @param trits Teh trits to be converted. + * @param offset The offset to start from. + * @param size The size. + * @return The trytes. **/ public static String trytes(final int[] trits, final int offset, final int size) { @@ -222,21 +222,21 @@ public class Converter { } /** - * Converts the specified trits array to trytes in integer representation + * Converts the specified trits array to trytes in integer representation. * * @param trits The trits. - * @param offset The offset. - * @return value The value. + * @param offset The offset to start from. + * @return The value. */ public static int tryteValue(final int[] trits, final int offset) { return trits[offset] + trits[offset + 1] * 3 + trits[offset + 2] * 9; } /** - * Converts the specified trits to its corresponding integer value + * Converts the specified trits to its corresponding integer value. * * @param trits The trits. - * @return value The value. + * @return The value. */ public static int value(final int[] trits) { int value = 0; @@ -248,10 +248,10 @@ public class Converter { } /** - * Converts the specified trits to its corresponding integer value + * Converts the specified trits to its corresponding integer value. * * @param trits The trits. - * @return value The value + * @return The value. */ public static long longValue(final int[] trits) { long value = 0; diff --git a/src/main/java/jota/utils/InputValidator.java b/src/main/java/jota/utils/InputValidator.java index 2c5f3c0..e3d6a85 100644 --- a/src/main/java/jota/utils/InputValidator.java +++ b/src/main/java/jota/utils/InputValidator.java @@ -8,16 +8,17 @@ import org.apache.commons.lang3.math.NumberUtils; import java.util.List; /** - * This class provides methods to validate the parameters of different iota API methods + * This class provides methods to validate the parameters of different iota API methods. + * * @author pinpong */ public class InputValidator { /** - * Determines whether the specified string is an adrdress. + * Determines whether the specified string is an address. * - * @param address address to validate - * @return true if the specified string is an address; otherwise, false. + * @param address The address to validate. + * @return true if the specified string is an address; otherwise, false. **/ public static boolean isAddress(String address) { return (address.length() == Constants.ADDRESS_LENGTH_WITHOUT_CHECKSUM || @@ -25,11 +26,11 @@ public class InputValidator { } /** - * Checks whether the specified address is an address and throws and exception if the address is invalid + * Checks whether the specified address is an address and throws and exception if the address is invalid. * - * @param address address to validate - * @return true if the specified string is an address; otherwise, false. - * @exception InvalidAddressException is thrown when the specified address is not an valid address + * @param address The address to validate. + * @return true if the specified string is an address; otherwise, false. + * @throws InvalidAddressException is thrown when the specified address is not an valid address. **/ public static boolean checkAddress(String address) throws InvalidAddressException { if (!isAddress(address)) { @@ -39,11 +40,11 @@ public class InputValidator { } /** - * Determines whether the specified string contains only characters from the trytes alphabet (see ) + * Determines whether the specified string contains only characters from the trytes alphabet (see ). * - * @param trytes the trytes - * @param length the length - * @return true if the specified trytes are trytes otherwise, false. + * @param trytes The trytes to validate. + * @param length The length. + * @return true if the specified trytes are trytes otherwise, false. **/ public static boolean isTrytes(final String trytes, final int length) { return trytes.matches("^[A-Z9]{" + (length == 0 ? "0," : length) + "}$"); @@ -52,29 +53,29 @@ public class InputValidator { /** * Determines whether the specified string consist only of '9'. * - * @param trytes The trytes. + * @param trytes The trytes to validate. * @param length The length. - * @return true if the specified string consist only of '9'; otherwise, false. + * @return true if the specified string consist only of '9'; otherwise, false. **/ public static boolean isNinesTrytes(final String trytes, final int length) { return trytes.matches("^[9]{" + (length == 0 ? "0," : length) + "}$"); } /** - * Determines whether the specified string represents a signed integer + * Determines whether the specified string represents a signed integer. * - * @param value the value - * @return true the specified string represents an integer value; otherwise, false. + * @param value The value to validate. + * @return true the specified string represents an integer value; otherwise, false. **/ public static boolean isValue(final String value) { return NumberUtils.isNumber(value); } /** - * Determines whether the specified string array contains only trytes + * Determines whether the specified string array contains only trytes. * - * @param trytes The trytes. - * @return true if the specified array contains only valid trytes otherwise, false. + * @param trytes The trytes array to validate. + * @return true if the specified array contains only valid trytes otherwise, false. **/ public static boolean isArrayOfTrytes(String[] trytes){ for (String tryte : trytes) { @@ -87,10 +88,10 @@ public class InputValidator { } /** - * Determines whether the specified array contains only valid hashes + * Determines whether the specified array contains only valid hashes. * - * @param hashes The hashes. - * @return true the specified array contains only valid hashes; otherwise, false. + * @param hashes The hashes array to validate. + * @return true the specified array contains only valid hashes; otherwise, false. **/ public static boolean isArrayOfHashes(String[] hashes) { if (hashes == null) @@ -112,10 +113,10 @@ public class InputValidator { } /** - * Determines whether the specified transfers are valid + * Determines whether the specified transfers are valid. * - * @param transfers The transfers. - * @return true if the specified transfers are valid; otherwise, false. + * @param transfers The transfers list to validate. + * @return true if the specified transfers are valid; otherwise, false. **/ public static boolean isTransfersCollectionValid(final List transfers) { @@ -130,8 +131,8 @@ public class InputValidator { /** * Determines whether the specified transfer is valid. * - * @param transfer The transfer. - * @return true if the specified transfer is valid; otherwise, false. + * @param transfer The transfer to validate. + * @return true if the specified transfer is valid; otherwise, false>. **/ public static boolean isValidTransfer(final Transfer transfer) { @@ -151,9 +152,9 @@ public class InputValidator { /** * Checks if the seed is valid. If not, an exception is thrown. * - * @param seed the seed - * @return validated seed - * @exception IllegalStateException Format not in trytes or Invalid Seed: Seed too long + * @param seed The seed to validate. + * @return The validated seed. + * @throws IllegalStateException Format not in trytes or Invalid Seed: Seed too long. **/ public static String validateSeed(String seed) { if (seed.length() > 81) diff --git a/src/main/java/jota/utils/IotaAPIUtils.java b/src/main/java/jota/utils/IotaAPIUtils.java index db38396..5b7f2b8 100644 --- a/src/main/java/jota/utils/IotaAPIUtils.java +++ b/src/main/java/jota/utils/IotaAPIUtils.java @@ -12,7 +12,7 @@ import java.util.Collections; import java.util.List; /** - * Client Side computation service + * Client Side computation service. * * @author davassi */ @@ -21,13 +21,13 @@ public class IotaAPIUtils { /** * Generates a new address * - * @param seed tryte-encoded seed. It should be noted that this seed is not transferred - * @param security security secuirty level of private key / seed - * @param index key index to start search from. If the index is provided, the generation of the address is not deterministic. - * @param checksum adds 9-tryte address checksum - * @param curl - * @return an String with address - * @exception InvalidAddressException is thrown when the specified address is not an valid address + * @param seed The tryte-encoded seed. It should be noted that this seed is not transferred. + * @param security The secuirty level of private key / seed. + * @param index The index to start search from. If the index is provided, the generation of the address is not deterministic. + * @param checksum The adds 9-tryte address checksum + * @param curl The curl instance. + * @return An String with address. + * @throws InvalidAddressException is thrown when the specified address is not an valid address. */ public static String newAddress(String seed, int security, int index, boolean checksum, ICurl curl) throws InvalidAddressException { Signing signing = new Signing(curl); diff --git a/src/main/java/jota/utils/IotaUnitConverter.java b/src/main/java/jota/utils/IotaUnitConverter.java index 7b0635c..c9e1cf1 100644 --- a/src/main/java/jota/utils/IotaUnitConverter.java +++ b/src/main/java/jota/utils/IotaUnitConverter.java @@ -3,18 +3,19 @@ package jota.utils; import java.text.DecimalFormat; /** - * This class provides methods to convert Iota to different units + * This class provides methods to convert Iota to different units. + * * @author sascha */ public class IotaUnitConverter { /** - * convert the iota amount + * Convert the iota amount. * - * @param amount the amount - * @param fromUnit the source unit e.g. the unit of amount - * @param toUnit the target unit - * @return the specified amount in the target unit + * @param amount The amount. + * @param fromUnit The source unit e.g. the unit of amount. + * @param toUnit The target unit. + * @return The specified amount in the target unit. **/ public static long convertUnits(long amount, IotaUnits fromUnit, IotaUnits toUnit) { long amountInSource = (long) (amount * Math.pow(10, fromUnit.getValue())); @@ -22,22 +23,22 @@ public class IotaUnitConverter { } /** - * convert unit + * Convert unit. * - * @param amount the amount - * @param toUnit the target unit - * @return the specified amount in the target unit + * @param amount The amount. + * @param toUnit The target unit. + * @return The specified amount in the target unit. **/ private static long convertUnits(long amount, IotaUnits toUnit) { return (long) (amount / Math.pow(10, toUnit.getValue())); } /** - * convert the iota amount to text + * Convert the iota amount to text. * - * @param amount the amount - * @param extended extended length - * @return the specified amount in the target unit + * @param amount The amount. + * @param extended Extended length. + * @return The specified amount in the target unit. **/ public static String convertRawIotaAmountToDisplayText(long amount, boolean extended) { IotaUnits unit = findOptimalIotaUnitToDisplay(amount); @@ -46,22 +47,22 @@ public class IotaUnitConverter { } /** - * convert amount to target unit + * Convert amount to target unit. * - * @param amount the amount - * @return the target unit + * @param amount The amount. + * @return The target unit. **/ public static double convertAmountTo(long amount, IotaUnits target) { return amount / Math.pow(10, target.getValue()); } /** - * create amount with unit text + * Create amount with unit text. * - * @param amountInUnit the amount in units - * @param unit the unit - * @param extended extended length - * @return the target unit + * @param amountInUnit The amount in units. + * @param unit The unit. + * @param extended Extended length. + * @return The target unit. **/ private static String createAmountWithUnitDisplayText(double amountInUnit, IotaUnits unit, boolean extended) { String result = createAmountDisplayText(amountInUnit, unit, extended); @@ -70,12 +71,12 @@ public class IotaUnitConverter { } /** - * create amount text + * Create amount text. * - * @param amountInUnit the amount in units - * @param unit the unit - * @param extended extended length - * @return the target unit + * @param amountInUnit The amount in units. + * @param unit The unit. + * @param extended Extended length. + * @return The target unit. **/ public static String createAmountDisplayText(double amountInUnit, IotaUnits unit, boolean extended) { DecimalFormat df; @@ -90,10 +91,10 @@ public class IotaUnitConverter { } /** - * finds the optimal unit to display the specified amount in + * Finds the optimal unit to display the specified amount in. * - * @param amount the amount - * @return the optimal IotaUnit + * @param amount The amount. + * @return The optimal IotaUnit. **/ public static IotaUnits findOptimalIotaUnitToDisplay(long amount) { int length = String.valueOf(amount).length(); diff --git a/src/main/java/jota/utils/IotaUnits.java b/src/main/java/jota/utils/IotaUnits.java index 8860f63..e64895f 100644 --- a/src/main/java/jota/utils/IotaUnits.java +++ b/src/main/java/jota/utils/IotaUnits.java @@ -1,7 +1,8 @@ package jota.utils; /** - * Table of IOTA units based off of the standard system of Units + * Table of IOTA units based off of the standard system of Units. + * * @author pinpong **/ public enum IotaUnits { @@ -27,7 +28,7 @@ public enum IotaUnits { /** * Gets the unit. * - * @return unit The IOTA Unit. + * @return The IOTA Unit. */ public String getUnit() { return unit; @@ -36,7 +37,7 @@ public enum IotaUnits { /** * Gets the value. * - * @return unit The value. + * @return The value. */ public long getValue() { return value; diff --git a/src/main/java/jota/utils/Multisig.java b/src/main/java/jota/utils/Multisig.java index f2b07b4..e7f3fc7 100644 --- a/src/main/java/jota/utils/Multisig.java +++ b/src/main/java/jota/utils/Multisig.java @@ -129,7 +129,7 @@ public class Multisig { * @param bundleToSign * @param inputAddress * @param keyTrytes - * @return trytes Returns bundle trytes + * @return Returns bundle trytes. **/ private void addSignature(Bundle[] bundleToSign, String inputAddress, String keyTrytes) { diff --git a/src/main/java/jota/utils/NamedThreadFactory.java b/src/main/java/jota/utils/NamedThreadFactory.java index 4f92e1a..9bc015a 100644 --- a/src/main/java/jota/utils/NamedThreadFactory.java +++ b/src/main/java/jota/utils/NamedThreadFactory.java @@ -8,13 +8,21 @@ import java.util.concurrent.atomic.AtomicInteger; * @author Adrian */ public class NamedThreadFactory implements ThreadFactory { + private final String baseName; private final AtomicInteger threadNum = new AtomicInteger(0); + /** + * @param baseName + */ public NamedThreadFactory(String baseName) { this.baseName = baseName; } + /** + * @param r + * @return + */ @Override public synchronized Thread newThread(Runnable r) { Thread t = Executors.defaultThreadFactory().newThread(r); diff --git a/src/main/java/jota/utils/Parallel.java b/src/main/java/jota/utils/Parallel.java index 3dccff4..0b2556b 100644 --- a/src/main/java/jota/utils/Parallel.java +++ b/src/main/java/jota/utils/Parallel.java @@ -11,10 +11,15 @@ import java.util.concurrent.Executors; * @author Adrian */ public class Parallel { - private static final int NUM_CORES = Runtime.getRuntime().availableProcessors(); + private static final int NUM_CORES = Runtime.getRuntime().availableProcessors(); private static final ExecutorService forPool = Executors.newFixedThreadPool(NUM_CORES * 2, new NamedThreadFactory("Parallel.For")); + /** + * @param elements + * @param operation + * @param + */ public static void For(final Iterable elements, final Operation operation) { try { // invokeAll blocks for us until all submitted tasks in the call complete @@ -24,6 +29,12 @@ public class Parallel { } } + /** + * @param elements + * @param operation + * @param + * @return + */ public static Collection> createCallables(final Iterable elements, final Operation operation) { List> callables = new LinkedList<>(); for (final T elem : elements) { @@ -39,6 +50,10 @@ public class Parallel { return callables; } + /** + * + * @param + */ public interface Operation { void perform(T pParameter); } diff --git a/src/main/java/jota/utils/SeedRandomGenerator.java b/src/main/java/jota/utils/SeedRandomGenerator.java index fd5b93a..9c58b9e 100644 --- a/src/main/java/jota/utils/SeedRandomGenerator.java +++ b/src/main/java/jota/utils/SeedRandomGenerator.java @@ -3,16 +3,17 @@ package jota.utils; import java.security.SecureRandom; /** - * This class allows to create a secure random generated seed + * This class allows to create a secure random generated seed. + * * @author pinpong */ public class SeedRandomGenerator { /** - * generate a new seed + * Generate a new seed. * - * @return random generated seed + * @return Random generated seed. **/ public static String generateNewSeed() { char[] chars = Constants.TRYTE_ALPHABET.toCharArray(); diff --git a/src/main/java/jota/utils/Signing.java b/src/main/java/jota/utils/Signing.java index 30b55e8..798431b 100644 --- a/src/main/java/jota/utils/Signing.java +++ b/src/main/java/jota/utils/Signing.java @@ -9,6 +9,10 @@ import java.util.Arrays; import java.util.List; public class Signing { + + /** + * Ask @come-from-beyond + */ private ICurl curl; public Signing() { diff --git a/src/main/java/jota/utils/StopWatch.java b/src/main/java/jota/utils/StopWatch.java index 18ec7bc..c68b383 100644 --- a/src/main/java/jota/utils/StopWatch.java +++ b/src/main/java/jota/utils/StopWatch.java @@ -4,36 +4,56 @@ package jota.utils; * @author adrian */ public class StopWatch { + private long startTime = 0; private boolean running = false; private long currentTime = 0; + /** + * + */ public StopWatch() { this.startTime = System.currentTimeMillis(); this.running = true; } + /** + * + */ public void reStart() { this.startTime = System.currentTimeMillis(); this.running = true; } + /** + * @return + */ public StopWatch stop() { this.running = false; return this; } + /** + * + */ public void pause() { this.running = false; currentTime = System.currentTimeMillis() - startTime; } + /** + * + */ public void resume() { this.running = true; this.startTime = System.currentTimeMillis() - currentTime; } - //elaspsed time in milliseconds + /** + * Elapsed time in milliseconds. + * + * @return + */ public long getElapsedTimeMili() { long elapsed = 0; if (running) { @@ -42,7 +62,11 @@ public class StopWatch { return elapsed; } - //elaspsed time in seconds + /** + * Elapsed time in seconds. + * + * @return + */ public long getElapsedTimeSecs() { long elapsed = 0; if (running) { @@ -51,7 +75,11 @@ public class StopWatch { return elapsed; } - //elaspsed time in minutes + /** + * Elapsed time in minutes. + * + * @return + */ public long getElapsedTimeMin() { long elapsed = 0; if (running) { @@ -60,7 +88,11 @@ public class StopWatch { return elapsed; } - //elaspsed time in hours + /** + * Elapsed time in hours. + * + * @return + */ public long getElapsedTimeHour() { long elapsed = 0; if (running) { diff --git a/src/main/java/jota/utils/TrytesConverter.java b/src/main/java/jota/utils/TrytesConverter.java index 376167a..0bddd7d 100644 --- a/src/main/java/jota/utils/TrytesConverter.java +++ b/src/main/java/jota/utils/TrytesConverter.java @@ -1,7 +1,8 @@ package jota.utils; /** - * This class allows to convert between ASCII and tryte encoded strings + * This class allows to convert between ASCII and tryte encoded strings. + * * @author pinpong */ public class TrytesConverter { @@ -34,7 +35,7 @@ public class TrytesConverter { * Our tryte pair is "IC" * * - * @param inputString + * @param inputString The input String. * @return The ASCII char "Z" is represented as "IC" in trytes. */ public static String toTrytes(String inputString) { diff --git a/src/test/java/jota/IotaAPITest.java b/src/test/java/jota/IotaAPITest.java index e3c9a3a..11dd2dd 100644 --- a/src/test/java/jota/IotaAPITest.java +++ b/src/test/java/jota/IotaAPITest.java @@ -131,7 +131,7 @@ public class IotaAPITest { } @Test - public void shouldGetTransfers() throws InvalidBundleException, ArgumentException, InvalidSignatureException, NoInclusionStatesExcpection, NoNodeInfoException, InvalidSecurityLevelException, InvalidAddressException { + public void shouldGetTransfers() throws InvalidBundleException, ArgumentException, InvalidSignatureException, NoInclusionStatesException, NoNodeInfoException, InvalidSecurityLevelException, InvalidAddressException { GetTransferResponse gtr = iotaClient.getTransfers(TEST_SEED1, 2, 0, 0, false); assertThat(gtr.getTransfers(), IsNull.notNullValue()); From 220872d5949b512f3b6b5846493388f9119612f8 Mon Sep 17 00:00:00 2001 From: pinpong Date: Wed, 15 Feb 2017 19:23:58 +0100 Subject: [PATCH 33/45] Fixed NullPointer --- src/main/java/jota/utils/IotaAPIUtils.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/jota/utils/IotaAPIUtils.java b/src/main/java/jota/utils/IotaAPIUtils.java index 5b7f2b8..7127dba 100644 --- a/src/main/java/jota/utils/IotaAPIUtils.java +++ b/src/main/java/jota/utils/IotaAPIUtils.java @@ -5,6 +5,7 @@ import jota.model.Bundle; import jota.model.Input; import jota.model.Transaction; import jota.pow.ICurl; +import jota.pow.JCurl; import java.util.ArrayList; import java.util.Arrays; @@ -29,7 +30,10 @@ public class IotaAPIUtils { * @return An String with address. * @throws InvalidAddressException is thrown when the specified address is not an valid address. */ - public static String newAddress(String seed, int security, int index, boolean checksum, ICurl curl) throws InvalidAddressException { + public static String newAddress(String seed, int security, int index, boolean checksum, ICurl customCurl) throws InvalidAddressException { + + ICurl curl = customCurl == null ? new JCurl() : customCurl; + Signing signing = new Signing(curl); final int[] key = signing.key(Converter.trits(seed), index, security); final int[] digests = signing.digests(key); From ec3a1fde0817d9b3efdf40dc308f12e0c608df02 Mon Sep 17 00:00:00 2001 From: pinpong Date: Wed, 15 Feb 2017 20:14:49 +0100 Subject: [PATCH 34/45] Revert "Fixed NullPointer" This reverts commit 220872d5949b512f3b6b5846493388f9119612f8. --- src/main/java/jota/utils/IotaAPIUtils.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/main/java/jota/utils/IotaAPIUtils.java b/src/main/java/jota/utils/IotaAPIUtils.java index 7127dba..5b7f2b8 100644 --- a/src/main/java/jota/utils/IotaAPIUtils.java +++ b/src/main/java/jota/utils/IotaAPIUtils.java @@ -5,7 +5,6 @@ import jota.model.Bundle; import jota.model.Input; import jota.model.Transaction; import jota.pow.ICurl; -import jota.pow.JCurl; import java.util.ArrayList; import java.util.Arrays; @@ -30,10 +29,7 @@ public class IotaAPIUtils { * @return An String with address. * @throws InvalidAddressException is thrown when the specified address is not an valid address. */ - public static String newAddress(String seed, int security, int index, boolean checksum, ICurl customCurl) throws InvalidAddressException { - - ICurl curl = customCurl == null ? new JCurl() : customCurl; - + public static String newAddress(String seed, int security, int index, boolean checksum, ICurl curl) throws InvalidAddressException { Signing signing = new Signing(curl); final int[] key = signing.key(Converter.trits(seed), index, security); final int[] digests = signing.digests(key); From 1c019746df5a4a56e3e4955a86f22a30cfff3619 Mon Sep 17 00:00:00 2001 From: pinpong Date: Wed, 15 Feb 2017 20:16:02 +0100 Subject: [PATCH 35/45] Fixed NullPointer --- src/main/java/jota/IotaAPI.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/jota/IotaAPI.java b/src/main/java/jota/IotaAPI.java index 924e4c3..941da65 100644 --- a/src/main/java/jota/IotaAPI.java +++ b/src/main/java/jota/IotaAPI.java @@ -1100,7 +1100,7 @@ public class IotaAPI extends IotaAPICore { } public static class Builder extends IotaAPICore.Builder { - private ICurl customCurl; + private ICurl customCurl = new JCurl(); public Builder withCustomCurl(ICurl curl) { customCurl = curl; From a9a47e054db13bca332e67c89ab3489145a0fd25 Mon Sep 17 00:00:00 2001 From: pinpong Date: Wed, 15 Feb 2017 20:50:24 +0100 Subject: [PATCH 36/45] tests --- src/test/java/jota/IotaCoreApiTest.java | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/test/java/jota/IotaCoreApiTest.java b/src/test/java/jota/IotaCoreApiTest.java index 36d8f44..da5ba11 100644 --- a/src/test/java/jota/IotaCoreApiTest.java +++ b/src/test/java/jota/IotaCoreApiTest.java @@ -51,13 +51,13 @@ public class IotaCoreApiTest { assertThat(neighbors.getNeighbors(), IsNull.notNullValue()); } - @Test + @Test(expected = IllegalAccessError.class) public void shouldAddNeighbors() { AddNeighborsResponse res = proxy.addNeighbors("udp://8.8.8.8:14265"); assertThat(res, IsNull.notNullValue()); } - @Test + @Test(expected = IllegalAccessError.class) public void shouldRemoveNeighbors() { RemoveNeighborsResponse res = proxy.removeNeighbors("udp://8.8.8.8:14265"); assertThat(res, IsNull.notNullValue()); @@ -100,15 +100,15 @@ public class IotaCoreApiTest { } - @Test - public void shouldGetInclusionStates() { + @Test(expected = IllegalAccessError.class) + public void shouldNotGetInclusionStates() { GetInclusionStateResponse res = proxy.getInclusionStates(new String[]{"DBPECSH9YLSSTQDGERUHJBBJTKVUDBMTJLG9WPHBINGHIFOSJMDJLARTVOXXWEFQJLLBINOHCZGYFSMUEXWPPMTOFW"}, new String[]{"EJDQOQHMLJGBMFWB9WJSPRCYIGNPO9WRHDCEQXIMPVPIJ9JV9RJGVHNX9EPGXFOOKBABCVMMAAX999999"}); assertThat(res.getStates(), IsNull.notNullValue()); } - @Test(expected = IllegalAccessError.class) - public void shouldNotGetInclusionStates() { - GetInclusionStateResponse res = proxy.getInclusionStates(new String[]{TEST_ADDRESS_WITH_CHECKSUM}, new String[]{"DNSBRJWNOVUCQPILOQIFDKBFJMVOTGHLIMLLRXOHFTJZGRHJUEDAOWXQRYGDI9KHYFGYDWQJZKX999999"}); + @Test + public void shouldGetInclusionStates() { + GetInclusionStateResponse res = proxy.getInclusionStates(new String[]{TEST_ADDRESS_WITH_CHECKSUM}, new String[]{proxy.getNodeInfo().getLatestSolidSubtangleMilestone()}); assertThat(res.getStates(), IsNull.notNullValue()); } @@ -133,5 +133,6 @@ public class IotaCoreApiTest { assertThat(res.getBalances(), IsNull.notNullValue()); assertThat(res.getMilestone(), IsNull.notNullValue()); assertThat(res.getMilestoneIndex(), IsNull.notNullValue()); + assertThat(res.getDuration(), IsNull.notNullValue()); } } From 73799607cb4158e52d9ed16f7aa0419356a93261 Mon Sep 17 00:00:00 2001 From: pinpong Date: Wed, 15 Feb 2017 23:52:46 +0100 Subject: [PATCH 37/45] refactored --- src/main/java/jota/IotaAPI.java | 18 ++++----- src/main/java/jota/model/Bundle.java | 8 ++-- src/main/java/jota/model/Transaction.java | 44 +++++++++++----------- src/main/java/jota/utils/Converter.java | 20 ++++++++++ src/main/java/jota/utils/IotaAPIUtils.java | 4 +- src/test/java/jota/IotaCoreApiTest.java | 1 - 6 files changed, 57 insertions(+), 38 deletions(-) diff --git a/src/main/java/jota/IotaAPI.java b/src/main/java/jota/IotaAPI.java index 941da65..6bac087 100644 --- a/src/main/java/jota/IotaAPI.java +++ b/src/main/java/jota/IotaAPI.java @@ -151,7 +151,7 @@ public class IotaAPI extends IotaAPICore { for (Transaction trx : trxs) { // Sort tail and nonTails - if (Long.parseLong(trx.getCurrentIndex()) == 0) { + if (trx.getCurrentIndex() == 0) { tailTransactions.add(trx.getHash()); } else { if (nonTailBundleHashes.indexOf(trx.getBundle()) == -1) { @@ -163,7 +163,7 @@ public class IotaAPI extends IotaAPICore { List bundleObjects = findTransactionObjectsByBundle(nonTailBundleHashes.toArray(new String[nonTailBundleHashes.size()])); for (Transaction trx : bundleObjects) { // Sort tail and nonTails - if (Long.parseLong(trx.getCurrentIndex()) == 0) { + if (trx.getCurrentIndex() == 0) { if (tailTransactions.indexOf(trx.getHash()) == -1) { tailTransactions.add(trx.getHash()); } @@ -628,10 +628,10 @@ public class IotaAPI extends IotaAPICore { for (int i = 0; i < bundle.getTransactions().size(); i++) { Transaction trx = bundle.getTransactions().get(i); - Long bundleValue = Long.parseLong(trx.getValue()); + Long bundleValue = trx.getValue(); totalSum += bundleValue; - if (i != Integer.parseInt(bundle.getTransactions().get(i).getCurrentIndex())) { + if (i != bundle.getTransactions().get(i).getCurrentIndex()) { throw new ArgumentException("Invalid Bundle"); } @@ -651,7 +651,7 @@ public class IotaAPI extends IotaAPICore { Transaction newBundleTx = bundle.getTransactions().get(i + 1); // Check if new tx is part of the signature fragment - if (newBundleTx.getAddress().equals(address) && Long.parseLong(newBundleTx.getValue()) == 0) { + if (newBundleTx.getAddress().equals(address) && newBundleTx.getValue() == 0) { if (sig.getSignatureFragments().indexOf(newBundleTx.getSignatureFragments()) == -1) sig.getSignatureFragments().add(newBundleTx.getSignatureFragments()); } @@ -670,7 +670,7 @@ public class IotaAPI extends IotaAPICore { if (!bundleFromTxString.equals(bundleHash)) throw new InvalidBundleException("Invalid Bundle Hash"); // Last tx in the bundle should have currentIndex === lastIndex bundle.setLength(bundle.getTransactions().size()); - if (!bundle.getTransactions().get(bundle.getLength() - 1).getCurrentIndex().equals(bundle.getTransactions().get(bundle.getLength() - 1).getLastIndex())) + if (!(bundle.getTransactions().get(bundle.getLength() - 1).getCurrentIndex() == (bundle.getTransactions().get(bundle.getLength() - 1).getLastIndex()))) throw new InvalidBundleException("Invalid Bundle"); // Validate the signatures @@ -806,7 +806,7 @@ public class IotaAPI extends IotaAPICore { throw new ArgumentException("Invalid trytes, could not create object"); } // If first transaction to search is not a tail, return error - if (bundleHash == null && Integer.parseInt(trx.getCurrentIndex()) != 0) { + if (bundleHash == null && trx.getCurrentIndex() != 0) { throw new ArgumentException("Invalid tail transaction supplied."); } // If no bundle hash, define it @@ -818,7 +818,7 @@ public class IotaAPI extends IotaAPICore { return bundle; } // If only one bundle element, return - if (Integer.parseInt(trx.getLastIndex()) == 0 && Integer.parseInt(trx.getCurrentIndex()) == 0) { + if (trx.getLastIndex() == 0 && trx.getCurrentIndex() == 0) { return new Bundle(Collections.singletonList(trx), 1); } // Define new trunkTransaction for search @@ -1027,7 +1027,7 @@ public class IotaAPI extends IotaAPICore { if (trx.getBundle() == null) { throw new ArgumentException("Invalid trytes, could not create object"); } - if (Integer.parseInt(trx.getCurrentIndex()) == 0) return trx.getHash(); + if (trx.getCurrentIndex() == 0) return trx.getHash(); else return findTailTransactionHash(trx.getBundle()); } diff --git a/src/main/java/jota/model/Bundle.java b/src/main/java/jota/model/Bundle.java index 0633ad8..b580206 100644 --- a/src/main/java/jota/model/Bundle.java +++ b/src/main/java/jota/model/Bundle.java @@ -78,7 +78,7 @@ public class Bundle implements Comparable { } for (int i = 0; i < signatureMessageLength; i++) { - Transaction trx = new Transaction(address, String.valueOf(i == 0 ? value : 0), tag, String.valueOf(timestamp)); + Transaction trx = new Transaction(address, i == 0 ? value : 0, tag, timestamp); getTransactions().add(trx); } } @@ -99,9 +99,9 @@ public class Bundle implements Comparable { int[] timestampTrits = Converter.trits(this.getTransactions().get(i).getTimestamp(), 27); - int[] currentIndexTrits = Converter.trits(this.getTransactions().get(i).setCurrentIndex("" + i), 27); + int[] currentIndexTrits = Converter.trits(i + (this.getTransactions().get(i).getCurrentIndex()), 27); - int[] lastIndexTrits = Converter.trits(this.getTransactions().get(i).setLastIndex("" + (this.getTransactions().size() - 1)), 27); + int[] lastIndexTrits = Converter.trits(this.getTransactions().get(i).getLastIndex() - 1, 27); int[] t = Converter.trits(this.getTransactions().get(i).getAddress() + Converter.trytes(valueTrits) + this.getTransactions().get(i).getTag() + Converter.trytes(timestampTrits) + Converter.trytes(currentIndexTrits) + Converter.trytes(lastIndexTrits)); @@ -198,6 +198,6 @@ public class Bundle implements Comparable { */ @Override public int compareTo(Bundle o) { - return Long.compare(Long.parseLong(this.getTransactions().get(0).getTimestamp()), Long.parseLong(o.getTransactions().get(0).getTimestamp())); + return Long.compare(this.getTransactions().get(0).getTimestamp(), o.getTransactions().get(0).getTimestamp()); } } \ No newline at end of file diff --git a/src/main/java/jota/model/Transaction.java b/src/main/java/jota/model/Transaction.java index ed7090d..c6c75d9 100644 --- a/src/main/java/jota/model/Transaction.java +++ b/src/main/java/jota/model/Transaction.java @@ -24,11 +24,11 @@ public class Transaction { private String hash; private String signatureFragments; private String address; - private String value; + private long value; private String tag; - private String timestamp; - private String currentIndex; - private String lastIndex; + private long timestamp; + private long currentIndex; + private long lastIndex; private String bundle; private String trunkTransaction; private String branchTransaction; @@ -67,7 +67,7 @@ public class Transaction { /** * Initializes a new instance of the Signature class. */ - public Transaction(String signatureFragments, String currentIndex, String lastIndex, String nonce, String hash, String tag, String timestamp, String trunkTransaction, String branchTransaction, String address, String value, String bundle) { + public Transaction(String signatureFragments, long currentIndex, long lastIndex, String nonce, String hash, String tag, long timestamp, String trunkTransaction, String branchTransaction, String address, long value, String bundle) { this.hash = hash; this.tag = tag; @@ -86,7 +86,7 @@ public class Transaction { /** * Initializes a new instance of the Signature class. */ - public Transaction(String address, String value, String tag, String timestamp) { + public Transaction(String address, long value, String tag, long timestamp) { this.address = address; this.value = value; this.tag = tag; @@ -135,8 +135,8 @@ public class Transaction { * * @param signatureFragments The signature fragments. */ - public String setSignatureFragments(String signatureFragments) { - return this.signatureFragments = signatureFragments; + public void setSignatureFragments(String signatureFragments) { + this.signatureFragments = signatureFragments; } /** @@ -162,7 +162,7 @@ public class Transaction { * * @return The value. */ - public String getValue() { + public long getValue() { return value; } @@ -171,7 +171,7 @@ public class Transaction { * * @param value The value. */ - public void setValue(String value) { + public void setValue(long value) { this.value = value; } @@ -198,7 +198,7 @@ public class Transaction { * * @return The timestamp. */ - public String getTimestamp() { + public long getTimestamp() { return timestamp; } @@ -207,7 +207,7 @@ public class Transaction { * * @param timestamp The timestamp. */ - public void setTimestamp(String timestamp) { + public void setTimestamp(long timestamp) { this.timestamp = timestamp; } @@ -216,7 +216,7 @@ public class Transaction { * * @return The current index. */ - public String getCurrentIndex() { + public long getCurrentIndex() { return currentIndex; } @@ -224,8 +224,8 @@ public class Transaction { * Set the current index. * @param currentIndex The current index. */ - public String setCurrentIndex(String currentIndex) { - return this.currentIndex = currentIndex; + public void setCurrentIndex(long currentIndex) { + this.currentIndex = currentIndex; } /** @@ -233,7 +233,7 @@ public class Transaction { * * @return The last index. */ - public String getLastIndex() { + public long getLastIndex() { return lastIndex; } @@ -242,8 +242,8 @@ public class Transaction { * * @param lastIndex The last index. */ - public String setLastIndex(String lastIndex) { - return this.lastIndex = lastIndex; + public void setLastIndex(long lastIndex) { + this.lastIndex = lastIndex; } /** @@ -400,11 +400,11 @@ public class Transaction { this.setHash(Converter.trytes(hash)); this.setSignatureFragments(trytes.substring(0, 2187)); this.setAddress(trytes.substring(2187, 2268)); - this.setValue("" + Converter.longValue(Arrays.copyOfRange(transactionTrits, 6804, 6837))); + this.setValue(Converter.longValue(Arrays.copyOfRange(transactionTrits, 6804, 6837))); this.setTag(trytes.substring(2295, 2322)); - this.setTimestamp("" + Converter.longValue(Arrays.copyOfRange(transactionTrits, 6966, 6993))); - this.setCurrentIndex("" + Converter.longValue(Arrays.copyOfRange(transactionTrits, 6993, 7020))); - this.setLastIndex("" + Converter.longValue(Arrays.copyOfRange(transactionTrits, 7020, 7047))); + this.setTimestamp(Converter.longValue(Arrays.copyOfRange(transactionTrits, 6966, 6993))); + this.setCurrentIndex(Converter.longValue(Arrays.copyOfRange(transactionTrits, 6993, 7020))); + this.setLastIndex(Converter.longValue(Arrays.copyOfRange(transactionTrits, 7020, 7047))); this.setBundle(trytes.substring(2349, 2430)); this.setTrunkTransaction(trytes.substring(2430, 2511)); this.setBranchTransaction(trytes.substring(2511, 2592)); diff --git a/src/main/java/jota/utils/Converter.java b/src/main/java/jota/utils/Converter.java index 3500154..1f80892 100644 --- a/src/main/java/jota/utils/Converter.java +++ b/src/main/java/jota/utils/Converter.java @@ -120,6 +120,26 @@ public class Converter { return convertToIntArray(tritsList); } + /** + * Converts the specified trinary encoded string into a trits array of the specified length. + * @param trytes The trytes. + * @param length The length. + * @return A trits array. + */ + public static int[] trits(final long trytes, int length) { + int[] trits = trits(String.valueOf(trytes)); + + List tritsList = new LinkedList<>(); + + for (int i : trits) + tritsList.add(i); + + while (tritsList.size() < length) + tritsList.add(0); + + return convertToIntArray(tritsList); + } + /** * Converts the specified trinary encoded trytes string to trits. * diff --git a/src/main/java/jota/utils/IotaAPIUtils.java b/src/main/java/jota/utils/IotaAPIUtils.java index 5b7f2b8..7916acf 100644 --- a/src/main/java/jota/utils/IotaAPIUtils.java +++ b/src/main/java/jota/utils/IotaAPIUtils.java @@ -57,7 +57,7 @@ public class IotaAPIUtils { // Iterate over all bundle transactions, find the inputs // Get the corresponding private key and calculate the signatureFragment for (int i = 0; i < bundle.getTransactions().size(); i++) { - if (Long.parseLong(bundle.getTransactions().get(i).getValue()) < 0) { + if (bundle.getTransactions().get(i).getValue() < 0) { String thisAddress = bundle.getTransactions().get(i).getAddress(); // Get the corresponding keyIndex of the address @@ -98,7 +98,7 @@ public class IotaAPIUtils { // find the second transaction to add the remainder of the signature for (int k = 0; k < bundle.getTransactions().size(); k++) { // Same address as well as value = 0 (as we already spent the input) - if (bundle.getTransactions().get(k).getAddress().equals(thisAddress) && Long.parseLong(bundle.getTransactions().get(k).getValue()) == 0) { + if (bundle.getTransactions().get(k).getAddress().equals(thisAddress) && bundle.getTransactions().get(k).getValue() == 0) { // Use the second 6562 trits int[] secondFragment = Arrays.copyOfRange(key, 6561, 6561 * 2); diff --git a/src/test/java/jota/IotaCoreApiTest.java b/src/test/java/jota/IotaCoreApiTest.java index da5ba11..7e3ed96 100644 --- a/src/test/java/jota/IotaCoreApiTest.java +++ b/src/test/java/jota/IotaCoreApiTest.java @@ -129,7 +129,6 @@ public class IotaCoreApiTest { @Test public void shouldGetBalances() { GetBalancesResponse res = proxy.getBalances(100, new String[]{TEST_ADDRESS_WITH_CHECKSUM}); - System.err.println(res); assertThat(res.getBalances(), IsNull.notNullValue()); assertThat(res.getMilestone(), IsNull.notNullValue()); assertThat(res.getMilestoneIndex(), IsNull.notNullValue()); From 5e956137a48d8721095e8044cd57998de689e21f Mon Sep 17 00:00:00 2001 From: pinpong Date: Thu, 16 Feb 2017 19:28:28 +0100 Subject: [PATCH 38/45] fixed last commit --- src/main/java/jota/model/Bundle.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/java/jota/model/Bundle.java b/src/main/java/jota/model/Bundle.java index b580206..9f270c1 100644 --- a/src/main/java/jota/model/Bundle.java +++ b/src/main/java/jota/model/Bundle.java @@ -99,10 +99,13 @@ public class Bundle implements Comparable { int[] timestampTrits = Converter.trits(this.getTransactions().get(i).getTimestamp(), 27); - int[] currentIndexTrits = Converter.trits(i + (this.getTransactions().get(i).getCurrentIndex()), 27); + this.getTransactions().get(i).setCurrentIndex(i); - int[] lastIndexTrits = Converter.trits(this.getTransactions().get(i).getLastIndex() - 1, 27); + int[] currentIndexTrits = Converter.trits(this.getTransactions().get(i).getCurrentIndex(), 27); + this.getTransactions().get(i).setLastIndex(this.getTransactions().size() - 1); + + int[] lastIndexTrits = Converter.trits(this.getTransactions().get(i).getLastIndex(), 27); int[] t = Converter.trits(this.getTransactions().get(i).getAddress() + Converter.trytes(valueTrits) + this.getTransactions().get(i).getTag() + Converter.trytes(timestampTrits) + Converter.trytes(currentIndexTrits) + Converter.trytes(lastIndexTrits)); curl.absorb(t, 0, t.length); From bbaa4d8b2f88fddaf0411a774d3914975cb147f2 Mon Sep 17 00:00:00 2001 From: adrianziser Date: Sat, 18 Feb 2017 20:37:26 +0100 Subject: [PATCH 39/45] Multisig implementation finished --- README.md | 6 +- pom.xml | 2 +- src/main/java/jota/IotaAPI.java | 183 ++++++++---------- src/main/java/jota/IotaAPICommands.java | 3 +- src/main/java/jota/IotaAPICore.java | 7 +- src/main/java/jota/IotaAPIService.java | 28 +-- .../dto/response/GetBalancesResponse.java | 1 + .../jota/error/InvalidTrytesException.java | 1 + .../java/jota/error/NoNodeInfoException.java | 1 + src/main/java/jota/model/Bundle.java | 11 +- src/main/java/jota/model/Inputs.java | 2 +- src/main/java/jota/model/Signature.java | 2 +- src/main/java/jota/model/Transaction.java | 1 + src/main/java/jota/pow/ICurl.java | 2 +- src/main/java/jota/pow/JCurl.java | 2 +- src/main/java/jota/utils/Checksum.java | 2 + src/main/java/jota/utils/Converter.java | 15 +- src/main/java/jota/utils/InputValidator.java | 4 +- src/main/java/jota/utils/IotaAPIUtils.java | 6 +- .../java/jota/utils/IotaUnitConverter.java | 14 +- src/main/java/jota/utils/Multisig.java | 125 ++++++------ src/main/java/jota/utils/Parallel.java | 1 - src/main/java/jota/utils/Signing.java | 46 ++++- src/main/java/jota/utils/TrytesConverter.java | 11 +- 24 files changed, 248 insertions(+), 228 deletions(-) diff --git a/README.md b/README.md index aab45c5..f198ec6 100644 --- a/README.md +++ b/README.md @@ -7,8 +7,8 @@ The JOTA library is a simple Java wrapper around [[IOTA]](http://www.iotatoken.c It allows to connect easily using java directly to a local or a remote [[IOTA node]](https://iota.readme.io/docs/syncing-to-the-network). -* **Latest release:** 0.9.0 RC1 -* **Compatibility:** fully compatible with IOTA IRI v1.2.4 +* **Latest release:** 0.9.1 +* **Compatibility:** fully compatible with IOTA IRI v1.2.6 * **API coverage:** 14 of 14 commands fully implemented * **License:** Apache License 2.0 * **Readme updated:** 2016-01-19 21:05:02 (UTC) @@ -54,7 +54,7 @@ In order to communicate with *IOTA node*, JOTA needs to be aware of your node's iota.node.host=127.0.0.1 iota.node.port=14265 -Jota is still *not* in the central maven repository. It will be available when it will cover 100% iota's rest interface. +Jota is still *not* in the central maven repository. ##Warning - This is pre-release software! diff --git a/pom.xml b/pom.xml index becaf24..1a59524 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ 4.0.0 org.iota jota - 0.9.0-RC1 + 0.9.1 JOTA JOTA library is a simple Java wrapper around IOTA Node's JSON-REST HTTP interface. diff --git a/src/main/java/jota/IotaAPI.java b/src/main/java/jota/IotaAPI.java index 6bac087..c6504bc 100644 --- a/src/main/java/jota/IotaAPI.java +++ b/src/main/java/jota/IotaAPI.java @@ -14,13 +14,13 @@ import java.util.*; /** * IotaAPI Builder. Usage: - * + *

* IotaApiProxy api = IotaApiProxy.Builder * .protocol("http") * .nodeAddress("localhost") * .port(12345) * .build(); - * + *

* GetNodeInfoResponse response = api.getNodeInfo(); * * @author davassi @@ -39,14 +39,14 @@ public class IotaAPI extends IotaAPICore { * Generates a new address from a seed and returns the remainderAddress. * This is either done deterministically, or by providing the index of the new remainderAddress. * - * @param seed Tryte-encoded seed. It should be noted that this seed is not transferred. - * @param security Security level to be used for the private key / address. Can be 1, 2 or 3. - * @param index Key index to start search from. If the index is provided, the generation of the address is not deterministic. - * @param checksum Adds 9-tryte address checksum. - * @param total Total number of addresses to generate. + * @param seed Tryte-encoded seed. It should be noted that this seed is not transferred. + * @param security Security level to be used for the private key / address. Can be 1, 2 or 3. + * @param index Key index to start search from. If the index is provided, the generation of the address is not deterministic. + * @param checksum Adds 9-tryte address checksum. + * @param total Total number of addresses to generate. * @param returnAll If true, it returns all addresses which were deterministically generated (until findTransactions returns null). * @return An array of strings with the specifed number of addresses. - * @throws InvalidAddressException is thrown when the specified address is not an valid address. + * @throws InvalidAddressException is thrown when the specified address is not an valid address. * @throws InvalidSecurityLevelException is thrown when the specified security level is not valid. */ public GetNewAddressResponse getNewAddress(final String seed, int security, final int index, final boolean checksum, final int total, final boolean returnAll) throws InvalidSecurityLevelException, InvalidAddressException { @@ -90,18 +90,18 @@ public class IotaAPI extends IotaAPICore { } /** - * @param seed Tryte-encoded seed. It should be noted that this seed is not transferred. - * @param security The security level of private key / seed. - * @param start Starting key index. - * @param end Ending key index. + * @param seed Tryte-encoded seed. It should be noted that this seed is not transferred. + * @param security The security level of private key / seed. + * @param start Starting key index. + * @param end Ending key index. * @param inclusionStates If true, it gets the inclusion states of the transfers. * @return Bundle of transfers. - * @throws InvalidAddressException is thrown when the specified address is not an valid address. - * @throws ArgumentException is thrown when an invalid argument is provided. - * @throws InvalidBundleException is thrown if an invalid bundle was found or provided. - * @throws InvalidSignatureException is thrown when an invalid signature is encountered. - * @throws NoNodeInfoException is thrown when its not possible to get node info. - * @throws NoInclusionStatesException when it not possible to get a inclusion state. + * @throws InvalidAddressException is thrown when the specified address is not an valid address. + * @throws ArgumentException is thrown when an invalid argument is provided. + * @throws InvalidBundleException is thrown if an invalid bundle was found or provided. + * @throws InvalidSignatureException is thrown when an invalid signature is encountered. + * @throws NoNodeInfoException is thrown when its not possible to get node info. + * @throws NoInclusionStatesException when it not possible to get a inclusion state. * @throws InvalidSecurityLevelException is thrown when the specified security level is not valid. */ public GetTransferResponse getTransfers(String seed, int security, Integer start, Integer end, Boolean inclusionStates) throws ArgumentException, InvalidBundleException, InvalidSignatureException, NoNodeInfoException, NoInclusionStatesException, InvalidSecurityLevelException, InvalidAddressException { @@ -131,15 +131,15 @@ public class IotaAPI extends IotaAPICore { } /** - * * Internal function to get the formatted bundles of a list of addresses. - * @param addresses List of addresses. + * + * @param addresses List of addresses. * @param inclusionStates If true, it gets the inclusion states of the transfers. * @return A Transaction objects. - * @throws ArgumentException is thrown when an invalid argument is provided. - * @throws InvalidBundleException is thrown if an invalid bundle was found or provided. - * @throws InvalidSignatureException is thrown when an invalid signature is encountered. - * @throws NoNodeInfoException is thrown when its not possible to get node info. + * @throws ArgumentException is thrown when an invalid argument is provided. + * @throws InvalidBundleException is thrown if an invalid bundle was found or provided. + * @throws InvalidSignatureException is thrown when an invalid signature is encountered. + * @throws NoNodeInfoException is thrown when its not possible to get node info. * @throws NoInclusionStatesException when it not possible to get a inclusion state. */ public Bundle[] bundlesFromAddresses(String[] addresses, final Boolean inclusionStates) throws ArgumentException, InvalidBundleException, InvalidSignatureException, NoNodeInfoException, NoInclusionStatesException { @@ -242,8 +242,8 @@ public class IotaAPI extends IotaAPICore { /** * Facade method: Gets transactions to approve, attaches to Tangle, broadcasts and stores. * - * @param trytes The trytes. - * @param depth The depth. + * @param trytes The trytes. + * @param depth The depth. * @param minWeightMagnitude The minimum weight magnitude. * @return Transactions objects. * @throws InvalidTrytesException is thrown when invalid trytes is provided. @@ -326,16 +326,16 @@ public class IotaAPI extends IotaAPICore { /** * Prepares transfer by generating bundle, finding and signing inputs. * - * @param seed 81-tryte encoded address of recipient. - * @param security The security level of private key / seed. + * @param seed 81-tryte encoded address of recipient. + * @param security The security level of private key / seed. * @param transfers Array of transfer objects. * @param remainder If defined, this address will be used for sending the remainder value (of the inputs) to. - * @param inputs The inputs. + * @param inputs The inputs. * @return Returns bundle trytes. - * @throws InvalidAddressException is thrown when the specified address is not an valid address. - * @throws NotEnoughBalanceException is thrown when a transfer fails because their is not enough balance to perform the transfer. + * @throws InvalidAddressException is thrown when the specified address is not an valid address. + * @throws NotEnoughBalanceException is thrown when a transfer fails because their is not enough balance to perform the transfer. * @throws InvalidSecurityLevelException is thrown when the specified security level is not valid. - * @throws InvalidTransferException is thrown when an invalid transfer is provided. + * @throws InvalidTransferException is thrown when an invalid transfer is provided. */ public List prepareTransfers(String seed, int security, final List transfers, String remainder, List inputs) throws NotEnoughBalanceException, InvalidSecurityLevelException, InvalidAddressException, InvalidTransferException { @@ -489,14 +489,13 @@ public class IotaAPI extends IotaAPICore { /** * Gets the inputs of a seed * - * @param seed Tryte-encoded seed. It should be noted that this seed is not transferred. - * @param security The Security level of private key / seed. - * @param start Starting key index. - * @param end Ending key index. + * @param seed Tryte-encoded seed. It should be noted that this seed is not transferred. + * @param security The Security level of private key / seed. + * @param start Starting key index. + * @param end Ending key index. * @param threshold Min balance required. - * @throws InvalidAddressException is thrown when the specified address is not an valid address. + * @throws InvalidAddressException is thrown when the specified address is not an valid address. * @throws InvalidSecurityLevelException is thrown when the specified security level is not valid. - **/ public GetBalancesAndFormatResponse getInputs(String seed, int security, int start, int end, long threshold) throws InvalidSecurityLevelException, InvalidAddressException { StopWatch stopWatch = new StopWatch(); @@ -552,10 +551,10 @@ public class IotaAPI extends IotaAPICore { * * @param addresses The addresses. * @param threshold Min balance required. - * @param start Starting key index. - * @param end Ending key index. + * @param start Starting key index. + * @param end Ending key index. * @param stopWatch the stopwatch. - * @param security The security level of private key / seed. + * @param security The security level of private key / seed. * @return Inputs object. * @throws InvalidSecurityLevelException is thrown when the specified security level is not valid. **/ @@ -606,8 +605,8 @@ public class IotaAPI extends IotaAPICore { * * @param transaction The transaction encoded in trytes. * @return an array of bundle, if there are multiple arrays it means that there are conflicting bundles. - * @throws ArgumentException is thrown when an invalid argument is provided. - * @throws InvalidBundleException is thrown if an invalid bundle was found or provided. + * @throws ArgumentException is thrown when an invalid argument is provided. + * @throws InvalidBundleException is thrown if an invalid bundle was found or provided. * @throws InvalidSignatureException is thrown when an invalid signature is encountered. */ public GetBundleResponse getBundle(String transaction) throws ArgumentException, InvalidBundleException, InvalidSignatureException { @@ -677,7 +676,7 @@ public class IotaAPI extends IotaAPICore { for (Signature aSignaturesToValidate : signaturesToValidate) { String[] signatureFragments = aSignaturesToValidate.getSignatureFragments().toArray(new String[aSignaturesToValidate.getSignatureFragments().size()]); String address = aSignaturesToValidate.getAddress(); - boolean isValidSignature = new Signing().validateSignatures(address, signatureFragments, bundleHash); + boolean isValidSignature = new Signing(customCurl.clone()).validateSignatures(address, signatureFragments, bundleHash); if (!isValidSignature) throw new InvalidSignatureException(); } @@ -688,14 +687,14 @@ public class IotaAPI extends IotaAPICore { /** * Replays a transfer by doing Proof of Work again. * - * @param transaction The transaction. - * @param depth The depth. + * @param transaction The transaction. + * @param depth The depth. * @param minWeightMagnitude The minimum weight magnitude. * @return Analyzed Transaction objects. - * @throws InvalidBundleException is thrown if an invalid bundle was found or provided. - * @throws ArgumentException is thrown when an invalid argument is provided. + * @throws InvalidBundleException is thrown if an invalid bundle was found or provided. + * @throws ArgumentException is thrown when an invalid argument is provided. * @throws InvalidSignatureException is thrown when an invalid signature is encountered. - * @throws InvalidTransferException is thrown when an invalid transfer is provided. + * @throws InvalidTransferException is thrown when an invalid transfer is provided. */ public ReplayBundleResponse replayBundle(String transaction, int depth, int minWeightMagnitude) throws InvalidBundleException, ArgumentException, InvalidSignatureException, InvalidTrytesException { StopWatch stopWatch = new StopWatch(); @@ -743,20 +742,20 @@ public class IotaAPI extends IotaAPICore { /** * Wrapper function that basically does prepareTransfers, as well as attachToTangle and finally, it broadcasts and stores the transactions locally. * - * @param seed Tryte-encoded seed - * @param security The security level of private key / seed. - * @param depth The depth. + * @param seed Tryte-encoded seed + * @param security The security level of private key / seed. + * @param depth The depth. * @param minWeightMagnitude The minimum weight magnitude. - * @param transfers Array of transfer objects. - * @param inputs List of inputs used for funding the transfer. - * @param address If defined, this address will be used for sending the remainder value (of the inputs) to. + * @param transfers Array of transfer objects. + * @param inputs List of inputs used for funding the transfer. + * @param address If defined, this address will be used for sending the remainder value (of the inputs) to. * @return Array of Transaction objects. - * @throws InvalidAddressException is thrown when the specified address is not an valid address. - * @throws NotEnoughBalanceException is thrown when a transfer fails because their is not enough balance to perform the transfer. + * @throws InvalidAddressException is thrown when the specified address is not an valid address. + * @throws NotEnoughBalanceException is thrown when a transfer fails because their is not enough balance to perform the transfer. * @throws InvalidSecurityLevelException is thrown when the specified security level is not valid. - * @throws InvalidTrytesException is thrown when invalid trytes is provided. - * @throws InvalidAddressException is thrown when the specified address is not an valid address. - * @throws InvalidTransferException is thrown when an invalid transfer is provided. + * @throws InvalidTrytesException is thrown when invalid trytes is provided. + * @throws InvalidAddressException is thrown when the specified address is not an valid address. + * @throws InvalidTransferException is thrown when an invalid transfer is provided. */ public SendTransferResponse sendTransfer(String seed, int security, int depth, int minWeightMagnitude, final List transfers, Input[] inputs, String address) throws NotEnoughBalanceException, InvalidSecurityLevelException, InvalidTrytesException, InvalidAddressException, InvalidTransferException { @@ -786,9 +785,9 @@ public class IotaAPI extends IotaAPICore { * the bundle hash of the transaction is no longer the same. In case the input * transaction hash is not a tail, we return an error. * - * @param trunkTx Hash of a trunk or a tail transaction of a bundle. + * @param trunkTx Hash of a trunk or a tail transaction of a bundle. * @param bundleHash The bundle hashes. - * @param bundle List of bundles to be populated. + * @param bundle List of bundles to be populated. * @return Transaction objects. * @throws ArgumentException is thrown when an invalid argument is provided. */ @@ -838,14 +837,15 @@ public class IotaAPI extends IotaAPICore { * Prepares transfer by generating the bundle with the corresponding cosigner transactions. * Does not contain signatures. * - * @param securitySum The sum of security levels used by all co-signers. - * @param inputAddress Array of input addresses as well as the securitySum. + * @param securitySum The sum of security levels used by all co-signers. + * @param inputAddress Array of input addresses as well as the securitySum. * @param remainderAddress Has to be generated by the cosigners before initiating the transfer, can be null if fully spent. * @return Bundle of transaction objects. - * @throws InvalidBundleException is thrown if an invalid bundle was found or provided. + * @throws InvalidBundleException is thrown if an invalid bundle was found or provided. * @throws InvalidAddressException is thrown when the specified address is not an valid address. */ - private GetTransferResponse initiateTransfer(int securitySum, final List inputAddress, String remainderAddress, final List transfers) throws InvalidAddressException, InvalidBundleException, InvalidTransferException { + public List initiateTransfer(int securitySum, final String inputAddress, String remainderAddress, + final List transfers, boolean testMode) throws InvalidAddressException, InvalidBundleException, InvalidTransferException { StopWatch sw = new StopWatch(); @@ -869,10 +869,8 @@ public class IotaAPI extends IotaAPICore { // validate input address - for (String address : inputAddress) { - if (!InputValidator.isAddress(address)) - throw new InvalidBundleException(); - } + if (!InputValidator.isAddress(inputAddress)) + throw new InvalidAddressException(); // validate remainder address if (remainderAddress != null && !InputValidator.isAddress(remainderAddress)) { @@ -944,7 +942,7 @@ public class IotaAPI extends IotaAPICore { // Get inputs if we are sending tokens if (totalValue != 0) { - GetBalancesResponse balancesResponse = getBalances(100, inputAddress); + GetBalancesResponse balancesResponse = getBalances(100, new String[]{inputAddress}); String[] balances = balancesResponse.getBalances(); long totalBalance = 0; @@ -958,16 +956,18 @@ public class IotaAPI extends IotaAPICore { // get current timestamp in seconds long timestamp = (long) Math.floor(Calendar.getInstance().getTimeInMillis() / 1000); + // bypass the balance checks during unit testing + if (testMode) + totalBalance += 1000; + if (totalBalance > 0) { long toSubtract = 0 - totalBalance; // Add input as bundle entry // Only a single entry, signatures will be added later - // TODO: unfinished stuff - bundle.addEntry(securitySum, "", toSubtract, tag, timestamp); + bundle.addEntry(securitySum, inputAddress, toSubtract, tag, timestamp); } - // Return not enough balance error if (totalValue > totalBalance) { throw new IllegalStateException("Not enough balance"); @@ -986,24 +986,12 @@ public class IotaAPI extends IotaAPICore { bundle.addEntry(1, remainderAddress, remainder, tag, timestamp); } - // TODO: unfinished stuff - /* + bundle.finalize(customCurl.clone()); bundle.addTrytes(signatureFragments); - List trxb = bundle.getTransactions(); - List bundleTrytes = new ArrayList<>(); - - for (Transaction trx : trxb) { - bundleTrytes.add(trx.toTrytes()); - } - - return GetTransferResponse.create(bundle.getTransactions(), sw.getElapsedTimeMili()); - */ - return null; - + return bundle.getTransactions(); } else { - throw new RuntimeException("Invalid value transfer: the transfer does not require a signature."); } @@ -1032,18 +1020,17 @@ public class IotaAPI extends IotaAPICore { } /** - * @param seed Tryte-encoded seed. - * @param security The security level of private key / seed. - * @param inputs List of inputs used for funding the transfer. - * @param bundle To be populated. - * @param tag The tag. - * @param totalValue The total value. - * @param remainderAddress If defined, this address will be used for sending the remainder value (of the inputs) to. + * @param seed Tryte-encoded seed. + * @param security The security level of private key / seed. + * @param inputs List of inputs used for funding the transfer. + * @param bundle To be populated. + * @param tag The tag. + * @param totalValue The total value. + * @param remainderAddress If defined, this address will be used for sending the remainder value (of the inputs) to. * @param signatureFragments The signature fragments. - * - * @throws NotEnoughBalanceException is thrown when a transfer fails because their is not enough balance to perform the transfer. + * @throws NotEnoughBalanceException is thrown when a transfer fails because their is not enough balance to perform the transfer. * @throws InvalidSecurityLevelException is thrown when the specified security level is not valid. - * @throws InvalidAddressException is thrown when the specified address is not an valid address. + * @throws InvalidAddressException is thrown when the specified address is not an valid address. */ public List addRemainder(final String seed, final int security, diff --git a/src/main/java/jota/IotaAPICommands.java b/src/main/java/jota/IotaAPICommands.java index 3995251..fe66f1b 100644 --- a/src/main/java/jota/IotaAPICommands.java +++ b/src/main/java/jota/IotaAPICommands.java @@ -2,7 +2,7 @@ package jota; /** * IOTA's node command list - * + *

* 'params' is not currently used. */ public enum IotaAPICommands { @@ -42,7 +42,6 @@ public enum IotaAPICommands { } /** - * * @return */ public int params() { diff --git a/src/main/java/jota/IotaAPICore.java b/src/main/java/jota/IotaAPICore.java index 9a54fc9..9eba60c 100644 --- a/src/main/java/jota/IotaAPICore.java +++ b/src/main/java/jota/IotaAPICore.java @@ -21,6 +21,7 @@ import java.util.concurrent.TimeUnit; /** * This class provides access to the Iota core API + * * @author Adrian */ public class IotaAPICore { @@ -65,7 +66,6 @@ public class IotaAPICore { } /** - * * @param env * @param def * @return @@ -188,7 +188,7 @@ public class IotaAPICore { } public GetAttachToTangleResponse attachToTangle(String trunkTransaction, String branchTransaction, Integer minWeightMagnitude, String... trytes) throws InvalidTrytesException { - if(!InputValidator.isArrayOfTrytes(trytes)){ + if (!InputValidator.isArrayOfTrytes(trytes)) { throw new InvalidTrytesException(); } @@ -268,7 +268,6 @@ public class IotaAPICore { } /** - * * @param host * @return */ @@ -278,7 +277,6 @@ public class IotaAPICore { } /** - * * @param port * @return */ @@ -288,7 +286,6 @@ public class IotaAPICore { } /** - * * @param protocol * @return */ diff --git a/src/main/java/jota/IotaAPIService.java b/src/main/java/jota/IotaAPIService.java index a626209..2946307 100644 --- a/src/main/java/jota/IotaAPIService.java +++ b/src/main/java/jota/IotaAPIService.java @@ -19,7 +19,7 @@ public interface IotaAPIService { /** * Returns information about your node. - * + *

* curl http://localhost:14265 -X POST -H 'Content-Type: application/json' * -d '{"command": "getNodeInfo"}' * @@ -31,7 +31,7 @@ public interface IotaAPIService { /** * Get the list of latest tips (unconfirmed transactions). - * + *

* curl http://localhost:14265 -X POST -H 'Content-Type: application/json' * -d '{"command": "getNeighbors"}' */ @@ -41,7 +41,7 @@ public interface IotaAPIService { /** * Add a list of neighbors to your node. - * + *

* curl http://localhost:14265 -X POST -H 'Content-Type: application/json' * -d '{"command": "addNeighbors", "uris": ["udp://8.8.8.8:14265", "udp://8.8.8.5:14265"]}' */ @@ -51,7 +51,7 @@ public interface IotaAPIService { /** * Removes a list of neighbors to your node. - * + *

* curl http://localhost:14265 -X POST -H 'Content-Type: application/json' * -d '{"command": "removeNeighbors", "uris": ["udp://8.8.8.8:14265", "udp://8.8.8.5:14265"]}' */ @@ -61,7 +61,7 @@ public interface IotaAPIService { /** * Get the list of latest tips (unconfirmed transactions). - * + *

* curl http://localhost:14265 -X POST -H 'Content-Type: application/json' * -d '{"command": "getTips"}' */ @@ -71,7 +71,7 @@ public interface IotaAPIService { /** * Find the transactions which match the specified input and return - * + *

* curl http://localhost:14265 \ -X POST \ -H 'Content-Type: application/json' \ * -d '{"command": "findTransactions", "addresses": ["RVORZ9SIIP9RCYMREUIXXVPQIPHVCNPQ9HZWYKFWYWZRE9JQKG9REPKIASHUUECPSQO9JT9XNMVKWYGVAZETAIRPTM"]}' */ @@ -82,7 +82,7 @@ public interface IotaAPIService { /** * Get the inclusion states of a set of transactions. This is for determining if a transaction was accepted and confirmed by the network or not. You can search for multiple tips (and thus, milestones) to get past inclusion states of transactions. - * + *

* curl http://localhost:14265 -X POST -H 'Content-Type: application/json' * -d '{"command": "getInclusionStates", "transactions"Q9HZWYKFWYWZRE9JQKG9REPKIASHUUECPSQO9JT9XNMVKWYGVAZETAIRPTM"], "tips" : []}' */ @@ -92,7 +92,7 @@ public interface IotaAPIService { /** * Returns the raw trytes data of a transaction. - * + *

* curl http://localhost:14265 -X POST -H 'Content-Type: application/json' * -d '{"command": "getTrytes", "hashes": ["OAATQS9VQLSXCLDJVJJVYUGONXAXOFMJOZNSYWRZSWECMXAQQURHQBJNLD9IOFEPGZEPEMPXCIVRX9999"]}' */ @@ -102,7 +102,7 @@ public interface IotaAPIService { /** * Tip selection which returns trunkTransaction and branchTransaction. The input value is the latest coordinator milestone, as provided through the getNodeInfo API call. - * + *

* curl http://localhost:14265 -X POST -H 'Content-Type: application/json' * -d '{"command": "getTransactionsToApprove", "depth": 27}' */ @@ -112,7 +112,7 @@ public interface IotaAPIService { /** * It returns the confirmed balance which a list of addresses have at the latest confirmed milestone. - * + *

* curl http://localhost:14265 -X POST -H 'Content-Type: application/json' * -d '{"command": "getBalances", "addresses": ["HBBYKAKTILIPVUKFOTSLHGENPTXYBNKXZFQFR9VQFWNBMTQNRVOUKPVPRNBSZVVILMAFBKOTBLGLWLOHQ"], "threshold": 100}' */ @@ -122,7 +122,7 @@ public interface IotaAPIService { /** * Attaches the specified transactions (trytes) to the Tangle by doing Proof of Work. - * + *

* curl http://localhost:14265 -X POST -H 'Content-Type: application/json' * -d '{"command": "attachToTangle", "trunkTransaction": "JVMTDGDPDFYHMZPMWEKKANBQSLSDTIIHAYQUMZOKHXXXGJHJDQPOMDOMNRDKYCZRUFZROZDADTHZC9999", "branchTransaction": "P9KFSJVGSPLXAEBJSHWFZLGP9GGJTIO9YITDEHATDTGAFLPLBZ9FOFWWTKMAZXZHFGQHUOXLXUALY9999", "minWeightMagnitude": 18, "trytes": ["TRYTVALUEHERE"]}' */ @@ -132,7 +132,7 @@ public interface IotaAPIService { /** * Interrupts and completely aborts the attachToTangle process. - * + *

* curl http://localhost:14265 -X POST -H 'Content-Type: application/json' * -d '{"command": "interruptAttachingToTangle" } */ @@ -142,7 +142,7 @@ public interface IotaAPIService { /** * Broadcast a list of transactions to all neighbors. The input trytes for this call are provided by attachToTangle. - * + *

* curl http://localhost:14265 -X POST -H 'Content-Type: application/json' * -d '{"command": "broadcastTransactions", "trytes": ["BYSWEAUTWXHXZ9YBZISEK9LUHWGMHXCGEVNZHRLUWQFCUSDXZHOFHWHL9MQPVJXXZLIXPXPXF9KYEREFSKCPKYIIKPZVLHUTDFQKKVVBBN9ATTLPCNPJDWDEVIYYLGPZGCWXOBDXMLJC9VO9QXTTBLAXTTBFUAROYEGQIVB9MJWJKXJMCUPTWAUGFZBTZCSJVRBGMYXTVBDDS9MYUJCPZ9YDWWQNIPUAIJXXSNLKUBSCOIJPCLEFPOXFJREXQCUVUMKSDOVQGGHRNILCO9GNCLWFM9APMNMWYASHXQAYBEXF9QRIHIBHYEJOYHRQJAOKAQ9AJJFQ9WEIWIJOTZATIBOXQLBMIJU9PCGBLVDDVFP9CFFSXTDUXMEGOOFXWRTLFGV9XXMYWEMGQEEEDBTIJ9OJOXFAPFQXCDAXOUDMLVYRMRLUDBETOLRJQAEDDLNVIRQJUBZBO9CCFDHIX9MSQCWYAXJVWHCUPTRSXJDESISQPRKZAFKFRULCGVRSBLVFOPEYLEE99JD9SEBALQINPDAZHFAB9RNBH9AZWIJOTLBZVIEJIAYGMC9AZGNFWGRSWAXTYSXVROVNKCOQQIWGPNQZKHUNODGYADPYLZZZUQRTJRTODOUKAOITNOMWNGHJBBA99QUMBHRENGBHTH9KHUAOXBVIVDVYYZMSEYSJWIOGGXZVRGN999EEGQMCOYVJQRIRROMPCQBLDYIGQO9AMORPYFSSUGACOJXGAQSPDY9YWRRPESNXXBDQ9OZOXVIOMLGTSWAMKMTDRSPGJKGBXQIVNRJRFRYEZ9VJDLHIKPSKMYC9YEG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BWBTJHOGQ9WOMQFHWJVEG9NYX9KWBTCAIXNXHEBDIOFO9ALYMFGRICLCKKLG9FOBOX9PDWNQRGHBKHGKKRLWTBEQMCWQRLHAVYYZDIIPKVQTHYTWQMTOACXZOQCDTJTBAAUWXSGJF9PNQIJ9AJRUMUVCPWYVYVARKR9RKGOUHHNKNVGGPDDLGKPQNOYHNKAVVKCXWXOQPZNSLATUJT9AUWRMPPSWHSTTYDFAQDXOCYTZHOYYGAIM9CELMZ9AZPWB9MJXGHOKDNNSZVUDAGXTJJSSZCPZVPZBYNNTUQABSXQWZCHDQSLGK9UOHCFKBIBNETK999999999999999999999999999999999999999999999999999999999999999999999999999999999NOXDXXKUDWLOFJLIPQIBRBMGDYCPGDNLQOLQS99EQYKBIU9VHCJVIPFUYCQDNY9APGEVYLCENJIOBLWNB999999999XKBRHUD99C99999999NKZKEKWLDKMJCI9N9XQOLWEPAYWSH9999999999999999999999999KDDTGZLIPBNZKMLTOLOXQVNGLASESDQVPTXALEKRMIOHQLUHD9ELQDBQETS9QFGTYOYWLNTSKKMVJAUXSIROUICDOXKSYZTDPEDKOQENTJOWJONDEWROCEJIEWFWLUAACVSJFTMCHHXJBJRKAAPUDXXVXFWP9X9999IROUICDOXKSYZTDPEDKOQENTJOWJONDEWROCEJIEWFWLUAACVSJFTMCHHXJBJRKAAPUDXXVXFWP9X9999"]} */ @@ -152,7 +152,7 @@ public interface IotaAPIService { /** * Store transactions into the local storage. The trytes to be used for this call are returned by attachToTangle. - * + *

* curl http://localhost:14265 -X POST -H 'Content-Type: application/json' * -d '{"command": "storeTransactions", "trytes": ["BYSWEAUTWXHXZ9YBZISEK9LUHWGMHXCGEVNZHRLUWQFCUSDXZHOFHWHL9MQPVJXXZLIXPXPXF9KYEREFSKCPKYIIKPZVLHUTDFQKKVVBBN9ATTLPCNPJDWDEVIYYLGPZGCWXOBDXMLJC9VO9QXTTBLAXTTBFUAROYEGQIVB9MJWJKXJMCUPTWAUGFZBTZCSJVRBGMYXTV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999999XKBRHUD99C99999999NKZKEKWLDKMJCI9N9XQOLWEPAYWSH9999999999999999999999999KDDTGZLIPBNZKMLTOLOXQVNGLASESDQVPTXALEKRMIOHQLUHD9ELQDBQETS9QFGTYOYWLNTSKKMVJAUXSIROUICDOXKSYZTDPEDKOQENTJOWJONDEWROCEJIEWFWLUAACVSJFTMCHHXJBJRKAAPUDXXVXFWP9X9999IROUICDOXKSYZTDPEDKOQENTJOWJONDEWROCEJIEWFWLUAACVSJFTMCHHXJBJRKAAPUDXXVXFWP9X9999"]}' */ diff --git a/src/main/java/jota/dto/response/GetBalancesResponse.java b/src/main/java/jota/dto/response/GetBalancesResponse.java index c06bf50..b295bde 100644 --- a/src/main/java/jota/dto/response/GetBalancesResponse.java +++ b/src/main/java/jota/dto/response/GetBalancesResponse.java @@ -29,6 +29,7 @@ public class GetBalancesResponse extends AbstractResponse { /** * Gets the balances. + * * @return The balances. */ public String[] getBalances() { diff --git a/src/main/java/jota/error/InvalidTrytesException.java b/src/main/java/jota/error/InvalidTrytesException.java index 7b56b12..de97ff0 100644 --- a/src/main/java/jota/error/InvalidTrytesException.java +++ b/src/main/java/jota/error/InvalidTrytesException.java @@ -2,6 +2,7 @@ package jota.error; /** * This exception occurs when invalid trytes is provided. + * * @author Adrian */ public class InvalidTrytesException extends BaseException { diff --git a/src/main/java/jota/error/NoNodeInfoException.java b/src/main/java/jota/error/NoNodeInfoException.java index fc18040..fba5f37 100644 --- a/src/main/java/jota/error/NoNodeInfoException.java +++ b/src/main/java/jota/error/NoNodeInfoException.java @@ -2,6 +2,7 @@ package jota.error; /** * This exception occurs when its not possible to get node info. + * * @author Adrian */ public class NoNodeInfoException extends BaseException { diff --git a/src/main/java/jota/model/Bundle.java b/src/main/java/jota/model/Bundle.java index 9f270c1..1de54f6 100644 --- a/src/main/java/jota/model/Bundle.java +++ b/src/main/java/jota/model/Bundle.java @@ -67,10 +67,10 @@ public class Bundle implements Comparable { * Adds a bundle entry. * * @param signatureMessageLength Length of the signature message. - * @param address The address. - * @param value The value. - * @param tag The tag. - * @param timestamp The timestamp. + * @param address The address. + * @param value The value. + * @param tag The tag. + * @param timestamp The timestamp. */ public void addEntry(int signatureMessageLength, String address, long value, String tag, long timestamp) { if (getTransactions() == null) { @@ -79,7 +79,7 @@ public class Bundle implements Comparable { for (int i = 0; i < signatureMessageLength; i++) { Transaction trx = new Transaction(address, i == 0 ? value : 0, tag, timestamp); - getTransactions().add(trx); + transactions.add(trx); } } @@ -197,7 +197,6 @@ public class Bundle implements Comparable { * * @param o An object to compare with this object. * @return A value that indicates the relative order of the objects being compared. The return value has the following meanings: Value Meaning Less than zero This object is less than the parameter.Zero This object is equal to . Greater than zero This object is greater than . - */ @Override public int compareTo(Bundle o) { diff --git a/src/main/java/jota/model/Inputs.java b/src/main/java/jota/model/Inputs.java index aad6bb4..8d142e1 100644 --- a/src/main/java/jota/model/Inputs.java +++ b/src/main/java/jota/model/Inputs.java @@ -7,7 +7,7 @@ import java.util.List; /** * This class represents an Inputs. * - * @author Adrian + * @author Adrian **/ public class Inputs { diff --git a/src/main/java/jota/model/Signature.java b/src/main/java/jota/model/Signature.java index de10ef2..02f9b01 100644 --- a/src/main/java/jota/model/Signature.java +++ b/src/main/java/jota/model/Signature.java @@ -50,7 +50,7 @@ public class Signature { /** * Set the signatureFragments. * - * @param signatureFragments The signatureFragments. + * @param signatureFragments The signatureFragments. */ public void setSignatureFragments(List signatureFragments) { this.signatureFragments = signatureFragments; diff --git a/src/main/java/jota/model/Transaction.java b/src/main/java/jota/model/Transaction.java index c6c75d9..4b70683 100644 --- a/src/main/java/jota/model/Transaction.java +++ b/src/main/java/jota/model/Transaction.java @@ -222,6 +222,7 @@ public class Transaction { /** * Set the current index. + * * @param currentIndex The current index. */ public void setCurrentIndex(long currentIndex) { diff --git a/src/main/java/jota/pow/ICurl.java b/src/main/java/jota/pow/ICurl.java index 01ab12c..0608755 100644 --- a/src/main/java/jota/pow/ICurl.java +++ b/src/main/java/jota/pow/ICurl.java @@ -28,7 +28,7 @@ public interface ICurl { /** * Squeezes the specified trits. * - * @param trits The trits. + * @param trits The trits. * @param offset The offset to start from. * @param length The length. * @return The squeezed trits. diff --git a/src/main/java/jota/pow/JCurl.java b/src/main/java/jota/pow/JCurl.java index b23d3d7..3a80848 100644 --- a/src/main/java/jota/pow/JCurl.java +++ b/src/main/java/jota/pow/JCurl.java @@ -2,7 +2,7 @@ package jota.pow; /** * (c) 2016 Come-from-Beyond - * + *

* JCurl belongs to the sponge function family. */ public class JCurl implements ICurl { diff --git a/src/main/java/jota/utils/Checksum.java b/src/main/java/jota/utils/Checksum.java index 7627570..a69c3f9 100644 --- a/src/main/java/jota/utils/Checksum.java +++ b/src/main/java/jota/utils/Checksum.java @@ -34,6 +34,8 @@ public class Checksum { public static String removeChecksum(String address) throws InvalidAddressException { if (isAddressWithChecksum(address)) { return removeChecksumFromAddress(address); + } else if (isAddressWithoutChecksum(address)) { + return address; } throw new InvalidAddressException(); } diff --git a/src/main/java/jota/utils/Converter.java b/src/main/java/jota/utils/Converter.java index 1f80892..4410962 100644 --- a/src/main/java/jota/utils/Converter.java +++ b/src/main/java/jota/utils/Converter.java @@ -49,9 +49,9 @@ public class Converter { /** * Converts the specified trits array to bytes. * - * @param trits The trits. + * @param trits The trits. * @param offset The offset to start from. - * @param size The size. + * @param size The size. * @return The bytes. */ public static byte[] bytes(final int[] trits, final int offset, final int size) { @@ -122,6 +122,7 @@ public class Converter { /** * Converts the specified trinary encoded string into a trits array of the specified length. + * * @param trytes The trytes. * @param length The length. * @return A trits array. @@ -200,7 +201,7 @@ public class Converter { /** * Copies the trits from the input string into the destination array * - * @param input The input String. + * @param input The input String. * @param destination The destination array. * @return The destination. */ @@ -217,9 +218,9 @@ public class Converter { /** * Converts trites to trytes. * - * @param trits Teh trits to be converted. + * @param trits Teh trits to be converted. * @param offset The offset to start from. - * @param size The size. + * @param size The size. * @return The trytes. **/ public static String trytes(final int[] trits, final int offset, final int size) { @@ -244,7 +245,7 @@ public class Converter { /** * Converts the specified trits array to trytes in integer representation. * - * @param trits The trits. + * @param trits The trits. * @param offset The offset to start from. * @return The value. */ @@ -286,7 +287,7 @@ public class Converter { * Increments the specified trits. * * @param trits The trits. - * @param size The size. + * @param size The size. */ public static void increment(final int[] trits, final int size) { diff --git a/src/main/java/jota/utils/InputValidator.java b/src/main/java/jota/utils/InputValidator.java index e3d6a85..7d1686e 100644 --- a/src/main/java/jota/utils/InputValidator.java +++ b/src/main/java/jota/utils/InputValidator.java @@ -55,7 +55,7 @@ public class InputValidator { * * @param trytes The trytes to validate. * @param length The length. - * @return true if the specified string consist only of '9'; otherwise, false. + * @return true if the specified string consist only of '9'; otherwise, false. **/ public static boolean isNinesTrytes(final String trytes, final int length) { return trytes.matches("^[9]{" + (length == 0 ? "0," : length) + "}$"); @@ -77,7 +77,7 @@ public class InputValidator { * @param trytes The trytes array to validate. * @return true if the specified array contains only valid trytes otherwise, false. **/ - public static boolean isArrayOfTrytes(String[] trytes){ + public static boolean isArrayOfTrytes(String[] trytes) { for (String tryte : trytes) { // Check if correct 2673 trytes if (!isTrytes(tryte, 2673)) { diff --git a/src/main/java/jota/utils/IotaAPIUtils.java b/src/main/java/jota/utils/IotaAPIUtils.java index 7916acf..ae2ea2a 100644 --- a/src/main/java/jota/utils/IotaAPIUtils.java +++ b/src/main/java/jota/utils/IotaAPIUtils.java @@ -21,11 +21,11 @@ public class IotaAPIUtils { /** * Generates a new address * - * @param seed The tryte-encoded seed. It should be noted that this seed is not transferred. + * @param seed The tryte-encoded seed. It should be noted that this seed is not transferred. * @param security The secuirty level of private key / seed. - * @param index The index to start search from. If the index is provided, the generation of the address is not deterministic. + * @param index The index to start search from. If the index is provided, the generation of the address is not deterministic. * @param checksum The adds 9-tryte address checksum - * @param curl The curl instance. + * @param curl The curl instance. * @return An String with address. * @throws InvalidAddressException is thrown when the specified address is not an valid address. */ diff --git a/src/main/java/jota/utils/IotaUnitConverter.java b/src/main/java/jota/utils/IotaUnitConverter.java index c9e1cf1..758cbd3 100644 --- a/src/main/java/jota/utils/IotaUnitConverter.java +++ b/src/main/java/jota/utils/IotaUnitConverter.java @@ -12,9 +12,9 @@ public class IotaUnitConverter { /** * Convert the iota amount. * - * @param amount The amount. + * @param amount The amount. * @param fromUnit The source unit e.g. the unit of amount. - * @param toUnit The target unit. + * @param toUnit The target unit. * @return The specified amount in the target unit. **/ public static long convertUnits(long amount, IotaUnits fromUnit, IotaUnits toUnit) { @@ -36,7 +36,7 @@ public class IotaUnitConverter { /** * Convert the iota amount to text. * - * @param amount The amount. + * @param amount The amount. * @param extended Extended length. * @return The specified amount in the target unit. **/ @@ -60,8 +60,8 @@ public class IotaUnitConverter { * Create amount with unit text. * * @param amountInUnit The amount in units. - * @param unit The unit. - * @param extended Extended length. + * @param unit The unit. + * @param extended Extended length. * @return The target unit. **/ private static String createAmountWithUnitDisplayText(double amountInUnit, IotaUnits unit, boolean extended) { @@ -74,8 +74,8 @@ public class IotaUnitConverter { * Create amount text. * * @param amountInUnit The amount in units. - * @param unit The unit. - * @param extended Extended length. + * @param unit The unit. + * @param extended Extended length. * @return The target unit. **/ public static String createAmountDisplayText(double amountInUnit, IotaUnits unit, boolean extended) { diff --git a/src/main/java/jota/utils/Multisig.java b/src/main/java/jota/utils/Multisig.java index e7f3fc7..17ae539 100644 --- a/src/main/java/jota/utils/Multisig.java +++ b/src/main/java/jota/utils/Multisig.java @@ -16,6 +16,7 @@ public class Multisig { public Multisig(ICurl customCurl) { this.curl = customCurl; + this.curl.reset(); this.signingInstance = new Signing(curl.clone()); } @@ -24,14 +25,13 @@ public class Multisig { } /** - * @param seed tryte-encoded seed. It should be noted that this seed is not transferred + * @param seed tryte-encoded seed. It should be noted that this seed is not transferred * @param security security secuirty level of private key / seed * @param index * @return digest trytes **/ - private String getDigest(String seed, int security, int index) { - - int[] key = signingInstance.key(Converter.trits(seed), security, index); + public String getDigest(String seed, int security, int index) { + int[] key = signingInstance.key(Converter.trits(seed, 243), index, security); return Converter.trytes(signingInstance.digests(key)); } @@ -40,21 +40,19 @@ public class Multisig { * * @param digestTrytes * @param curlStateTrytes - * @method addAddressDigest * @return digest trytes + * @method addAddressDigest **/ - private String addAddressDigest(String digestTrytes, String curlStateTrytes, ICurl customCurl) { + public String addAddressDigest(String digestTrytes, String curlStateTrytes) { - int[] digest = Converter.trits(digestTrytes); + + int[] digest = Converter.trits(digestTrytes, digestTrytes.length() * 3); // If curlStateTrytes is provided, convert into trits // else use empty state and initiate the creation of a new address - int[] curlState = curlStateTrytes.isEmpty() ? Converter.trits(curlStateTrytes) : new int[243]; - - - ICurl curl = customCurl == null ? new JCurl() : customCurl; - + int[] curlState = !curlStateTrytes.isEmpty() ? Converter.trits(curlStateTrytes, + digestTrytes.length() * 3) : new int[digestTrytes.length() * 3]; // initialize Curl with the provided state curl.setState(curlState); @@ -67,24 +65,23 @@ public class Multisig { /** * Gets the key value of a seed * - * @param seed tryte-encoded seed. It should be noted that this seed is not transferred + * @param seed tryte-encoded seed. It should be noted that this seed is not transferred * @param index * @return digest trytes **/ - private String getKey(String seed, int index, int security) { + public String getKey(String seed, int index, int security) { - return Converter.trytes(signingInstance.key(Converter.trits(seed), index, security)); + return Converter.trytes(signingInstance.key(Converter.trits(seed, 81 * security), index, security)); } /** * Generates a new address * * @param curlStateTrytes - * @param customCurl * @return address **/ - private String finalizeAddress(String curlStateTrytes, ICurl customCurl) { + public String finalizeAddress(String curlStateTrytes) { int[] curlState = Converter.trits(curlStateTrytes); @@ -103,10 +100,9 @@ public class Multisig { * * @param multisigAddress * @param digests - * @param customCurl * @returns boolean **/ - private boolean validateAddress(String multisigAddress, int[][] digests, ICurl customCurl) { + public boolean validateAddress(String multisigAddress, int[][] digests) { // initialize Curl with the provided state curl.reset(); @@ -131,7 +127,7 @@ public class Multisig { * @param keyTrytes * @return Returns bundle trytes. **/ - private void addSignature(Bundle[] bundleToSign, String inputAddress, String keyTrytes) { + public Bundle addSignature(Bundle bundleToSign, String inputAddress, String keyTrytes) { // Get the security used for the private key @@ -148,66 +144,65 @@ public class Multisig { int numSignedTxs = 0; - for (Bundle bundle : bundleToSign) + for (int i = 0; i < bundleToSign.getTransactions().size(); i++) { - for (int i = 0; i < bundle.getTransactions().size(); i++) { + if (bundleToSign.getTransactions().get(i).getAddress().equals(inputAddress)) { - if (!bundle.getTransactions().get(i).getAddress().equals(inputAddress)) { + // If transaction is already signed, increase counter + if (!InputValidator.isNinesTrytes(bundleToSign.getTransactions().get(i).getSignatureFragments(), + bundleToSign.getTransactions().get(i).getSignatureFragments().length())) { - // If transaction is already signed, increase counter - if (!InputValidator.isNinesTrytes(bundle.getTransactions().get(i).getSignatureFragments(), bundle.getTransactions().get(i).getSignatureFragments().length())) { + numSignedTxs++; + } + // Else sign the transactions + else { - numSignedTxs++; + String bundleHash = bundleToSign.getTransactions().get(i).getBundle(); + + // First 6561 trits for the firstFragment + int[] firstFragment = Arrays.copyOfRange(key, 0, 6561); + + // Get the normalized bundle hash + int[][] normalizedBundleFragments = new int[3][27]; + int[] normalizedBundleHash = bundleToSign.normalizedBundle(bundleHash); + + + // Split hash into 3 fragments + for (int k = 0; k < 3; k++) { + normalizedBundleFragments[k] = Arrays.copyOfRange(normalizedBundleHash, (k * 27), (k + 1) * 27); } - // Else sign the transactions - else { - - String bundleHash = bundle.getTransactions().get(i).getBundle(); - - // First 6561 trits for the firstFragment - int[] firstFragment = Arrays.copyOfRange(key, 0, 6561); - - // Get the normalized bundle hash - int[][] normalizedBundleFragments = new int[3][27]; - int[] normalizedBundleHash = bundle.normalizedBundle(bundleHash); - // Split hash into 3 fragments - for (int k = 0; k < 3; k++) { - normalizedBundleFragments[k] = Arrays.copyOfRange(normalizedBundleHash, (k * 27), (k + 1) * 27); - } + // First bundle fragment uses 27 trytes + int[] firstBundleFragment = normalizedBundleFragments[numSignedTxs % 3]; + // Calculate the new signatureFragment with the first bundle fragment + int[] firstSignedFragment = signingInstance.signatureFragment(firstBundleFragment, firstFragment); - // First bundle fragment uses 27 trytes - int[] firstBundleFragment = normalizedBundleFragments[numSignedTxs % 3]; + // Convert signature to trytes and assign the new signatureFragment + bundleToSign.getTransactions().get(i).setSignatureFragments(Converter.trytes(firstSignedFragment)); + + for (int j = 1; j < security; j++) { + + // Next 6561 trits for the firstFragment + int[] nextFragment = Arrays.copyOfRange(key, 6561 * j, (j + 1) * 6561); + + // Use the next 27 trytes + int[] nextBundleFragment = normalizedBundleFragments[(numSignedTxs + j) % 3]; // Calculate the new signatureFragment with the first bundle fragment - int[] firstSignedFragment = signingInstance.signatureFragment(firstBundleFragment, firstFragment); + int[] nextSignedFragment = signingInstance.signatureFragment(nextBundleFragment, nextFragment); - // Convert signature to trytes and assign the new signatureFragment - bundle.getTransactions().get(i).setSignatureFragments(Converter.trytes(firstSignedFragment)); - - for (int j = 1; j < security; j++) { - - // Next 6561 trits for the firstFragment - int[] nextFragment = Arrays.copyOfRange(key, 6561 * j, (j + 1) * 6561); - - // Use the next 27 trytes - int[] nextBundleFragment = normalizedBundleFragments[(numSignedTxs + j) % 3]; - - // Calculate the new signatureFragment with the first bundle fragment - int[] nextSignedFragment = signingInstance.signatureFragment(nextBundleFragment, nextFragment); - - // Convert signature to trytes and add new bundle entry at i + j position - // Assign the signature fragment - bundle.getTransactions().get(i + j).setSignatureFragments(Converter.trytes(nextSignedFragment)); - } - - break; + // Convert signature to trytes and add new bundle entry at i + j position + // Assign the signature fragment + bundleToSign.getTransactions().get(i + j).setSignatureFragments(Converter.trytes(nextSignedFragment)); } + + break; } } + } - return; + return bundleToSign; } } \ No newline at end of file diff --git a/src/main/java/jota/utils/Parallel.java b/src/main/java/jota/utils/Parallel.java index 0b2556b..7587393 100644 --- a/src/main/java/jota/utils/Parallel.java +++ b/src/main/java/jota/utils/Parallel.java @@ -51,7 +51,6 @@ public class Parallel { } /** - * * @param */ public interface Operation { diff --git a/src/main/java/jota/utils/Signing.java b/src/main/java/jota/utils/Signing.java index 798431b..bd4b6a5 100644 --- a/src/main/java/jota/utils/Signing.java +++ b/src/main/java/jota/utils/Signing.java @@ -1,6 +1,7 @@ package jota.utils; import jota.model.Bundle; +import jota.model.Transaction; import jota.pow.ICurl; import jota.pow.JCurl; @@ -8,6 +9,7 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; + public class Signing { /** @@ -15,14 +17,25 @@ public class Signing { */ private ICurl curl; - public Signing() { - this(null); - } - + /** + * public Signing() { + * this(null); + * } + *

+ * /** + * + * @param curl + */ public Signing(ICurl curl) { this.curl = curl == null ? new JCurl() : curl; } + /** + * @param seed + * @param index + * @param length + * @return + */ public int[] key(int[] seed, int index, int length) { for (int i = 0; i < index; i++) { @@ -145,6 +158,31 @@ public class Signing { return buffer; } + public Boolean validateSignatures(Bundle signedBundle, String inputAddress) { + String bundleHash = ""; + Transaction trx; + List signatureFragments = new ArrayList<>(); + for (int i = 0; i < signedBundle.getTransactions().size(); i++) { + + trx = signedBundle.getTransactions().get(i); + + if (trx.getAddress().equals(inputAddress)) { + bundleHash = trx.getBundle(); + + // if we reached remainder bundle + String signatureFragment = trx.getSignatureFragments(); + if (InputValidator.isNinesTrytes(signatureFragment, signatureFragment.length())) { + break; + } + signatureFragments.add(signatureFragment); + } + } + + + return validateSignatures(inputAddress, signatureFragments.toArray(new String[signatureFragments.size()]), bundleHash); + } + + public Boolean validateSignatures(String expectedAddress, String[] signatureFragments, String bundleHash) { Bundle bundle = new Bundle(); diff --git a/src/main/java/jota/utils/TrytesConverter.java b/src/main/java/jota/utils/TrytesConverter.java index 0bddd7d..c1c2ac0 100644 --- a/src/main/java/jota/utils/TrytesConverter.java +++ b/src/main/java/jota/utils/TrytesConverter.java @@ -10,20 +10,20 @@ public class TrytesConverter { /** * Conversion of ascii encoded bytes to trytes. * Input is a string (can be stringified JSON object), return value is Trytes - * + *

* How the conversion works: * 2 Trytes === 1 Byte * There are a total of 27 different tryte values: 9ABCDEFGHIJKLMNOPQRSTUVWXYZ - * + *

* 1. We get the decimal value of an individual ASCII character * 2. From the decimal value, we then derive the two tryte values by basically calculating the tryte equivalent (e.g. 100 === 19 + 3 * 27) * a. The first tryte value is the decimal value modulo 27 (27 trytes) * b. The second value is the remainder (decimal value - first value), divided by 27 * 3. The two values returned from Step 2. are then input as indices into the available values list ('9ABCDEFGHIJKLMNOPQRSTUVWXYZ') to get the correct tryte value - * - * + *

+ *

* EXAMPLE - * + *

* Lets say we want to convert the ASCII character "Z". * 1. 'Z' has a decimal value of 90. * 2. 90 can be represented as 9 + 3 * 27. To make it simpler: @@ -34,7 +34,6 @@ public class TrytesConverter { * b. The second tryte value is '9ABCDEFGHIJKLMNOPQRSTUVWXYZ'[3] === "C" * Our tryte pair is "IC" * - * * @param inputString The input String. * @return The ASCII char "Z" is represented as "IC" in trytes. */ From e57082d413f952d98bd766de2398daa831e2363b Mon Sep 17 00:00:00 2001 From: adrianziser Date: Sat, 18 Feb 2017 20:38:23 +0100 Subject: [PATCH 40/45] Multisig * test added --- src/test/java/jota/IotaMultisigTest.java | 87 ++++++++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 src/test/java/jota/IotaMultisigTest.java diff --git a/src/test/java/jota/IotaMultisigTest.java b/src/test/java/jota/IotaMultisigTest.java new file mode 100644 index 0000000..91bbe0b --- /dev/null +++ b/src/test/java/jota/IotaMultisigTest.java @@ -0,0 +1,87 @@ +package jota; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import jota.error.InvalidAddressException; +import jota.error.InvalidBundleException; +import jota.error.InvalidTransferException; +import jota.model.Bundle; +import jota.model.Transaction; +import jota.model.Transfer; +import jota.pow.JCurl; +import jota.utils.Converter; +import jota.utils.Multisig; +import jota.utils.Signing; +import org.junit.Before; +import org.junit.Test; + +import java.util.ArrayList; +import java.util.List; + +import static org.junit.Assert.assertTrue; + +/** + * Created by Adrian on 18.02.2017. + */ +public class IotaMultisigTest { + + private static final String TEST_SEED1 = "ABCDFG"; + private static final String TEST_SEED2 = "FDSAG"; + private static final String REMAINDER_ADDRESS = "NZRALDYNVGJWUVLKDWFKJVNYLWQGCWYCURJIIZRLJIKSAIVZSGEYKTZRDBGJLOA9AWYJQB9IPWRAKUC9FBDRZJZXZG"; + private static final String RECEIVE_ADDRESS = "ZGHXPZYDKXPEOSQTAQOIXEEI9K9YKFKCWKYYTYAUWXK9QZAVMJXWAIZABOXHHNNBJIEBEUQRTBWGLYMTX"; + + private static Gson gson = new GsonBuilder().create(); + private IotaAPI iotaClient; + + @Before + public void createApiClientInstance() { + iotaClient = new IotaAPI.Builder().build(); + } + + @Test + public void basicMultiSigTest() throws InvalidBundleException, InvalidTransferException, InvalidAddressException { + + Multisig ms = new Multisig(); + + // First co-signer uses security level 3 and index 0 for the private key + String digestOne = ms.getDigest(TEST_SEED1, 3, 0); + + // We initiate the multisig address generation by absorbing the key digest + String initiatedMultisigDigests = ms.addAddressDigest(digestOne, ""); + + // Second cosigner also uses security level 3 and index 0 for the private key + String digestTwo = ms.getDigest(TEST_SEED2, 3, 0); + + // Add the multisig by absorbing the second cosigners key digest + String finalMultisigDigests = ms.addAddressDigest(digestTwo, initiatedMultisigDigests); + + // finally we generate the multisig address itself + String multiSigAddress = ms.finalizeAddress(finalMultisigDigests); + + System.out.println("MultisigAddress = " + multiSigAddress); + + boolean isValidMultisigAddress = ms.validateAddress(multiSigAddress, new int[][]{Converter.trits(digestOne), Converter.trits(digestTwo)}); + + System.out.println("Is a valid multisig address " + isValidMultisigAddress); + + assertTrue("Address is not a valid multisigaddress", isValidMultisigAddress); + Transfer transfer = new Transfer(RECEIVE_ADDRESS, 999, "", ""); + List transfers = new ArrayList<>(); + transfers.add(transfer); + + List trxs = iotaClient.initiateTransfer(6, multiSigAddress, REMAINDER_ADDRESS, transfers, true); + + Bundle bundle = new Bundle(trxs, trxs.size()); + + bundle = ms.addSignature(bundle, multiSigAddress, ms.getKey(TEST_SEED1, 0, 3)); + + bundle = ms.addSignature(bundle, multiSigAddress, ms.getKey(TEST_SEED2, 0, 3)); + + + Signing sgn = new Signing(new JCurl()); + + boolean isValidSignature = sgn.validateSignatures(bundle, multiSigAddress); + assertTrue("MultiSignature not valid", isValidSignature); + System.out.println("Result of multi-signature validation is " + isValidSignature); + } +} From 726f4b8d42100a87b9c85ae6c492b2b19366ef4d Mon Sep 17 00:00:00 2001 From: adrianziser Date: Sat, 18 Feb 2017 21:06:54 +0100 Subject: [PATCH 41/45] auto-publish javadoc to github --- .travis.yml | 38 ++++++++++++++++++++--------------- .travis/push-jdoc-gh-pages.sh | 23 +++++++++++++++++++++ 2 files changed, 45 insertions(+), 16 deletions(-) create mode 100644 .travis/push-jdoc-gh-pages.sh diff --git a/.travis.yml b/.travis.yml index 55859a6..9c71b32 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,19 +7,25 @@ before_install: before_script: gpg --fast-import codesigning.asc script: mvn package -P build-extras deploy: - provider: releases - api_key: - secure: YR8aDGTciBNQgI8GU5DSSm6dzKyZhgmixewIMkbjwrGkdLs/UnD2cfMh2ziNuivpmnIDj2rCMmf6gr1PhQno5nsPPrrFcJs0tIv2LAvAAJst/k32zMK3wv1x54eaTS3SK9VxUdAcnB0N3RvMKLiaqkwTcxa4PY9pWlHnZdc8h9oCqr7JAq8NH/94Ri4AiUc7hDgu6xnZNDqll6gJwdM8kUPQuUsAkkAl2dBVfqB7OeQFkmTvl6Hi5WCn9zbpBpKxE4t/SbgZvH5ccVBKOZveFG38/Mm1ur6VHQ8WvZFnEHps+aq8Sjz8irzcdGHC/hSGvMfsB2LRZHKd8KaRcSCypzuBjNt+ayEaaCd4AcNIsR/cEtC9aOzttNhS6eX4YpdaDjmvlqChjKvR+reKVXK7rb6Z08vHkJC1HOofovfjBP0RXT/O1CsUTpPS0lpNfrNZ0n0GfaHqtqxYrGDsXMFIHX5v39fqwAF2pmpJQaB3CeSLpEM7YbNcPlPRQ/w4XZ5SEN1ENS6a8oenOL+IZNMyspTywG3vQgdc82W5MhjFpUawrReeWd6y5xrHiWBLVPJGsgJQPIY0MkuAGiIGqiT8hSW8x8frYhX9IZ7/x4My6PYL8pCv+zn2V8LBr5KCtjVf3sGrxftlt1eLvQHkw290yRUgcfTAd2Dj8lk8H+jYgXA= - file_glob: true - file: - - "/home/travis/build/iotaledger/iota.lib.java/target/jota*.jar" - - "/home/travis/build/iotaledger/iota.lib.java/target/jota*.jar.asc" - - "/home/travis/build/iotaledger/iota.lib.java/target/jota*-sources.jar" - - "/home/travis/build/iotaledger/iota.lib.java/target/jota*-sources.jar.asc" - - "/home/travis/build/iotaledger/iota.lib.java/target/jota*-javadoc.jar" - - "/home/travis/build/iotaledger/iota.lib.java/target/jota*-javadoc.jar.asc" - skip_cleanup: true - on: - tags: true - repo: iotaledger/iota.lib.java - all_branches: true + - provider: releases + api_key: + secure: YR8aDGTciBNQgI8GU5DSSm6dzKyZhgmixewIMkbjwrGkdLs/UnD2cfMh2ziNuivpmnIDj2rCMmf6gr1PhQno5nsPPrrFcJs0tIv2LAvAAJst/k32zMK3wv1x54eaTS3SK9VxUdAcnB0N3RvMKLiaqkwTcxa4PY9pWlHnZdc8h9oCqr7JAq8NH/94Ri4AiUc7hDgu6xnZNDqll6gJwdM8kUPQuUsAkkAl2dBVfqB7OeQFkmTvl6Hi5WCn9zbpBpKxE4t/SbgZvH5ccVBKOZveFG38/Mm1ur6VHQ8WvZFnEHps+aq8Sjz8irzcdGHC/hSGvMfsB2LRZHKd8KaRcSCypzuBjNt+ayEaaCd4AcNIsR/cEtC9aOzttNhS6eX4YpdaDjmvlqChjKvR+reKVXK7rb6Z08vHkJC1HOofovfjBP0RXT/O1CsUTpPS0lpNfrNZ0n0GfaHqtqxYrGDsXMFIHX5v39fqwAF2pmpJQaB3CeSLpEM7YbNcPlPRQ/w4XZ5SEN1ENS6a8oenOL+IZNMyspTywG3vQgdc82W5MhjFpUawrReeWd6y5xrHiWBLVPJGsgJQPIY0MkuAGiIGqiT8hSW8x8frYhX9IZ7/x4My6PYL8pCv+zn2V8LBr5KCtjVf3sGrxftlt1eLvQHkw290yRUgcfTAd2Dj8lk8H+jYgXA= + file_glob: true + file: + - "/home/travis/build/iotaledger/iota.lib.java/target/jota*.jar" + - "/home/travis/build/iotaledger/iota.lib.java/target/jota*.jar.asc" + - "/home/travis/build/iotaledger/iota.lib.java/target/jota*-sources.jar" + - "/home/travis/build/iotaledger/iota.lib.java/target/jota*-sources.jar.asc" + - "/home/travis/build/iotaledger/iota.lib.java/target/jota*-javadoc.jar" + - "/home/travis/build/iotaledger/iota.lib.java/target/jota*-javadoc.jar.asc" + skip_cleanup: true + on: + tags: true + repo: iotaledger/iota.lib.java + all_branches: true + - provider: script + script: .travis/push-jdoc-gh-pages.sh + on: + tags: true + repo: iotaledger/iota.lib.java + all_branches: true \ No newline at end of file diff --git a/.travis/push-jdoc-gh-pages.sh b/.travis/push-jdoc-gh-pages.sh new file mode 100644 index 0000000..3c6a83e --- /dev/null +++ b/.travis/push-jdoc-gh-pages.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +if [ "$TRAVIS_REPO_SLUG" == "iotaledger/iota.lib.java" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ]; then + + echo -e "Publishing javadoc...\n" + + cp -R "/home/travis/build/iotaledger/iota.lib.java/target/apidocs/" $HOME/javadoc-latest + + cd $HOME + git config --global user.email "travis@travis-ci.org" + git config --global user.name "travis-ci" + git clone --quiet --branch=gh-pages https://${GH_TOKEN}@github.com/iotaledger/iota.lib.java gh-pages > /dev/null + + cd gh-pages + git rm -rf ./javadoc + cp -Rf $HOME/javadoc-latest ./javadoc + git add -f . + git commit -m "Latest javadoc on successful travis build $TRAVIS_BUILD_NUMBER auto-pushed to gh-pages" + git push -fq origin gh-pages > /dev/null + + echo -e "Published Javadoc to gh-pages.\n" + +fi \ No newline at end of file From 8ad5deccea0f05ceb7fb178dbeaea4c6fbdaa717 Mon Sep 17 00:00:00 2001 From: adrianziser Date: Sat, 18 Feb 2017 21:15:10 +0100 Subject: [PATCH 42/45] skip cleanup to deploy javadoc on release & tagged jobs --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 9c71b32..d5232d5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -25,6 +25,7 @@ deploy: all_branches: true - provider: script script: .travis/push-jdoc-gh-pages.sh + skip_cleanup: true on: tags: true repo: iotaledger/iota.lib.java From d0fea084da9a00bec9d0ed0b2a6ff9ca23460900 Mon Sep 17 00:00:00 2001 From: adrianziser Date: Sat, 18 Feb 2017 21:35:26 +0100 Subject: [PATCH 43/45] minor update to travis file --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index d5232d5..63600e4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,7 +24,7 @@ deploy: repo: iotaledger/iota.lib.java all_branches: true - provider: script - script: .travis/push-jdoc-gh-pages.sh + script: ".travis/push-jdoc-gh-pages.sh" skip_cleanup: true on: tags: true From 8cb7cdc0fc0aac7eb5d053f2af39cc4fdfccc651 Mon Sep 17 00:00:00 2001 From: adrianziser Date: Sat, 18 Feb 2017 21:41:09 +0100 Subject: [PATCH 44/45] set execute bit on deployment script --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 63600e4..f9e9cd3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,7 +24,7 @@ deploy: repo: iotaledger/iota.lib.java all_branches: true - provider: script - script: ".travis/push-jdoc-gh-pages.sh" + script: chmod u+x .travis/push-jdoc-gh-pages.sh && .travis/push-jdoc-gh-pages.sh skip_cleanup: true on: tags: true From 1b8be4ed94758dccc036a777ced66f1963b271ba Mon Sep 17 00:00:00 2001 From: adrianziser Date: Sat, 18 Feb 2017 21:56:33 +0100 Subject: [PATCH 45/45] update javadoc deployment script --- .travis/push-jdoc-gh-pages.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis/push-jdoc-gh-pages.sh b/.travis/push-jdoc-gh-pages.sh index 3c6a83e..9e9f560 100644 --- a/.travis/push-jdoc-gh-pages.sh +++ b/.travis/push-jdoc-gh-pages.sh @@ -9,7 +9,7 @@ if [ "$TRAVIS_REPO_SLUG" == "iotaledger/iota.lib.java" ] && [ "$TRAVIS_PULL_REQU cd $HOME git config --global user.email "travis@travis-ci.org" git config --global user.name "travis-ci" - git clone --quiet --branch=gh-pages https://${GH_TOKEN}@github.com/iotaledger/iota.lib.java gh-pages > /dev/null + git clone --quiet --branch=gh-pages https://${GH_TOKEN}@github.com/iotaledger/iota.lib.java.git gh-pages > /dev/null cd gh-pages git rm -rf ./javadoc