-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
new explorer error handling, release notes
- Loading branch information
1 parent
3ea01f4
commit 615b284
Showing
4 changed files
with
26 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> | ||
* | ||
|
@@ -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>> { | ||
|
@@ -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()) { | ||
|
@@ -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) { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters