Added name to seed

master
henry 2018-01-22 22:22:57 -04:00
parent 159743b54e
commit 14e570ce2e
2 changed files with 5 additions and 3 deletions

View File

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

View File

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