diff --git a/src/integration-test/java/io/proximax/sdk/E2ESecretTest.java b/src/integration-test/java/io/proximax/sdk/E2ESecretTest.java index 353fdec7..32d84eff 100644 --- a/src/integration-test/java/io/proximax/sdk/E2ESecretTest.java +++ b/src/integration-test/java/io/proximax/sdk/E2ESecretTest.java @@ -24,6 +24,7 @@ import org.apache.commons.codec.binary.Hex; import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestInstance; import org.slf4j.Logger; @@ -70,11 +71,13 @@ void standaloneSecretLockAndProofTransaction_KECCAK_256() throws ExecutionExcept } @Test + @Disabled("not supported at the moment") void standaloneSecretLockAndProofTransaction_HASH_160() throws ExecutionException, InterruptedException { standaloneSecretLockAndProofTransaction(seedAccount, simpleAccount.getAddress(), HashType.HASH_160); } @Test + @Disabled("not supported at the moment") void standaloneSecretLockAndProofTransaction_HASH_256() throws ExecutionException, InterruptedException { standaloneSecretLockAndProofTransaction(seedAccount, simpleAccount.getAddress(), HashType.HASH_256); } @@ -118,11 +121,13 @@ void aggregateSecretLockandProofTransaction_KECCAK_256() { } @Test + @Disabled("not supported at the moment") void aggregateSecretLockAndProofTransaction_HASH_160() { aggregateSecretLockAndProofTransaction(seedAccount, simpleAccount.getAddress(), HashType.HASH_160); } @Test + @Disabled("not supported at the moment") void aggregateSecretLockAndProofTransaction_HASH_256() { aggregateSecretLockAndProofTransaction(seedAccount, simpleAccount.getAddress(), HashType.HASH_256); } diff --git a/src/main/java/io/proximax/sdk/model/transaction/HashType.java b/src/main/java/io/proximax/sdk/model/transaction/HashType.java index 45bf1a3b..5706e9d4 100644 --- a/src/main/java/io/proximax/sdk/model/transaction/HashType.java +++ b/src/main/java/io/proximax/sdk/model/transaction/HashType.java @@ -38,12 +38,16 @@ public enum HashType { /** * hashed twice: first with SHA-256 and then with RIPEMD-160 * (BTC Compat) + * @deprecated This is currently not supported by Sirius platform */ + @Deprecated HASH_160(2, Hashes::hash160, "-?[0-9a-fA-F]+", 40), /** * Hashed twice with SHA-256 * (BTC Compat) + * @deprecated This is currently not supported by Sirius platform */ + @Deprecated HASH_256(3, Hashes::hash256,"-?[0-9a-fA-F]+", 64); private final int value; @@ -65,18 +69,12 @@ public enum HashType { * @return hash type or throw IllegalArgumentException */ public static HashType rawValueOf(int value) { - switch (value) { - case 0: - return HashType.SHA3_256; - case 1: - return HashType.KECCAK_256; - case 2: - return HashType.HASH_160; - case 3: - return HashType.HASH_256; - default: - throw new IllegalArgumentException(value + " is not a valid hash type code"); - } + for (HashType type : HashType.values()) { + if (value == type.value) { + return type; + } + } + throw new IllegalArgumentException("Unsupported hash type code " + value); } /**