Updated on 2026-08-14

This commit is contained in:
Tangem 2019-11-06 09:31:12 +00:00
commit 0e569dadc9
5 changed files with 9 additions and 8 deletions

View file

@ -136,7 +136,7 @@ public class ServerApiStellar {
LOG.e(TAG, "requestData " + stellarRequest.getClass().getSimpleName() + " onError " + e.getMessage());
LOG.e(TAG, String.format("%d requests left in processing", requestsCount));
if (isRetry || stellarRequest.errorResponse.getCode() == 404) {
if (isRetry || (stellarRequest.errorResponse != null && stellarRequest.errorResponse.getCode() == 404)) {
stellarRequest.setError(e.getMessage());
//setErrorOccurred(e.getMessage());//;
listener.onFail(stellarRequest);
@ -155,7 +155,7 @@ public class ServerApiStellar {
if (stellarRequest.getError() != null) {
LOG.i(TAG, "requestData " + stellarRequest.getClass().getSimpleName() + " onComplete, error!=null");
if (isRetry || stellarRequest.errorResponse.getCode() == 404) {
if (isRetry || (stellarRequest.errorResponse != null && stellarRequest.errorResponse.getCode() == 404)) {
listener.onFail(stellarRequest);
} else {
retryRequest(ctx, stellarRequest);

View file

@ -182,7 +182,8 @@ public class TokenEngine extends CoinEngine {
if (coinData == null) return false;
if (coinData.getBalanceInInternalUnits() == null && coinData.getBalanceAlterInInternalUnits() == null)
return false;
return coinData.getBalanceInInternalUnits().notZero() || coinData.getBalanceAlterInInternalUnits().notZero();
return (coinData.getBalanceInInternalUnits() != null && coinData.getBalanceInInternalUnits().notZero() ) ||
(coinData.getBalanceAlterInInternalUnits() != null && coinData.getBalanceAlterInInternalUnits().notZero());
}

View file

@ -163,7 +163,7 @@ public class XlmAssetEngine extends CoinEngine {
@Override
public Uri getWalletExplorerUri() {
return Uri.parse("http://stellarchain.io/address/" + ctx.getCoinData().getWallet());
return Uri.parse("https://stellar.expert/explorer/public/account/" + ctx.getCoinData().getWallet());
}
@Override

View file

@ -143,7 +143,7 @@ public class XlmEngine extends CoinEngine {
@Override
public Uri getWalletExplorerUri() {
return Uri.parse((ctx.getBlockchain() == Blockchain.Stellar ? "http://stellarchain.io/address/" : "http://testnet.stellarchain.io/address/") + ctx.getCoinData().getWallet());
return Uri.parse((ctx.getBlockchain() == Blockchain.Stellar ? "https://stellar.expert/explorer/public/account/" : "https://stellar.expert/explorer/testnet/account/") + ctx.getCoinData().getWallet());
}
@Override
@ -429,7 +429,7 @@ public class XlmEngine extends CoinEngine {
public void onFail(StellarRequest.Base request) {
Log.i(TAG, "onFail: " + request.getClass().getSimpleName() + " " + request.getError());
if (request.errorResponse.getCode() == 404) {
if (request.errorResponse != null && request.errorResponse.getCode() == 404) {
coinData.setTargetAccountCreated(false);
if (amount.compareTo(coinData.getReserve()) >= 0) { //TODO: take fee inclusion in account, now 1 XLM with fee included will fail after transaction is sent
@ -492,7 +492,7 @@ public class XlmEngine extends CoinEngine {
public void onFail(StellarRequest.Base request) {
Log.i(TAG, "onFail: " + request.getClass().getSimpleName() + " " + request.getError());
if (request.errorResponse.getCode() == 404) {
if (request.errorResponse != null && request.errorResponse.getCode() == 404) {
coinData.setError404(true);
} else {
ctx.setError(request.getError());

View file

@ -6,7 +6,7 @@ buildscript {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.1'
classpath 'com.android.tools.build:gradle:3.5.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
classpath 'io.fabric.tools:gradle:1.31.0'