Skip to content

Commit

Permalink
Merge pull request #3 from PreICO/master
Browse files Browse the repository at this point in the history
Fee fixes
  • Loading branch information
Kwaskoff authored Oct 28, 2018
2 parents f9ce088 + 7538efa commit 8db1349
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,6 @@ public void onCreate() {
this,
BitsharesDatabase.class,
"bitshares.db"
).build();
).allowMainThreadQueries().build();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import android.text.Editable;
import android.text.TextUtils;
import android.text.TextWatcher;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
Expand All @@ -27,6 +28,7 @@

import com.bitshares.bitshareswallet.market.MarketStat;
import com.bitshares.bitshareswallet.room.BitsharesAsset;
import com.bitshares.bitshareswallet.room.BitsharesAssetObject;
import com.bitshares.bitshareswallet.room.BitsharesBalanceAsset;
import com.bitshares.bitshareswallet.viewmodel.SellBuyViewModel;
import com.bitshares.bitshareswallet.wallet.BitsharesWalletWraper;
Expand Down Expand Up @@ -278,6 +280,7 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container,
String qString = qEditText.getText().toString();
String pString = pEditText.getText().toString();
if (TextUtils.isEmpty(qString) || TextUtils.isEmpty(pString)) {
tokenSelectDialog.close();
return;
}

Expand Down Expand Up @@ -608,8 +611,12 @@ private double calculateSellFee(asset_object symbolToSell, asset_object symbolTo
return utils.get_asset_amount(a.amount, btsAssetObj);
} else if (a.asset_id.equals(baseAssetObj.id)) {
return utils.get_asset_amount(a.amount, baseAssetObj);
} else {
} else if(a.asset_id.equals(quoteAssetObj.id)) {
return utils.get_asset_amount(a.amount, quoteAssetObj);
} else {
BitsharesAssetObject assetObject = BitsharesApplication.getInstance()
.getBitsharesDatabase().getBitsharesDao().queryAssetObjectById(a.asset_id.toString());
return utils.get_asset_amount(a.amount, assetObject);
}
} catch (NetworkStatusException e) {
return 0;
Expand All @@ -629,8 +636,12 @@ private double calculateBuyFee(asset_object symbolToReceive, asset_object symbol
return utils.get_asset_amount(a.amount, btsAssetObj);
} else if (a.asset_id.equals(baseAssetObj.id)) {
return utils.get_asset_amount(a.amount, baseAssetObj);
} else {
} else if(a.asset_id.equals(quoteAssetObj.id)) {
return utils.get_asset_amount(a.amount, quoteAssetObj);
} else {
BitsharesAssetObject assetObject = BitsharesApplication.getInstance()
.getBitsharesDatabase().getBitsharesDao().queryAssetObjectById(a.asset_id.toString());
return utils.get_asset_amount(a.amount, assetObject);
}
} catch (NetworkStatusException e) {
return 0;
Expand Down

0 comments on commit 8db1349

Please sign in to comment.