Fix conflicts between NodeErrorListener and WitnessResponseListener
This commit is contained in:
parent
e364fe678f
commit
240cff9c7c
3 changed files with 8 additions and 11 deletions
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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");
|
||||
|
|
|
@ -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<BaseOperation> 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");
|
||||
|
|
Loading…
Reference in a new issue