Added name to seed

This commit is contained in:
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; GrapheneAccount grapheneAccount = (GrapheneAccount) account;
boolean created = BitsharesFaucetApiGenerator.registerBitsharesAccount(grapheneAccount.getName(), boolean created = BitsharesFaucetApiGenerator.registerBitsharesAccount(grapheneAccount.getName(),
new Address(ECKey.fromPublicOnly(grapheneAccount.getOwnerKey(context).getPubKey()),"BTS").toString(), new Address(ECKey.fromPublicOnly(grapheneAccount.getOwnerKey(context).getPubKey())).toString(),
new Address(ECKey.fromPublicOnly(grapheneAccount.getActiveKey(context).getPubKey()),"BTS").toString(), new Address(ECKey.fromPublicOnly(grapheneAccount.getActiveKey(context).getPubKey())).toString(),
new Address(ECKey.fromPublicOnly(grapheneAccount.getMemoKey(context).getPubKey()),"BTS").toString(),GrapheneApiGenerator.faucetUrl); new Address(ECKey.fromPublicOnly(grapheneAccount.getMemoKey(context).getPubKey())).toString(),GrapheneApiGenerator.faucetUrl);
if(created) { if(created) {
GrapheneAccount fetch = this.getAccountInfoByName(grapheneAccount.getName()); GrapheneAccount fetch = this.getAccountInfoByName(grapheneAccount.getName());
@ -225,6 +225,7 @@ public class BitsharesAccountManager implements CryptoAccountManager, CryptoNetI
CrystalDatabase db = CrystalDatabase.getAppDatabase(context); CrystalDatabase db = CrystalDatabase.getAppDatabase(context);
long idSeed = db.accountSeedDao().insertAccountSeed(seed); long idSeed = db.accountSeedDao().insertAccountSeed(seed);
seed.setId(idSeed); seed.setId(idSeed);
seed.setName(createRequest.getAccountName());
GrapheneAccount account = new GrapheneAccount(); GrapheneAccount account = new GrapheneAccount();
account.setName(createRequest.getAccountName()); account.setName(createRequest.getAccountName());
account.setSeedId(idSeed); account.setSeedId(idSeed);

View file

@ -89,6 +89,7 @@ public class GrapheneAccount extends CryptoNetAccount {
if(seed.getType().equals(SeedType.BRAINKEY)){ if(seed.getType().equals(SeedType.BRAINKEY)){
return new BrainKey(seed.getMasterSeed(),0).getPrivateKey(); return new BrainKey(seed.getMasterSeed(),0).getPrivateKey();
}else{ }else{
System.out.println("calculating activekey from bip39");
DeterministicKey masterKey = (DeterministicKey) seed.getPrivateKey(); DeterministicKey masterKey = (DeterministicKey) seed.getPrivateKey();
DeterministicKey purposeKey = HDKeyDerivation.deriveChildKey(masterKey, DeterministicKey purposeKey = HDKeyDerivation.deriveChildKey(masterKey,
new ChildNumber(48, true)); new ChildNumber(48, true));