From 6d5a93f1e70cb28e909a17b5b18b4a54ec9d798c Mon Sep 17 00:00:00 2001 From: henry Date: Wed, 4 Oct 2017 23:28:19 -0400 Subject: [PATCH] minor fixed in generators response --- .../crystalwallet/apigenerator/GrapheneApiGenerator.java | 1 - .../crystalwallet/manager/BitsharesAccountManager.java | 6 ++++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/cy/agorise/crystalwallet/apigenerator/GrapheneApiGenerator.java b/app/src/main/java/cy/agorise/crystalwallet/apigenerator/GrapheneApiGenerator.java index 7221dc4..88f6c45 100644 --- a/app/src/main/java/cy/agorise/crystalwallet/apigenerator/GrapheneApiGenerator.java +++ b/app/src/main/java/cy/agorise/crystalwallet/apigenerator/GrapheneApiGenerator.java @@ -54,7 +54,6 @@ public class GrapheneApiGenerator { } } } - System.out.println("ERROR : " + response.result); request.getListener().fail(request.getId()); } diff --git a/app/src/main/java/cy/agorise/crystalwallet/manager/BitsharesAccountManager.java b/app/src/main/java/cy/agorise/crystalwallet/manager/BitsharesAccountManager.java index d7890e8..595f851 100644 --- a/app/src/main/java/cy/agorise/crystalwallet/manager/BitsharesAccountManager.java +++ b/app/src/main/java/cy/agorise/crystalwallet/manager/BitsharesAccountManager.java @@ -7,6 +7,7 @@ import cy.agorise.crystalwallet.cryptonetinforequests.CryptoNetInfoRequest; import cy.agorise.crystalwallet.cryptonetinforequests.CryptoNetInfoRequestsListener; import cy.agorise.crystalwallet.cryptonetinforequests.ValidateImportBitsharesAccountRequest; import cy.agorise.crystalwallet.models.CryptoNetAccount; +import cy.agorise.graphenej.Address; import cy.agorise.graphenej.BrainKey; import cy.agorise.graphenej.PublicKey; import cy.agorise.graphenej.models.AccountProperties; @@ -45,10 +46,11 @@ public class BitsharesAccountManager implements CryptoAccountManager, CryptoNetI public void success(Object answer, int idPetition) { if(answer != null && answer instanceof AccountProperties) { AccountProperties prop = (AccountProperties) answer; - //TODO change the key to compare + //TODO change the way to compare keys + BrainKey bk = new BrainKey(importRequest.getMnemonic(), 0); for(PublicKey activeKey : prop.active.getKeyAuthList()){ - if(activeKey.toBytes().equals(bk.getPublicKey())){ + if((new Address(activeKey.getKey(),"BTS")).toString().equals(bk.getPublicAddress("BTS").toString())){ importRequest.setMnemonicIsCorrect(true); return; }