minor fixed in generators response

master
henry 2017-10-04 23:28:19 -04:00
parent c51e8f3a49
commit 6d5a93f1e7
2 changed files with 4 additions and 3 deletions

View File

@ -54,7 +54,6 @@ public class GrapheneApiGenerator {
}
}
}
System.out.println("ERROR : " + response.result);
request.getListener().fail(request.getId());
}

View File

@ -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;
}