mirror of
https://github.com/gosticks/iota.lib.java.git
synced 2026-10-04 13:37:00 +00:00
fixed test
This commit is contained in:
@@ -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,7 +1,6 @@
|
||||
package jota;
|
||||
|
||||
import jota.utils.Checksum;
|
||||
import jota.utils.InputValidator;
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user