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