updated getNewAddress Test

This commit is contained in:
davassi
2016-12-03 00:01:21 +01:00
parent f697dac422
commit 2cb221c227
2 changed files with 9 additions and 6 deletions
+5 -4
View File
@@ -18,12 +18,13 @@ 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 );
log.debug("key Length = {}", key.length );
final int[] digests = Signing.digests(key);
System.out.println("Length = "+ digests.length );
log.debug("digests Length = {}", digests.length );
final int[] addressTrits = Signing.address(digests);
System.out.println("Length = "+ addressTrits.length );
log.debug("addressTrits Length = {}", addressTrits.length );
final String address = Converter.trytes(addressTrits);
+4 -2
View File
@@ -4,6 +4,8 @@ import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import jota.dto.response.*;
import jota.utils.IotaAPIUtils;
import org.hamcrest.core.Is;
import org.hamcrest.core.IsNull;
import org.junit.Before;
import org.junit.Test;
@@ -126,7 +128,7 @@ public class IotaAPIProxyTest {
@Test
public void shouldCreateANewAddress() {
GetNewAddressResponse res = IotaAPIUtils.getNewAddress(TEST_SEED, 2);
System.err.println(res);
GetNewAddressResponse res = IotaAPIUtils.getNewAddress(TEST_SEED, 4);
assertThat(res.getAddress(), Is.is("GBPQGDMZ99FRNUBLCCIAXOEWNED9T9AMEHCGMMMFYTP9VINCVSNPAXUXBHQ9DIPTOOTP9XXUAUBDBMWMP"));
}
}