Skip to content

Commit

Permalink
style: ktlint
Browse files Browse the repository at this point in the history
  • Loading branch information
HashEngineering committed Jun 21, 2024
1 parent b1cf7de commit ae2cc6d
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import org.dash.wallet.integrations.maya.model.ExchangeRateResponse
import org.dash.wallet.integrations.maya.model.FreeCurrencyResponse
import retrofit2.Response
import retrofit2.http.GET
import retrofit2.http.Header
import retrofit2.http.Query

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import org.dash.wallet.integrations.maya.utils.MayaConstants
import org.slf4j.Logger
import org.slf4j.LoggerFactory
import java.util.concurrent.Executors
import java.util.concurrent.TimeUnit
import javax.inject.Inject

class FiatExchangeRateApiAggregator @Inject constructor(
Expand All @@ -44,8 +43,8 @@ class FiatExchangeRateApiAggregator @Inject constructor(
val lastUpdate = mayaConfig.get(MayaConfig.EXCHANGE_RATE_LAST_UPDATE)
val lastCurrencyCode = mayaConfig.get(MayaConfig.EXCHANGE_RATE_CURRENCY_CODE)
if (lastCurrencyCode != currencyCode || lastUpdate == null || lastUpdate == 0L ||
(System.currentTimeMillis() - lastUpdate) > MayaConfig.expirationDuration) {

(System.currentTimeMillis() - lastUpdate) > MayaConfig.expirationDuration
) {
if (currencyCode == MayaConstants.DEFAULT_EXCHANGE_CURRENCY) {
return ExchangeRate(MayaConstants.DEFAULT_EXCHANGE_CURRENCY, "1.0")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ abstract class MayaModule {

@Provides
fun provideExchangeRateEndpoint(
remoteDataSource: RemoteDataSource,
remoteDataSource: RemoteDataSource
): ExchangeRateApi {
val baseUrl = MayaConstants.EXCHANGERATE_BASE_URL
return remoteDataSource.buildApi(ExchangeRateApi::class.java, baseUrl)
Expand All @@ -78,7 +78,7 @@ abstract class MayaModule {

@Provides
fun provideFreeCurrencyApiEndpoint(
remoteDataSource: RemoteDataSource,
remoteDataSource: RemoteDataSource
): FreeCurrencyApi {
val baseUrl = MayaConstants.FREE_CURRENCY_API_BASE_URL
return remoteDataSource.buildApi(FreeCurrencyApi::class.java, baseUrl)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ class CurrencyBeaconResponse(
val base: String,
val date: String,
val rates: Map<String, Double>
)
)
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ package org.dash.wallet.integrations.maya.model
*/
class FreeCurrencyResponse(
val data: Map<String, Double>
)
)
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import android.view.View
import androidx.core.content.ContextCompat
import androidx.core.widget.doAfterTextChanged
import androidx.fragment.app.Fragment
import androidx.fragment.app.viewModels
import androidx.lifecycle.lifecycleScope
import androidx.navigation.fragment.findNavController
import androidx.recyclerview.widget.DiffUtil
Expand Down Expand Up @@ -56,8 +55,8 @@ class MayaCryptoCurrencyPickerFragment : Fragment(R.layout.fragment_currency_pic
class FullDiffCallback : DiffUtil.ItemCallback<IconifiedViewItem>() {
override fun areItemsTheSame(oldItem: IconifiedViewItem, newItem: IconifiedViewItem): Boolean {
return oldItem.title == newItem.title &&
oldItem.iconRes == newItem.iconRes &&
oldItem.additionalInfo == newItem.additionalInfo
oldItem.iconRes == newItem.iconRes &&
oldItem.additionalInfo == newItem.additionalInfo
}

override fun areContentsTheSame(oldItem: IconifiedViewItem, newItem: IconifiedViewItem): Boolean {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import android.os.Bundle
import android.view.View
import androidx.core.view.isVisible
import androidx.fragment.app.Fragment
import androidx.fragment.app.viewModels
import androidx.navigation.fragment.findNavController
import dagger.hilt.android.AndroidEntryPoint
import org.dash.wallet.common.databinding.FragmentIntegrationPortalBinding
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,10 @@ class MayaViewModel @Inject constructor(
newPoolList.forEach { pool ->
pool.setAssetPrice(fiatExchangeRate!!)
}
log.info("exchange rate Pool List: {}", newPoolList.map { pool -> pool.assetPriceFiat.toFriendlyString() })
log.info(
"exchange rate Pool List: {}",
newPoolList.map { pool -> pool.assetPriceFiat.toFriendlyString() }
)
poolList.value = newPoolList
}
.launchIn(viewModelScope)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,4 @@ object MayaConstants {
const val ERROR_ID_2FA_REQUIRED = "two_factor_required"
const val ERROR_MSG_INVALID_REQUEST = "That code was invalid"
const val TRANSACTION_TYPE_SEND = "send"
}
}

0 comments on commit ae2cc6d

Please sign in to comment.