From 6c2ec92a25768bc0931a20155a15a16674768665 Mon Sep 17 00:00:00 2001 From: pinpong Date: Wed, 28 Dec 2016 23:27:29 +0100 Subject: [PATCH] minor --- src/main/java/jota/IotaAPIProxy.java | 10 +++++----- src/test/java/jota/IotaAPIProxyTest.java | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/jota/IotaAPIProxy.java b/src/main/java/jota/IotaAPIProxy.java index 6a25a78..205925f 100644 --- a/src/main/java/jota/IotaAPIProxy.java +++ b/src/main/java/jota/IotaAPIProxy.java @@ -545,8 +545,8 @@ public class IotaAPIProxy { inputsAddresses.add(i.getAddress()); } - GetBalancesResponse resbalances = getBalances(100, inputsAddresses); - String[] balances = resbalances.getBalances(); + GetBalancesResponse balancesResponse = getBalances(100, inputsAddresses); + String[] balances = balancesResponse.getBalances(); List confirmedInputs = new ArrayList<>(); int totalBalance = 0; @@ -816,7 +816,7 @@ public class IotaAPIProxy { List trytes = prepareTransfers(seed, transfers, address, inputs == null ? null : Arrays.asList(inputs)); List trxs = sendTrytes(trytes.toArray(new String[trytes.size()]), minWeightMagnitude); - return SendTransferResponse.create(true); + return SendTransferResponse.create(trxs.get(0).getPersistence()); } /** @@ -832,7 +832,7 @@ public class IotaAPIProxy { **/ public Bundle traverseBundle(String trunkTx, String bundleHash, Bundle bundle) throws ArgumentException { GetTrytesResponse gtr = getTrytes(trunkTx); - if (gtr != null & gtr.getTrytes().length != 0) { + if (gtr != null && gtr.getTrytes().length != 0) { Transaction trx = Converter.transactionObject(gtr.getTrytes()[0]); if (trx == null || trx.getBundle() == null) { throw new ArgumentException("Invalid trytes, could not create object"); @@ -851,7 +851,7 @@ public class IotaAPIProxy { } // If only one bundle element, return if (Integer.parseInt(trx.getLastIndex()) == 0 && Integer.parseInt(trx.getCurrentIndex()) == 0) { - return new Bundle(Arrays.asList(trx), 1); + return new Bundle(Collections.singletonList(trx), 1); } // Define new trunkTransaction for search trunkTx = trx.getTrunkTransaction(); diff --git a/src/test/java/jota/IotaAPIProxyTest.java b/src/test/java/jota/IotaAPIProxyTest.java index b325fe8..b2017f5 100644 --- a/src/test/java/jota/IotaAPIProxyTest.java +++ b/src/test/java/jota/IotaAPIProxyTest.java @@ -194,7 +194,7 @@ public class IotaAPIProxyTest { } @Test - public void shouldGetTrasfers() throws InvalidBundleException, ArgumentException, InvalidSignatureException { + public void shouldGetTransfers() throws InvalidBundleException, ArgumentException, InvalidSignatureException { assertThat(proxy.getTransfers(TEST_SEED, 0, 2, true), IsNull.notNullValue()); assertThat(proxy.getTransfers(TEST_SEED, 0, 2, false), IsNull.notNullValue()); }