Updated on 2026-08-14

This commit is contained in:
Tangem 2018-10-09 17:40:45 +03:00
parent a6e6ffab96
commit ff22469cde
20 changed files with 12 additions and 630 deletions

View file

@ -222,7 +222,7 @@ class ConfirmPaymentActivity : AppCompatActivity(), NfcAdapter.ReaderCallback {
}
if (!engineCoin.checkAmountValue(card, txAmount, txFee, minFeeInInternalUnits, isIncludeFee)) {
finishActivityWithError(Activity.RESULT_CANCELED, getString(R.string.not_enough_funds_or_incorrect_amount))
finishActivityWithError(Activity.RESULT_CANCELED, getString(R.string.not_enough_funds_on_your_card))
return@setOnClickListener
}
@ -344,7 +344,7 @@ class ConfirmPaymentActivity : AppCompatActivity(), NfcAdapter.ReaderCallback {
override fun onInfuraFail(method: String, message: String) {
when (method) {
ServerApiHelper.INFURA_ETH_GAS_PRICE -> {
finishActivityWithError(Activity.RESULT_CANCELED, getString(R.string.cannot_obtain_data_from_blockchain))
}
else -> {

View file

@ -57,9 +57,6 @@ class MainActivity : AppCompatActivity(), NfcAdapter.ReaderCallback, CardProtoco
if (PINStorage.needInit())
PINStorage.Init(context)
if (LastSignStorage.needInit())
LastSignStorage.Init(context)
if (Issuer.needInit())
Issuer.Init(context)

View file

@ -14,7 +14,6 @@ import com.tangem.data.network.request.ElectrumRequest
import com.tangem.domain.cardReader.NfcManager
import com.tangem.domain.wallet.Blockchain
import com.tangem.domain.wallet.CoinEngineFactory
import com.tangem.domain.wallet.LastSignStorage
import com.tangem.domain.wallet.TangemCard
import com.tangem.wallet.R
import org.json.JSONException
@ -70,13 +69,9 @@ class SendTransactionActivity : AppCompatActivity(), NfcAdapter.ReaderCallback
var hashTX = it.resultString
try {
LastSignStorage.setLastMessage(card!!.wallet, hashTX)
if (hashTX.startsWith("0x") || hashTX.startsWith("0X")) {
hashTX = hashTX.substring(2)
}
val bigInt = BigInteger(hashTX, 16) //TODO: очень плохой способ
LastSignStorage.setTxWasSend(card!!.wallet)
LastSignStorage.setLastMessage(card!!.wallet, "")
Log.e("TX_RESULT", hashTX)
finishWithSuccess()
} catch (e: Exception) {
@ -104,20 +99,12 @@ class SendTransactionActivity : AppCompatActivity(), NfcAdapter.ReaderCallback
val tmp = infuraResponse.result
hashTX = tmp
} catch (e: JSONException) {
// val msg = request.getAnswer()
// val err = msg!!.getJSONObject("error")
// hashTX = err.getString("message")
// LastSignStorage.setLastMessage(card!!.wallet, hashTX)
return
}
if (hashTX.startsWith("0x") || hashTX.startsWith("0X")) {
hashTX = hashTX.substring(2)
}
val bigInt = BigInteger(hashTX, 16) //TODO: очень плохой способ
LastSignStorage.setTxWasSend(card!!.wallet)
LastSignStorage.setLastMessage(card!!.wallet, "")
// Log.e("TX_RESULT", hashTX)
val nonce = card!!.confirmedTXCount