Updated on 2026-08-14
This commit is contained in:
parent
074eb9d673
commit
65bfe6fed6
2 changed files with 13 additions and 7 deletions
|
|
@ -9,7 +9,7 @@ public class EthIdData extends CoinData {
|
|||
private boolean hasApprovalTx = false;
|
||||
private Long approvalAddressNonce;
|
||||
private byte[] CKDpub = null;
|
||||
private String approvalAddress = "0x74bd17417f07ee8cf89a476fc3cc6ef7b7b140a7"; //default approval address for issuance
|
||||
private String approvalAddress = null; //default approval address for issuance
|
||||
|
||||
public boolean isHasApprovalTx() {
|
||||
return hasApprovalTx;
|
||||
|
|
|
|||
|
|
@ -56,12 +56,24 @@ public class EthIdEngine extends CoinEngine {
|
|||
} else {
|
||||
throw new Exception("Invalid type of Blockchain data for " + this.getClass().getSimpleName());
|
||||
}
|
||||
defineApprovalAddress();
|
||||
}
|
||||
|
||||
public EthIdEngine() {
|
||||
super();
|
||||
}
|
||||
|
||||
private void defineApprovalAddress() {
|
||||
TangemCard.IDCardData idCardData = ctx.getCard().getIDCardData();
|
||||
String approvalAddress;
|
||||
if (idCardData != null && idCardData.trustedAddress != null) {
|
||||
approvalAddress = ctx.getCard().getIDCardData().trustedAddress;
|
||||
} else {
|
||||
approvalAddress = calculateAddress(approvalPubKey);
|
||||
}
|
||||
coinData.setApprovalAddress(approvalAddress);
|
||||
}
|
||||
|
||||
private static int getDecimals() {
|
||||
return 18;
|
||||
}
|
||||
|
|
@ -484,12 +496,6 @@ public class EthIdEngine extends CoinEngine {
|
|||
try {
|
||||
String wallet = calculateAddress(calculateCKDpub(ctx.getCard().getIdHash()));
|
||||
ctx.getCoinData().setWallet(wallet);
|
||||
|
||||
TangemCard.IDCardData idCardData = ctx.getCard().getIDCardData();
|
||||
if (idCardData != null && idCardData.trustedAddress != null) {
|
||||
String approvalAddress = ctx.getCard().getIDCardData().trustedAddress;
|
||||
coinData.setApprovalAddress(approvalAddress);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
ctx.getCoinData().setWallet("ERROR");
|
||||
throw new CardProtocol.TangemException("Can't define wallet address");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue