Skip to content

Commit

Permalink
fixed and suppressed some deprecations (marked as todo), updated expl…
Browse files Browse the repository at this point in the history
…orer delegation "waitlist" field
  • Loading branch information
edwardstock committed Oct 18, 2020
1 parent a38ffde commit 7bd4f2d
Show file tree
Hide file tree
Showing 12 changed files with 25 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class DelegatedStake : DelegatedItem, RemoteImageContainer, Comparable<Delegated
amountBIP = info.bipValue
publicKey = info.publicKey!!
validatorMeta = info.meta!!
isKicked = info.isKicked
isKicked = info.isInWaitlist
}

override fun isSameOf(item: DelegatedItem): Boolean {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ class DelegateUnbondPresenter @Inject constructor() : MvpBasePresenter<DelegateU
val acc = accountStorage.entity.mainWallet
if (type == Type.Delegate) {
if (fromAccount != null) {
onAccountSelected(acc.findCoinById(fromAccount?.coin?.id).orElse(acc.coinsList[0]))
onAccountSelected(acc.findCoin(fromAccount?.coin?.id).orElse(acc.coinsList[0]))
} else {
onAccountSelected(acc.coinsList[0])
}
Expand Down Expand Up @@ -515,7 +515,7 @@ class DelegateUnbondPresenter @Inject constructor() : MvpBasePresenter<DelegateU
* - anyway, use BIP as gas coin, if not enough - error
*/

val bipAccountOpt = accountStorage.entity.mainWallet.findCoinByName(MinterSDK.DEFAULT_COIN)
val bipAccountOpt = accountStorage.entity.mainWallet.findCoin(MinterSDK.DEFAULT_COIN)

if (type == Type.Delegate) {
// check enough a BIP balance to pay fee, even if delegated coin is not the BIP
Expand All @@ -540,7 +540,7 @@ class DelegateUnbondPresenter @Inject constructor() : MvpBasePresenter<DelegateU
}

// BIP balance not enough to pay fee, trying to calculate custom coin
val fromAccountOpt = accountStorage.entity.mainWallet.findCoinById(fromAccount!!.coin.id)
val fromAccountOpt = accountStorage.entity.mainWallet.findCoin(fromAccount!!.coin.id)

// if balance for custom coin not found - error
if (!fromAccountOpt.isPresent) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ abstract class ExchangePresenter<V : ExchangeView>(
mBuyCoin = it
mInputChange!!.onNext(isBuying)
},
{ t ->
{
mBuyCoin = null
mInputChange!!.onNext(isBuying)
Timber.d("Unable to find coin by name %s", text)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,12 @@ public WalletModule(Context context, boolean debug, boolean enableExternalLog) {
{
MinterExplorerSDK.Setup explorerSdk = new MinterExplorerSDK.Setup().setEnableDebug(debug);

/* for test purposes only
if(BuildConfig.FLAVOR.startsWith("netMain")) {
explorerSdk.setNetId("chilinet");
}
*/

if (BuildConfig.EXPLORER_API_URL != null) {
explorerSdk.setExplorerApiUrl(BuildConfig.EXPLORER_API_URL);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ abstract class BaseBottomSheetDialogFragment : BaseMvpBottomSheetDialogFragment(
params.height = ViewGroup.LayoutParams.MATCH_PARENT
d.window!!.attributes = params
d.window!!.setGravity(Gravity.BOTTOM or Gravity.CENTER_HORIZONTAL)
//todo
@Suppress("DEPRECATION")
d.window!!.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE)
d.window!!.statusBarColor = Color.TRANSPARENT
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,10 @@ abstract class WalletDialog protected constructor(context: Context) :
params.height = ViewGroup.LayoutParams.MATCH_PARENT
window!!.attributes = params
window!!.setGravity(Gravity.CENTER_VERTICAL or Gravity.CENTER_HORIZONTAL)
//todo
@Suppress("DEPRECATION")
window!!.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE)
@Suppress("DEPRECATION")
window!!.decorView.systemUiVisibility = ViewHelper.systemBarsLightness(false)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ abstract class WalletDialogFragment : MvpAppCompatDialogFragment() {
params.height = ViewGroup.LayoutParams.WRAP_CONTENT
d.window!!.attributes = params
d.window!!.setGravity(Gravity.CENTER_VERTICAL or Gravity.CENTER_HORIZONTAL)
//todo
@Suppress("DEPRECATION")
d.window!!.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE)
d.window!!.navigationBarColor = ContextCompat.getColor(context!!, R.color.white)
if (disableAnimations) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,6 @@ class AddressListBalancesTotal(
}

fun getCoinBalance(address: MinterAddress, coin: CoinItemBase): BigDecimal {
return getBalance(address).getCoin(coin.id)?.amount ?: BigDecimal.ZERO
return getBalance(address).getCoin(coin.id).amount ?: BigDecimal.ZERO
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ class PinValidationDialog : MvpAppCompatDialogFragment(), PinValidatingView {
params.width = ViewGroup.LayoutParams.MATCH_PARENT
params.height = ViewGroup.LayoutParams.MATCH_PARENT
dialog.window!!.attributes = params
//todo
@Suppress("DEPRECATION")
dialog.window!!.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE)
}
return dialog
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ class SendTabPresenter @Inject constructor() : MvpBasePresenter<SendView>(), Err
if (!res.isEmpty) {
val acc = accountStorage.entity.mainWallet
if (mLastAccount != null) {
onAccountSelected(acc.findCoinById(mLastAccount!!.coin.id).orElse(acc.coinsList[0]))
onAccountSelected(acc.findCoin(mLastAccount!!.coin.id).orElse(acc.coinsList[0]))
} else {
onAccountSelected(acc.coinsList[0])
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ class ExternalTransactionPresenter @Inject constructor() : MvpBasePresenter<Exte

if (txValues != null) {
val balance = accountStorage.data.getBalance(from!!)
val coinBalanceSearch = balance.findCoinById(txValues.coinId)
val coinBalanceSearch = balance.findCoin(txValues.coinId)

var balanceSum: BigDecimal = BigDecimal.ZERO
if (coinBalanceSearch.isPresent) {
Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,6 @@ ext {
minterLedgerSDK = "0.1.0"
roomVersion = "2.2.5"

appVersionName = "2.1.0-rc01"
appVersionCode = 191
appVersionName = "2.1.0"
appVersionCode = 192
}

0 comments on commit 7bd4f2d

Please sign in to comment.