This repository was archived by the owner on Jun 14, 2018. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -57,10 +57,10 @@ android {
5757 resValue " string" , " base_url" , " https://api.multy.io/"
5858 }
5959 stage {
60- resValue " string" , " base_url" , " http ://stage.multy.io/"
60+ resValue " string" , " base_url" , " https ://stage.multy.io/"
6161 }
6262 multyTest {
63- resValue " string" , " base_url" , " http ://test.multy.io/"
63+ resValue " string" , " base_url" , " https ://test.multy.io/"
6464 }
6565 }
6666 variantFilter { variant ->
Original file line number Diff line number Diff line change 77package io .multy .storage ;
88
99import android .content .Context ;
10- import android .util .Log ;
1110
1211import java .io .File ;
1312
1413import io .multy .Multy ;
1514import io .realm .Realm ;
16- import timber .log .Timber ;
1715
1816public class RealmManager {
1917
@@ -67,7 +65,7 @@ public static void clear() {
6765 private static void isRealmAvailable () {
6866 try {
6967 if (realm == null || realm .isClosed ()) {
70- Log . e ( TAG , "ERROR DB IS CLOSED OR NULL" );
68+ throw new IllegalStateException ( "ERROR DB IS CLOSED OR NULL" );
7169 }
7270 } catch (IllegalStateException e ) {
7371 e .printStackTrace ();
Original file line number Diff line number Diff line change @@ -118,8 +118,16 @@ private void proceed(Wallet wallet) {
118118 return ;
119119 }
120120 if (viewModel .isAmountScanned ()) {
121- if (Double .parseDouble (CryptoFormatUtils
122- .satoshiToBtc (wallet .getPendingBalance ().longValue ())) >= viewModel .getAmount ()) {
121+ double walletAmount = 0 ;
122+ switch (NativeDataHelper .Blockchain .valueOf (wallet .getCurrencyId ())) {
123+ case BTC :
124+ walletAmount = CryptoFormatUtils .satoshiToBtcDouble (wallet .getAvailableBalanceNumeric ().longValue ());
125+ break ;
126+ case ETH :
127+ walletAmount = CryptoFormatUtils .weiToEth (wallet .getAvailableBalance ());
128+ break ;
129+ }
130+ if (walletAmount >= viewModel .getAmount ()) {
123131 launchTransactionFee (wallet );
124132 } else {
125133 Toast .makeText (getContext (), getString (R .string .no_balance ), Toast .LENGTH_SHORT ).show ();
You can’t perform that action at this time.
0 commit comments