Updated on 2026-08-14

This commit is contained in:
Tangem 2020-02-21 21:57:17 +03:00
parent 05a9671ed1
commit cfc1c20a2e
3 changed files with 16 additions and 27 deletions

View file

@ -671,7 +671,7 @@ public class CardanoEngine extends CoinEngine {
}
@Override
public void onSuccess(String method, List listResponse) {
public void onSuccess(String method, String stringResponse) {
Log.e(TAG, "Wrong response type for requestBalanceAndUnspentTransactions");
ctx.setError("Wrong response type for requestBalanceAndUnspentTransactions");
blockchainRequestsCallbacks.onComplete(false);
@ -731,30 +731,19 @@ public class CardanoEngine extends CoinEngine {
}
@Override
public void onSuccess(String method, List listResponse) {
public void onSuccess(String method, String stringResponse) {
if (method.equals(ServerApiAdalite.ADALITE_SEND)) {
String resultString = listResponse.toString();
try {
if (resultString.isEmpty()) {
ctx.setError("No response from node");
blockchainRequestsCallbacks.onComplete(false);
} else { // TODO: Make check for a valid send response
ctx.setError(null);
blockchainRequestsCallbacks.onComplete(true);
}
} catch (Exception e) {
if (e.getMessage() != null) {
ctx.setError(e.getMessage());
blockchainRequestsCallbacks.onComplete(false);
} else {
ctx.setError(e.getClass().getName());
blockchainRequestsCallbacks.onComplete(false);
Log.e(TAG, resultString);
}
if (stringResponse.equals("\"Transaction sent successfully!\"")) {
ctx.setError(null);
blockchainRequestsCallbacks.onComplete(true);
} else { // TODO: Make check for a valid send response
ctx.setError(stringResponse);
blockchainRequestsCallbacks.onComplete(false);
}
}
}
@Override
public void onFail(String method, String message) {
Log.e(TAG, "onFail: " + method + " " + message);