Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature dash #56

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/main/java/com/mycelium/spvmodule/Constants.kt
Original file line number Diff line number Diff line change
Expand Up @@ -110,5 +110,7 @@ interface Constants {
} * txFeeFactor
return Coin.valueOf(txFeeValue.toLong())
}

val COIN_SYMBOL = "BCH"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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)
}
Expand Down Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
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
: MatrixCursor(arrayOf(
_ID,
CONFIRMED,
SENDING,
RECEIVING),
RECEIVING,
SYMBOL),
1)