added getLatestInclusion

This commit is contained in:
pinpong
2016-12-22 15:57:20 +01:00
parent 9af3d2d027
commit 96fed0bf78
2 changed files with 20 additions and 4 deletions
+14 -4
View File
@@ -250,15 +250,15 @@ public class IotaAPIProxy {
* sendTrytes
* prepareTransfers
* getInputs
* getLatestInclusion
getTransfers
sendTransfer
getBundle
getTransactionsObjects
findTransactionObjects
getLatestInclusion
replayBundle
broadcastBundle
getAccountData
@@ -582,7 +582,17 @@ public class IotaAPIProxy {
public GetBundleResponse getBundle(String transaction) {
return null; //IotaAPIUtils.getBundle(transaction);
}
public GetInclusionStateResponse getLatestInclusion(String[] hashes) {
GetNodeInfoResponse getNodeInfoResponse = getNodeInfo();
if (getNodeInfoResponse == null) return null;
String[] latestMilestone = {getNodeInfoResponse.getLatestSolidSubtangleMilestone()};
return getInclusionStates(hashes, latestMilestone);
}
public static class Builder {
String protocol, host, port;
+6
View File
@@ -169,4 +169,10 @@ public class IotaAPIProxyTest {
public void shouldSendTrytes() {
proxy.sendTrytes(TEST_TRYTES, 18);
}
@Test
public void shouldGetLastInclusionState() {
GetInclusionStateResponse res = proxy.getLatestInclusion(new String[]{TEST_HASH});
assertThat(res.getStates(), IsNull.notNullValue());
}
}