diff --git a/src/main/java/com/mycelium/spvmodule/Constants.kt b/src/main/java/com/mycelium/spvmodule/Constants.kt index 5c496ae..0309f03 100644 --- a/src/main/java/com/mycelium/spvmodule/Constants.kt +++ b/src/main/java/com/mycelium/spvmodule/Constants.kt @@ -110,5 +110,7 @@ interface Constants { } * txFeeFactor return Coin.valueOf(txFeeValue.toLong()) } + + val COIN_SYMBOL = "BCH" } } diff --git a/src/main/java/com/mycelium/spvmodule/SpvModuleApplication.kt b/src/main/java/com/mycelium/spvmodule/SpvModuleApplication.kt index a3a5362..ec6ea3a 100644 --- a/src/main/java/com/mycelium/spvmodule/SpvModuleApplication.kt +++ b/src/main/java/com/mycelium/spvmodule/SpvModuleApplication.kt @@ -58,7 +58,6 @@ class SpvModuleApplication : MultiDexApplication(), ModuleMessageReceiver { Log.i(LOG_TAG, "=== starting app using configuration: ${if (BuildConfig.IS_TESTNET) "test" else "prod"}, ${Constants.NETWORK_PARAMETERS.id}") super.onCreate() - CommunicationManager.init(this) packageInfo = packageInfoFromContext(this) configuration = Configuration(PreferenceManager.getDefaultSharedPreferences(this)) diff --git a/src/main/java/com/mycelium/spvmodule/providers/TransactionContentProvider.kt b/src/main/java/com/mycelium/spvmodule/providers/TransactionContentProvider.kt index 0fd03d9..e316271 100644 --- a/src/main/java/com/mycelium/spvmodule/providers/TransactionContentProvider.kt +++ b/src/main/java/com/mycelium/spvmodule/providers/TransactionContentProvider.kt @@ -25,7 +25,7 @@ class TransactionContentProvider : ContentProvider() { private val LOG_TAG = this::class.java.simpleName override fun onCreate(): Boolean { - CommunicationManager.init(context) + CommunicationManager.init(context, com.mycelium.spvmodulecontract.BuildConfig.SpvApiVersion) communicationManager = CommunicationManager.getInstance() return true } @@ -102,10 +102,11 @@ class TransactionContentProvider : ContentProvider() { // this is the ACCOUNT_BALANCE_ID case but we don't read the selection from the url (yet?) listOf(selectionArgs!!.get(0).toInt()).forEach { accountIndex -> val columnValues = listOf( - accountIndex, //TransactionContract.AccountBalance._ID - service.getAccountBalance(accountIndex), //TransactionContract.AccountBalance.CONFIRMED - service.getAccountSending(accountIndex), //TransactionContract.AccountBalance.SENDING - service.getAccountReceiving(accountIndex) //TransactionContract.AccountBalance.RECEIVING + accountIndex, //TransactionContract.AccountBalance._ID + service.getAccountBalance(accountIndex), //TransactionContract.AccountBalance.CONFIRMED + service.getAccountSending(accountIndex), //TransactionContract.AccountBalance.SENDING + service.getAccountReceiving(accountIndex), //TransactionContract.AccountBalance.RECEIVING + Constants.COIN_SYMBOL //TransactionContract.AccountBalance.SYMBOL ) cursor.addRow(columnValues) } @@ -186,7 +187,8 @@ class TransactionContentProvider : ContentProvider() { val columnValues = listOf( txFee, //CalculateMaxSpendable.TX_FEE txFeeFactor, //CalculateMaxSpendable.TX_FEE_FACTOR - maxSpendableAmount //CalculateMaxSpendable.MAX_SPENDABLE + maxSpendableAmount, //CalculateMaxSpendable.MAX_SPENDABLE + Constants.COIN_SYMBOL //CalculateMaxSpendable.SYMBOL ) cursor.addRow(columnValues) } else if (selection == CalculateMaxSpendable.SELECTION_SA) { diff --git a/src/main/java/com/mycelium/spvmodule/providers/data/AccountBalanceCursor.kt b/src/main/java/com/mycelium/spvmodule/providers/data/AccountBalanceCursor.kt index b1aa442..6bebe1e 100644 --- a/src/main/java/com/mycelium/spvmodule/providers/data/AccountBalanceCursor.kt +++ b/src/main/java/com/mycelium/spvmodule/providers/data/AccountBalanceCursor.kt @@ -1,6 +1,7 @@ package com.mycelium.spvmodule.providers.data import android.database.MatrixCursor +import com.mycelium.spvmodule.providers.TransactionContract import com.mycelium.spvmodule.providers.TransactionContract.AccountBalance.* class AccountBalanceCursor @@ -8,5 +9,6 @@ class AccountBalanceCursor _ID, CONFIRMED, SENDING, - RECEIVING), + RECEIVING, + SYMBOL), 1)