diff --git a/graphenej/src/main/java/de/bitsharesmunich/graphenej/api/android/NodeConnection.java b/graphenej/src/main/java/de/bitsharesmunich/graphenej/api/android/NodeConnection.java index a28249a..54be1ce 100644 --- a/graphenej/src/main/java/de/bitsharesmunich/graphenej/api/android/NodeConnection.java +++ b/graphenej/src/main/java/de/bitsharesmunich/graphenej/api/android/NodeConnection.java @@ -109,7 +109,7 @@ public class NodeConnection { mThread = new WebsocketWorkerThread(this.mUrlList.get(mUrlIndex), mInternalErrorListener); mUrlIndex = mUrlIndex + 1 % this.mUrlList.size(); - mMessagesHub = new SubscriptionMessagesHub(user, password, subscribe, errorListener); + mMessagesHub = new SubscriptionMessagesHub(user, password, subscribe, mInternalErrorListener); mThread.addListener(mMessagesHub); mThread.start(); } diff --git a/graphenej/src/test/java/de/bitsharesmunich/graphenej/api/SubscriptionMessagesHubTest.java b/graphenej/src/test/java/de/bitsharesmunich/graphenej/api/SubscriptionMessagesHubTest.java index a0828d3..9d4e4b5 100644 --- a/graphenej/src/test/java/de/bitsharesmunich/graphenej/api/SubscriptionMessagesHubTest.java +++ b/graphenej/src/test/java/de/bitsharesmunich/graphenej/api/SubscriptionMessagesHubTest.java @@ -11,6 +11,7 @@ import java.util.TimerTask; import de.bitsharesmunich.graphenej.ObjectType; import de.bitsharesmunich.graphenej.Transaction; +import de.bitsharesmunich.graphenej.interfaces.NodeErrorListener; import de.bitsharesmunich.graphenej.interfaces.SubscriptionListener; import de.bitsharesmunich.graphenej.interfaces.WitnessResponseListener; import de.bitsharesmunich.graphenej.models.BaseResponse; @@ -29,12 +30,7 @@ public class SubscriptionMessagesHubTest extends BaseApiTest { /** * Error listener */ - private WitnessResponseListener mErrorListener = new WitnessResponseListener() { - @Override - public void onSuccess(WitnessResponse response) { - System.out.println("onSuccess"); - } - + private NodeErrorListener mErrorListener = new NodeErrorListener() { @Override public void onError(BaseResponse.Error error) { System.out.println("onError"); diff --git a/graphenej/src/test/java/de/bitsharesmunich/graphenej/api/android/NodeConnectionTest.java b/graphenej/src/test/java/de/bitsharesmunich/graphenej/api/android/NodeConnectionTest.java index 140e3bf..e232636 100644 --- a/graphenej/src/test/java/de/bitsharesmunich/graphenej/api/android/NodeConnectionTest.java +++ b/graphenej/src/test/java/de/bitsharesmunich/graphenej/api/android/NodeConnectionTest.java @@ -465,7 +465,7 @@ public class NodeConnectionTest { System.out.println("Adding GetBlockHeader request"); try{ - nodeConnection.addRequestHandler(new GetBlockHeader(BlOCK_TEST_NUMBER,false, new WitnessResponseListener(){ + nodeConnection.addRequestHandler(new GetBlockHeader(BlOCK_TEST_NUMBER, true, new WitnessResponseListener(){ @Override public void onSuccess(WitnessResponse response) { System.out.println("GetBlockHeader.onSuccess"); @@ -507,15 +507,16 @@ public class NodeConnectionTest { //Test with 2 BTS Asset testAsset = new Asset("1.3.0"); AssetAmount assetAmountTest = new AssetAmount(UnsignedLong.valueOf(200000), testAsset); + AssetAmount feeAmountTest = new AssetAmount(UnsignedLong.valueOf(100000), testAsset); - TransferOperation transferOperation = new TransferOperation(userAccount_from, userAccount_to, assetAmountTest, assetAmountTest); + TransferOperation transferOperation = new TransferOperation(userAccount_from, userAccount_to, assetAmountTest, feeAmountTest); ArrayList operations = new ArrayList<>(); operations.add(transferOperation); - System.out.println("Adding GetRequiredFees request"); + System.out.println("Adding GetBlockHeader request"); try{ - nodeConnection.addRequestHandler(new GetRequiredFees(operations, testAsset, false, new WitnessResponseListener(){ + nodeConnection.addRequestHandler(new GetRequiredFees(operations, testAsset, true, new WitnessResponseListener(){ @Override public void onSuccess(WitnessResponse response) { System.out.println("GetRequiredFees.onSuccess");