* It is used to attach trytes to the tangle. **/ public class IotaAttachToTangleRequest extends IotaCommandRequest { diff --git a/src/main/java/jota/dto/request/IotaBroadcastTransactionRequest.java b/src/main/java/jota/dto/request/IotaBroadcastTransactionRequest.java index 61d27cd..e09afc0 100644 --- a/src/main/java/jota/dto/request/IotaBroadcastTransactionRequest.java +++ b/src/main/java/jota/dto/request/IotaBroadcastTransactionRequest.java @@ -4,7 +4,7 @@ import jota.IotaAPICommands; /** * This class represents the core API request 'broadcastTransaction'. - * + *
* Broadcast a list of transactions to all neighbors. The input trytes for this call are provided by attachToTangle **/ public class IotaBroadcastTransactionRequest extends IotaCommandRequest { diff --git a/src/main/java/jota/dto/request/IotaStoreTransactionsRequest.java b/src/main/java/jota/dto/request/IotaStoreTransactionsRequest.java index 1662d9a..7e774b7 100644 --- a/src/main/java/jota/dto/request/IotaStoreTransactionsRequest.java +++ b/src/main/java/jota/dto/request/IotaStoreTransactionsRequest.java @@ -4,7 +4,7 @@ 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 {
diff --git a/src/main/java/jota/pow/JCurl.java b/src/main/java/jota/pow/JCurl.java
index ea7640c..e242fed 100644
--- a/src/main/java/jota/pow/JCurl.java
+++ b/src/main/java/jota/pow/JCurl.java
@@ -43,6 +43,7 @@ public class JCurl implements ICurl {
stateLow = null;
}
}
+
/**
* Absorbs the specified trits.
*
diff --git a/src/main/java/jota/utils/Converter.java b/src/main/java/jota/utils/Converter.java
index 69f4a33..f24fb51 100644
--- a/src/main/java/jota/utils/Converter.java
+++ b/src/main/java/jota/utils/Converter.java
@@ -9,21 +9,20 @@ import java.util.List;
*/
public class Converter {
+ public static final int HIGH_INTEGER_BITS = 0xFFFFFFFF;
+ public static final long HIGH_LONG_BITS = 0xFFFFFFFFFFFFFFFFL;
/**
* 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
*/
@@ -31,9 +30,6 @@ public class Converter {
private static final int[][] BYTE_TO_TRITS_MAPPINGS = new int[243][];
private static final int[][] TRYTE_TO_TRITS_MAPPINGS = new int[27][];
- public static final int HIGH_INTEGER_BITS = 0xFFFFFFFF;
- public static final long HIGH_LONG_BITS = 0xFFFFFFFFFFFFFFFFL;
-
static {
final int[] trits = new int[NUMBER_OF_TRITS_IN_A_BYTE];
diff --git a/src/main/java/jota/utils/InputValidator.java b/src/main/java/jota/utils/InputValidator.java
index 7d1686e..8badaf8 100644
--- a/src/main/java/jota/utils/InputValidator.java
+++ b/src/main/java/jota/utils/InputValidator.java
@@ -2,7 +2,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;
import java.util.List;
@@ -153,18 +152,9 @@ public class InputValidator {
* Checks if the seed is valid. If not, an exception is thrown.
*
* @param seed The seed to validate.
- * @return The validated seed.
- * @throws IllegalStateException Format not in trytes or Invalid Seed: Seed too long.
+ * @return true if the specified seed is valid; otherwise, false.
**/
- public static String validateSeed(String seed) {
- if (seed.length() > 81)
- 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');
-
- return seed;
+ public static boolean isValidSeed(String seed) {
+ return isTrytes(seed, seed.length());
}
}
diff --git a/src/main/java/jota/utils/Multisig.java b/src/main/java/jota/utils/Multisig.java
index 35a8cf2..7a185d2 100644
--- a/src/main/java/jota/utils/Multisig.java
+++ b/src/main/java/jota/utils/Multisig.java
@@ -31,9 +31,9 @@ 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 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 index Key index to start search from. If the index is provided, the generation of the address is not deterministic.
* @return trytes
**/
public String getDigest(String seed, int security, int index) {
@@ -70,7 +70,7 @@ 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 Key index to start search from. If the index is provided, the generation of the address is not deterministic.
* @return trytes.
**/