From 14e570ce2eb4363f9a69b83e63abb57178c1bd95 Mon Sep 17 00:00:00 2001 From: henry Date: Mon, 22 Jan 2018 22:22:57 -0400 Subject: [PATCH] Added name to seed --- .../crystalwallet/manager/BitsharesAccountManager.java | 7 ++++--- .../cy/agorise/crystalwallet/models/GrapheneAccount.java | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) 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 7390cdc..51de862 100644 --- a/app/src/main/java/cy/agorise/crystalwallet/manager/BitsharesAccountManager.java +++ b/app/src/main/java/cy/agorise/crystalwallet/manager/BitsharesAccountManager.java @@ -60,9 +60,9 @@ public class BitsharesAccountManager implements CryptoAccountManager, CryptoNetI GrapheneAccount grapheneAccount = (GrapheneAccount) account; boolean created = BitsharesFaucetApiGenerator.registerBitsharesAccount(grapheneAccount.getName(), - new Address(ECKey.fromPublicOnly(grapheneAccount.getOwnerKey(context).getPubKey()),"BTS").toString(), - new Address(ECKey.fromPublicOnly(grapheneAccount.getActiveKey(context).getPubKey()),"BTS").toString(), - new Address(ECKey.fromPublicOnly(grapheneAccount.getMemoKey(context).getPubKey()),"BTS").toString(),GrapheneApiGenerator.faucetUrl); + new Address(ECKey.fromPublicOnly(grapheneAccount.getOwnerKey(context).getPubKey())).toString(), + new Address(ECKey.fromPublicOnly(grapheneAccount.getActiveKey(context).getPubKey())).toString(), + new Address(ECKey.fromPublicOnly(grapheneAccount.getMemoKey(context).getPubKey())).toString(),GrapheneApiGenerator.faucetUrl); if(created) { GrapheneAccount fetch = this.getAccountInfoByName(grapheneAccount.getName()); @@ -225,6 +225,7 @@ public class BitsharesAccountManager implements CryptoAccountManager, CryptoNetI CrystalDatabase db = CrystalDatabase.getAppDatabase(context); long idSeed = db.accountSeedDao().insertAccountSeed(seed); seed.setId(idSeed); + seed.setName(createRequest.getAccountName()); GrapheneAccount account = new GrapheneAccount(); account.setName(createRequest.getAccountName()); account.setSeedId(idSeed); diff --git a/app/src/main/java/cy/agorise/crystalwallet/models/GrapheneAccount.java b/app/src/main/java/cy/agorise/crystalwallet/models/GrapheneAccount.java index 1e82f65..1ad3904 100644 --- a/app/src/main/java/cy/agorise/crystalwallet/models/GrapheneAccount.java +++ b/app/src/main/java/cy/agorise/crystalwallet/models/GrapheneAccount.java @@ -89,6 +89,7 @@ public class GrapheneAccount extends CryptoNetAccount { if(seed.getType().equals(SeedType.BRAINKEY)){ return new BrainKey(seed.getMasterSeed(),0).getPrivateKey(); }else{ + System.out.println("calculating activekey from bip39"); DeterministicKey masterKey = (DeterministicKey) seed.getPrivateKey(); DeterministicKey purposeKey = HDKeyDerivation.deriveChildKey(masterKey, new ChildNumber(48, true));