Skip to content

Commit

Permalink
new explorer error handling, release notes
Browse files Browse the repository at this point in the history
  • Loading branch information
edwardstock committed Jan 28, 2019
1 parent 3ea01f4 commit 615b284
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 15 deletions.
11 changes: 11 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# Release Notes

## 1.2.7
- Updated SDK
- Written basic UI tests
- Fixed minor UI issues

## 1.2.6
- (!) unreleased

## 1.2.5
- Fixed error while getting free coins

## 1.2.4
- Updated blockchain SDK (min/max values to buy/sell)
- New Centrifuge client
Expand Down
8 changes: 4 additions & 4 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ android {
applicationId "network.minter.bipwallet"
minSdkVersion minterMinSdk
targetSdkVersion minterMaxSdk
versionCode 62
versionName "1.2.7-dev03"
versionCode 63
versionName "1.2.7"
testInstrumentationRunner "network.minter.bipwallet.tests.internal.WalletTestRunner"
vectorDrawables.useSupportLibrary = true
multiDexEnabled true
Expand Down Expand Up @@ -101,7 +101,7 @@ android {
debug {
testCoverageEnabled = true
signingConfig signingConfigs.config
minifyEnabled false
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro', 'proguard-test-rules.pro', 'proguard-release-rules.pro'
testProguardFile 'proguard-test-rules.pro'
}
Expand Down Expand Up @@ -139,7 +139,7 @@ android {
}

ext {
minterExplorerSDK = "0.2.8"
minterExplorerSDK = "0.2.9"
minterProfileSDK = "0.2.1"
minterBlockchainSDK = "0.5.1"
minterCoreSDK = "0.2.2"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) by MinterTeam. 2018
* Copyright (C) by MinterTeam. 2019
* @link <a href="https://github.com/MinterTeam">Org Github</a>
* @link <a href="https://github.com/edwardstock">Maintainer Github</a>
*
Expand Down Expand Up @@ -48,12 +48,11 @@
import network.minter.explorer.repo.ExplorerAddressRepository;
import timber.log.Timber;

import static network.minter.bipwallet.internal.ReactiveAdapter.convertToExpErrorResult;
import static network.minter.bipwallet.internal.ReactiveAdapter.convertToBcExpErrorResult;
import static network.minter.bipwallet.internal.ReactiveAdapter.rxCallExp;

/**
* minter-android-wallet. 2018
*
* @author Eduard Maximovich <[email protected]>
*/
public class ExplorerBalanceFetcher implements ObservableOnSubscribe<List<AccountItem>> {
Expand All @@ -78,15 +77,15 @@ public static Observable<BigDecimal> createSingleTotalBalance(ExplorerAddressRep
return rxCallExp(addressRepository.getAddressData(address))
.observeOn(AndroidSchedulers.mainThread())
.subscribeOn(Schedulers.io())
.onErrorResumeNext(convertToExpErrorResult())
.onErrorResumeNext(convertToBcExpErrorResult())
.map(item -> item.result.getTotalBalance());
}

public static Observable<BigDecimal> createSingleCoinBalance(ExplorerAddressRepository addressRepository, MinterAddress address, String coin) {
return rxCallExp(addressRepository.getAddressData(address))
.observeOn(AndroidSchedulers.mainThread())
.subscribeOn(Schedulers.io())
.onErrorResumeNext(convertToExpErrorResult())
.onErrorResumeNext(convertToBcExpErrorResult())
.map(item -> {
BigDecimal out = new BigDecimal(0);
for (Map.Entry<String, AddressData.CoinBalance> entry : item.result.coins.entrySet()) {
Expand All @@ -112,7 +111,7 @@ public void subscribe(ObservableEmitter<List<AccountItem>> emitter) throws Excep

for (MinterAddress address : mAddresses) {
rxCallExp(mAddressRepository.getAddressData(address))
.onErrorResumeNext(convertToExpErrorResult())
.onErrorResumeNext(convertToBcExpErrorResult())
.subscribeOn(Schedulers.io())
.subscribe(res -> {
synchronized (mLock) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) by MinterTeam. 2018
* Copyright (C) by MinterTeam. 2019
* @link <a href="https://github.com/MinterTeam">Org Github</a>
* @link <a href="https://github.com/edwardstock">Maintainer Github</a>
*
Expand Down Expand Up @@ -223,14 +223,15 @@ protected void onFirstViewAttach() {
.filter(item -> item.getCoin().equals(MinterSDK.DEFAULT_COIN))
.findFirst();

final StringHelper.DecimalStringFraction num;
if (!defAccount.isPresent()) {
final StringHelper.DecimalStringFraction num = StringHelper.splitDecimalStringFractions(new BigDecimal("0").setScale(4, RoundingMode.DOWN));
mBalanceCurrentState.set(num.intPart, num.fractionalPart, bips(Long.parseLong(num.intPart)));
num = StringHelper.splitDecimalStringFractions(new BigDecimal("0").setScale(4, RoundingMode.DOWN));
} else {
final StringHelper.DecimalStringFraction num = StringHelper.splitDecimalStringFractions(defAccount.get().getBalance().setScale(4, RoundingMode.DOWN));
mBalanceCurrentState.set(num.intPart, num.fractionalPart, bips(Long.parseLong(num.intPart)));
num = StringHelper.splitDecimalStringFractions(defAccount.get().getBalance().setScale(4, RoundingMode.DOWN));
}

mBalanceCurrentState.set(num.intPart, num.fractionalPart, bips(Long.parseLong(num.intPart)));

mBalanceCurrentState.applyTo(getViewState());

mCoinsRow.setStatus(ListWithButtonRow.Status.Normal);
Expand Down

0 comments on commit 615b284

Please sign in to comment.