Updated on 2026-08-14

This commit is contained in:
Tangem 2018-09-03 11:18:31 +03:00
parent f47fe3b993
commit 90636a0e6a
6 changed files with 14 additions and 6 deletions

View file

@ -1,6 +1,7 @@
package com.tangem.data.network.task.confirm_payment;
import android.app.Activity;
import android.util.Log;
import android.view.View;
import com.tangem.data.network.request.InfuraRequest;
@ -36,13 +37,19 @@ public class ETHRequestTask extends InfuraTask {
if (request.isMethod(InfuraRequest.METHOD_ETH_GetGasPrice)) {
try {
String gasPrice = request.getResultString();
Log.i("sjjoefeff", gasPrice);
gasPrice = gasPrice.substring(2);
BigInteger l = new BigInteger(gasPrice, 16);
Log.i("sjjoefeff", gasPrice);
BigInteger m = confirmPaymentActivity.getCard().getBlockchain() == Blockchain.Token ? BigInteger.valueOf(55000) : BigInteger.valueOf(21000);
l = l.multiply(m);
String feeInGwei = confirmPaymentActivity.getCard().getAmountInGwei(String.valueOf(l));
Log.i("sjjoefeff", feeInGwei);
confirmPaymentActivity.setMinFee(feeInGwei);
confirmPaymentActivity.setMaxFee(feeInGwei);
confirmPaymentActivity.setNormalFee(feeInGwei);

View file

@ -86,7 +86,7 @@ class ConfirmPaymentActivity : AppCompatActivity(), NfcAdapter.ReaderCallback {
etAmount!!.setText(intent.getStringExtra(SignPaymentActivity.EXTRA_AMOUNT))
tvCurrency.text = engine.getBalanceCurrency(card)
tvCurrency2.text = engine.getFeeCurrency()
tvCurrency2.text = engine.feeCurrency
tvCardID.text = card!!.cidDescription
@ -137,7 +137,7 @@ class ConfirmPaymentActivity : AppCompatActivity(), NfcAdapter.ReaderCallback {
val engineCoin = CoinEngineFactory.create(card!!.blockchain)
if (engineCoin!!.isNeedCheckNode() && !nodeCheck) {
if (engineCoin!!.isNeedCheckNode && !nodeCheck) {
Toast.makeText(baseContext, getString(R.string.cannot_reach_current_active_blockchain_node_try_again), Toast.LENGTH_LONG).show()
return@setOnClickListener
}
@ -159,7 +159,7 @@ class ConfirmPaymentActivity : AppCompatActivity(), NfcAdapter.ReaderCallback {
}
if (!engineCoin.checkAmountValue(card, txAmount, txFee, minFeeInInternalUnits)) {
finishActivityWithError(Activity.RESULT_CANCELED, getString(R.string.fee_exceeds_payment_amount_enter_correct_value_and_repeat_sending))
finishActivityWithError(Activity.RESULT_CANCELED, getString(R.string.not_enough_eth_for_transaction_fee))
return@setOnClickListener
}

View file

@ -173,7 +173,7 @@ class LoadedWallet : Fragment(), NfcAdapter.ReaderCallback, CardProtocol.Notific
}
}
serverApiHelper!!.infura("eth_gasPrice", 67)
// serverApiHelper!!.infura("eth_gasPrice", 67)
// request card verify listener
serverApiHelper!!.setCardVerify {