Updated on 2026-08-14
This commit is contained in:
parent
6e4d1f0079
commit
9377178b12
2 changed files with 19 additions and 6 deletions
|
|
@ -62,8 +62,12 @@ public class EthData extends CoinData {
|
|||
public void loadFromBundle(Bundle B) {
|
||||
super.loadFromBundle(B);
|
||||
|
||||
String currency = B.getString("BalanceCurrency");
|
||||
balance = new CoinEngine.InternalAmount(B.getString("BalanceDecimal"), currency);
|
||||
if (B.containsKey("BalanceCurrency") && B.containsKey("BalanceDecimal")) {
|
||||
String currency = B.getString("BalanceCurrency");
|
||||
balance = new CoinEngine.InternalAmount(B.getString("BalanceDecimal"), currency);
|
||||
} else {
|
||||
balance = null;
|
||||
}
|
||||
|
||||
if (B.containsKey("confirmTx"))
|
||||
countConfirmedTX = new BigInteger(B.getString("confirmTx"), 16);
|
||||
|
|
@ -75,8 +79,10 @@ public class EthData extends CoinData {
|
|||
public void saveToBundle(Bundle B) {
|
||||
super.saveToBundle(B);
|
||||
try {
|
||||
B.putString("BalanceCurrency", balance.getCurrency());
|
||||
B.putString("BalanceDecimal", balance.toString());
|
||||
if (balance != null) {
|
||||
B.putString("BalanceCurrency", balance.getCurrency());
|
||||
B.putString("BalanceDecimal", balance.toString());
|
||||
}
|
||||
|
||||
B.putString("confirmTx", getConfirmedTXCount().toString(16));
|
||||
B.putString("unconfirmTx", getUnconfirmedTXCount().toString(16));
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ public class TokenData extends EthData {
|
|||
return balanceAlter;
|
||||
|
||||
}
|
||||
|
||||
public void setBalanceAlterInInternalUnits(CoinEngine.InternalAmount value) {
|
||||
balanceAlter = value;
|
||||
}
|
||||
|
|
@ -28,7 +29,11 @@ public class TokenData extends EthData {
|
|||
public void loadFromBundle(Bundle B) {
|
||||
super.loadFromBundle(B);
|
||||
|
||||
balanceAlter = new CoinEngine.InternalAmount(B.getString("BalanceDecimalAlter"),"wei");
|
||||
if (B.containsKey("BalanceDecimalAlter")) {
|
||||
balanceAlter = new CoinEngine.InternalAmount(B.getString("BalanceDecimalAlter"), "wei");
|
||||
} else {
|
||||
balanceAlter = null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -36,7 +41,9 @@ public class TokenData extends EthData {
|
|||
super.saveToBundle(B);
|
||||
|
||||
try {
|
||||
B.putString("BalanceDecimalAlter", balanceAlter.toString());
|
||||
if (balanceAlter != null) {
|
||||
B.putString("BalanceDecimalAlter", balanceAlter.toString());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Log.e("Can't save to bundle ", e.getMessage());
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue