diff --git a/src/test/java/org/arkecosystem/crypto/SchnorrTest.java b/src/test/java/org/arkecosystem/crypto/SchnorrTest.java index f61e5c82..008fe682 100644 --- a/src/test/java/org/arkecosystem/crypto/SchnorrTest.java +++ b/src/test/java/org/arkecosystem/crypto/SchnorrTest.java @@ -9,8 +9,8 @@ class SchnorrTest { @Test public void convertHexStringToByteArray() { assertEquals( - Hex.encode(Schnorr.hexStringToByteArray("b693449AdDa7EFc015D87944EAE8b7C37EB1690A")), - "b693449adda7efc015d87944eae8b7c37eb1690a" - ); + Hex.encode( + Schnorr.hexStringToByteArray("b693449AdDa7EFc015D87944EAE8b7C37EB1690A")), + "b693449adda7efc015d87944eae8b7c37eb1690a"); } } diff --git a/src/test/java/org/arkecosystem/crypto/signature/FixtureSignVerificationTest.java b/src/test/java/org/arkecosystem/crypto/signature/FixtureSignVerificationTest.java index c9be3f6e..73294eda 100644 --- a/src/test/java/org/arkecosystem/crypto/signature/FixtureSignVerificationTest.java +++ b/src/test/java/org/arkecosystem/crypto/signature/FixtureSignVerificationTest.java @@ -17,14 +17,16 @@ import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; - public class FixtureSignVerificationTest { private final String passphrase = "my super secret passphrase"; private final String secondPassphrase = "this is a top secret second passphrase"; - private final String musigPassphrase1 = "album pony urban cheap small blade cannon silent run reveal luxury glad predict excess fire beauty hollow reward solar egg exclude leaf sight degree"; - private final String musigPassphrase2 = "hen slogan retire boss upset blame rocket slender area arch broom bring elder few milk bounce execute page evoke once inmate pear marine deliver"; - private final String musigPassphrase3 = "top visa use bacon sun infant shrimp eye bridge fantasy chair sadness stable simple salad canoe raw hill target connect avoid promote spider category"; + private final String musigPassphrase1 = + "album pony urban cheap small blade cannon silent run reveal luxury glad predict excess fire beauty hollow reward solar egg exclude leaf sight degree"; + private final String musigPassphrase2 = + "hen slogan retire boss upset blame rocket slender area arch broom bring elder few milk bounce execute page evoke once inmate pear marine deliver"; + private final String musigPassphrase3 = + "top visa use bacon sun infant shrimp eye bridge fantasy chair sadness stable simple salad canoe raw hill target connect avoid promote spider category"; @ParameterizedTest @ValueSource( @@ -32,7 +34,7 @@ public class FixtureSignVerificationTest { "transactions/transfer/transfer-sign", "transactions/transfer/transfer-with-vendor-field-sign", // "transactions/transfer/transfer-multi-sign", - + "transactions/vote/vote-sign", "transactions/vote/unvote-sign", // "transactions/vote/vote-multi-sign", @@ -59,7 +61,6 @@ void checkSchnorrSignature(String file) { LinkedTreeMap fixture = FixtureLoader.load(file); Transaction actual = new Deserializer(fixture.get("serialized").toString()).deserialize(); - if (actual.signature != null) assertTrue(actual.verify()); @@ -78,7 +79,7 @@ void checkSchnorrSignature(String file) { "transactions/transfer/transfer-sign", "transactions/transfer/transfer-with-vendor-field-sign", // "transactions/transfer/transfer-multi-sign", - + "transactions/vote/vote-sign", "transactions/vote/unvote-sign", // "transactions/vote/vote-multi-sign", @@ -125,7 +126,7 @@ void checkSigningAgainProducesSameSignature(String file) { if (withoutSignatures.secondSignature != null) { checkSecondSignature(withoutSignatures); } - + int signatureLength = 128; if (withoutSignatures.signatures != null) { @@ -137,11 +138,11 @@ void checkSigningAgainProducesSameSignature(String file) { String serializedWithoutSignatures = Hex.encode(Serializer.serialize(withoutSignatures)); String serializedFixture = fixture.get("serialized").toString(); - // Exclude the last 128 characters (signature) for final comparison + // Exclude the last 128 characters (signature) for final comparison assertThat( - serializedWithoutSignatures.substring(0, serializedWithoutSignatures.length() - signatureLength), - is(serializedFixture.substring(0, serializedFixture.length() - signatureLength))); - + serializedWithoutSignatures.substring( + 0, serializedWithoutSignatures.length() - signatureLength), + is(serializedFixture.substring(0, serializedFixture.length() - signatureLength))); } private void reSignUnsigned(Transaction actual, Transaction withoutSignatures) { diff --git a/src/test/java/org/arkecosystem/crypto/signature/SchnorrSignerTest.java b/src/test/java/org/arkecosystem/crypto/signature/SchnorrSignerTest.java index 2d2a9f1b..858c5c5f 100644 --- a/src/test/java/org/arkecosystem/crypto/signature/SchnorrSignerTest.java +++ b/src/test/java/org/arkecosystem/crypto/signature/SchnorrSignerTest.java @@ -1,7 +1,6 @@ package org.arkecosystem.crypto.signature; import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertTrue; import org.arkecosystem.crypto.Schnorr; import org.arkecosystem.crypto.encoding.Hex;