mirror of
https://github.com/gosticks/iota.lib.java.git
synced 2026-10-04 13:37:00 +00:00
updated getNewAddress Test
This commit is contained in:
@@ -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,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"));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user