summaryrefslogtreecommitdiff
path: root/wallet/src/main/java/net/taler/wallet/transactions/TransactionManager.kt
diff options
context:
space:
mode:
authorTorsten Grote <t@grobox.de>2020-08-24 17:10:49 -0300
committerTorsten Grote <t@grobox.de>2020-08-24 17:10:49 -0300
commit39dcd04750eef1581d0bdde394371ef9ca2808b9 (patch)
treea33a9c9f2683d911ff4fd2b691d91f15d117ce39 /wallet/src/main/java/net/taler/wallet/transactions/TransactionManager.kt
parent35bc91761ad1f8336f331c6b04cff8bf4d9ae064 (diff)
downloadtaler-android-39dcd04750eef1581d0bdde394371ef9ca2808b9.tar.gz
taler-android-39dcd04750eef1581d0bdde394371ef9ca2808b9.tar.bz2
taler-android-39dcd04750eef1581d0bdde394371ef9ca2808b9.zip
Get rid of Jackson and only use multi-platform serialization
Diffstat (limited to 'wallet/src/main/java/net/taler/wallet/transactions/TransactionManager.kt')
-rw-r--r--wallet/src/main/java/net/taler/wallet/transactions/TransactionManager.kt9
1 files changed, 4 insertions, 5 deletions
diff --git a/wallet/src/main/java/net/taler/wallet/transactions/TransactionManager.kt b/wallet/src/main/java/net/taler/wallet/transactions/TransactionManager.kt
index e9b1b71..6b5a79b 100644
--- a/wallet/src/main/java/net/taler/wallet/transactions/TransactionManager.kt
+++ b/wallet/src/main/java/net/taler/wallet/transactions/TransactionManager.kt
@@ -20,11 +20,11 @@ import androidx.annotation.UiThread
import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.switchMap
-import com.fasterxml.jackson.databind.ObjectMapper
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.launch
import net.taler.wallet.backend.WalletBackendApi
import java.util.HashMap
+import java.util.LinkedList
sealed class TransactionsResult {
class Error(val msg: String) : TransactionsResult()
@@ -33,8 +33,7 @@ sealed class TransactionsResult {
class TransactionManager(
private val api: WalletBackendApi,
- private val scope: CoroutineScope,
- private val mapper: ObjectMapper
+ private val scope: CoroutineScope
) {
private val mProgress = MutableLiveData<Boolean>()
@@ -64,14 +63,14 @@ class TransactionManager(
}
if (liveData.value == null) mProgress.value = true
- api.request<Transactions>("getTransactions", mapper) {
+ api.request("getTransactions", Transactions.serializer()) {
if (searchQuery != null) put("search", searchQuery)
put("currency", currency)
}.onError {
liveData.postValue(TransactionsResult.Error(it.userFacingMsg))
mProgress.postValue(false)
}.onSuccess { result ->
- val transactions = result.transactions
+ val transactions = LinkedList(result.transactions)
// TODO remove when fixed in wallet-core
val comparator = compareBy<Transaction>(
{ it.pending },