From 3474ee69ccc5c1fb4ac4c8427be8a4e658c2e097 Mon Sep 17 00:00:00 2001 From: AZ Date: Sun, 22 Jan 2017 00:24:35 +0100 Subject: [PATCH] removed unused param --- src/main/java/jota/IotaAPI.java | 16 +++++++--------- src/test/java/jota/IotaAPITest.java | 2 +- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/src/main/java/jota/IotaAPI.java b/src/main/java/jota/IotaAPI.java index e41b10d..4c156c4 100644 --- a/src/main/java/jota/IotaAPI.java +++ b/src/main/java/jota/IotaAPI.java @@ -433,7 +433,7 @@ public class IotaAPI extends IotaAPICoreProxy { // confirm that the inputs exceed the threshold else { - @SuppressWarnings("unchecked") GetBalancesAndFormatResponse newinputs = getInputs(seed, Collections.EMPTY_LIST, 0, 0, totalValue); + @SuppressWarnings("unchecked") GetBalancesAndFormatResponse newinputs = getInputs(seed, 0, 0, totalValue); // If inputs with enough balance return addRemainder(seed, newinputs.getInput(), bundle, tag, totalValue, null, signatureFragments); } @@ -465,7 +465,7 @@ public class IotaAPI extends IotaAPICoreProxy { * @property {int} end Ending key index * @property {int} threshold Min balance required **/ - public GetBalancesAndFormatResponse getInputs(String seed, final List balances, int start, int end, int threshold) { + public GetBalancesAndFormatResponse getInputs(String seed, int start, int end, int threshold) { StopWatch stopWatch = new StopWatch(); // validate the seed if (!InputValidator.isTrytes(seed, 0)) { @@ -497,7 +497,7 @@ public class IotaAPI extends IotaAPICoreProxy { allAddresses.add(address); } - return getBalanceAndFormat(allAddresses, balances, threshold, start, end, stopWatch); + return getBalanceAndFormat(allAddresses, threshold, start, end, stopWatch); } // Case 2: iterate till threshold || end // @@ -506,18 +506,16 @@ public class IotaAPI extends IotaAPICoreProxy { // We then do getBalance, format the output and return it else { final GetNewAddressResponse res = getNewAddress(seed, start, false, 0, true); - return getBalanceAndFormat(res.getAddresses(), balances, threshold, start, end, stopWatch); + return getBalanceAndFormat(res.getAddresses(), threshold, start, end, stopWatch); } } // Calls getBalances and formats the output // returns the final inputsObject then - public GetBalancesAndFormatResponse getBalanceAndFormat(final List addresses, List balances, long threshold, int start, int end, StopWatch stopWatch) { + public GetBalancesAndFormatResponse getBalanceAndFormat(final List addresses, long threshold, int start, int end, StopWatch stopWatch) { - if (balances == null || balances.isEmpty()) { - GetBalancesResponse getBalancesResponse = getBalances(100, addresses); - balances = Arrays.asList(getBalancesResponse.getBalances()); - } + GetBalancesResponse getBalancesResponse = getBalances(100, addresses); + List balances = Arrays.asList(getBalancesResponse.getBalances()); // If threshold defined, keep track of whether reached or not // else set default to true diff --git a/src/test/java/jota/IotaAPITest.java b/src/test/java/jota/IotaAPITest.java index f34ec51..cae01b1 100644 --- a/src/test/java/jota/IotaAPITest.java +++ b/src/test/java/jota/IotaAPITest.java @@ -77,7 +77,7 @@ public class IotaAPITest { @Test public void shouldGetInputs() { - GetBalancesAndFormatResponse res = iotaClient.getInputs(TEST_SEED1, null, 0, 0, 0); + GetBalancesAndFormatResponse res = iotaClient.getInputs(TEST_SEED1, 0, 0, 0); System.out.println(res); assertThat(res, IsNull.notNullValue()); assertThat(res.getTotalBalance(), IsNull.notNullValue());