From bf8e7aa122bed296ea6198277889af939d6a5a87 Mon Sep 17 00:00:00 2001 From: pinpong Date: Sun, 1 Jan 2017 21:14:29 +0100 Subject: [PATCH] added ReplayBundleResponse --- src/main/java/jota/IotaAPIProxy.java | 6 +++-- .../dto/response/ReplayBundleResponse.java | 24 +++++++++++++++++++ 2 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 src/main/java/jota/dto/response/ReplayBundleResponse.java diff --git a/src/main/java/jota/IotaAPIProxy.java b/src/main/java/jota/IotaAPIProxy.java index 7e580ae..c53a885 100644 --- a/src/main/java/jota/IotaAPIProxy.java +++ b/src/main/java/jota/IotaAPIProxy.java @@ -787,7 +787,7 @@ public class IotaAPIProxy { * @method replayBundle * @returns {object} analyzed Transaction objects **/ - public List replayTransfer(String transaction, int depth, int minWeightMagnitude) throws InvalidBundleException, InvalidSignatureException, ArgumentException { + public ReplayBundleResponse replayBundle(String transaction, int depth, int minWeightMagnitude) throws InvalidBundleException, InvalidSignatureException, ArgumentException { List bundleTrytes = new ArrayList<>(); @@ -798,7 +798,9 @@ public class IotaAPIProxy { bundleTrytes.add(Converter.transactionTrytes(element)); } - return sendTrytes(bundleTrytes.toArray(new String[bundleTrytes.size()]), depth, minWeightMagnitude); + List trxs = sendTrytes(bundleTrytes.toArray(new String[bundleTrytes.size()]), depth, minWeightMagnitude); + return ReplayBundleResponse.create(trxs.get(0).getPersistence()); + } /** diff --git a/src/main/java/jota/dto/response/ReplayBundleResponse.java b/src/main/java/jota/dto/response/ReplayBundleResponse.java new file mode 100644 index 0000000..75bad71 --- /dev/null +++ b/src/main/java/jota/dto/response/ReplayBundleResponse.java @@ -0,0 +1,24 @@ +package jota.dto.response; + +/** + * Created by pinpong on 01.01.17. + */ +public class ReplayBundleResponse extends AbstractResponse { + + private Boolean successfully; + + public static ReplayBundleResponse create(Boolean successfully) { + ReplayBundleResponse res = new ReplayBundleResponse(); + res.successfully = successfully; + return res; + } + + public Boolean getSuccessfully() { + return successfully; + } + + public void setSuccessfully(Boolean successfully) { + this.successfully = successfully; + } + +}