fixed test

This commit is contained in:
pinpong
2016-12-03 00:08:41 +01:00
parent 80ef2dcf7e
commit b579a6b48e
4 changed files with 2 additions and 28 deletions
@@ -18,13 +18,8 @@ public class IotaAPIUtils {
public static GetNewAddressResponse getNewAddress(final String seed, final int index) {
final int[] key = Signing.key(Converter.trits(seed), index, 2);
System.out.println("Length = "+ key.length );
final int[] digests = Signing.digests(key);
System.out.println("Length = "+ digests.length );
final int[] addressTrits = Signing.address(digests);
System.out.println("Length = "+ addressTrits.length );
final String address = Converter.trytes(addressTrits);
return GetNewAddressResponse.create(address);
@@ -1,20 +0,0 @@
package jota;
import jota.utils.IotaAPIUtils;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
/**
* Created by Adrian on 02.12.2016.
*/
public class AddressGenerationTest {
private static String TEST_SEED = "ZEB99QTOMYDSKIFCXTLTVSWQFKO9CRKQKMRDR9HWVOVSGZMWPFQIMSCXXWUULHD9MZKMFJZAYZHZYA9VZ";
private static String FIRST_ADDRESS = "LCZXWAQUHBXST9IEPPMJICTWLKJA9HVASXWDIRCVNM9TUAGZY9SRRJLZMZQIZKBAESXXNABFATUAYQYYW";
@Test
public void shouldAddChecksum() {
assertEquals(IotaAPIUtils.getNewAddress(TEST_SEED,0),FIRST_ADDRESS);
}
}
-1
View File
@@ -1,7 +1,6 @@
package jota;
import jota.utils.Checksum;
import jota.utils.InputValidator;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
+2 -2
View File
@@ -8,6 +8,7 @@ import org.hamcrest.core.IsNull;
import org.junit.Before;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertThat;
/**
@@ -126,7 +127,6 @@ public class IotaAPIProxyTest {
@Test
public void shouldCreateANewAddress() {
GetNewAddressResponse res = IotaAPIUtils.getNewAddress(TEST_SEED, 2);
System.err.println(res);
assertEquals(IotaAPIUtils.getNewAddress(TEST_SEED, 0).getAddress(), TEST_ADDRESS_WITH_CHECKSUM);
}
}