Added the import rrequest with only the mnemonic words of the seed

This commit is contained in:
hvarona 2018-10-25 00:58:42 -04:00
parent ac95b66511
commit e8ceb88c6e

View file

@ -253,7 +253,7 @@ public class BitsharesAccountManager implements CryptoAccountManager, CryptoNetI
ApiRequest getAccountNamesBK = new ApiRequest(0, new ApiRequestListener() { ApiRequest getAccountNamesBK = new ApiRequest(0, new ApiRequestListener() {
@Override @Override
public void success(Object answer, int idPetition) { public void success(Object answer, int idPetition) {
if(answer != null) { if(answer != null && importRequest.getStatus().equals(ImportBitsharesAccountRequest.StatusCode.NOT_STARTED)) {
UserAccount userAccount = (UserAccount) answer; UserAccount userAccount = (UserAccount) answer;
importRequest.setSeedType(SeedType.BRAINKEY); importRequest.setSeedType(SeedType.BRAINKEY);
importRequest.setStatus(ImportBitsharesAccountRequest.StatusCode.SUCCEEDED); importRequest.setStatus(ImportBitsharesAccountRequest.StatusCode.SUCCEEDED);
@ -268,7 +268,7 @@ public class BitsharesAccountManager implements CryptoAccountManager, CryptoNetI
account.setCryptoNet(CryptoNet.BITSHARES); account.setCryptoNet(CryptoNet.BITSHARES);
account.setAccountIndex(0); account.setAccountIndex(0);
account.setSeedId(idSeed); account.setSeedId(idSeed);
account.setName(userAccount.getName()); account.setAccountId(userAccount.getObjectId());
importAccountFromSeed(account, importRequest.getContext()); importAccountFromSeed(account, importRequest.getContext());
} }
} }
@ -276,14 +276,14 @@ public class BitsharesAccountManager implements CryptoAccountManager, CryptoNetI
@Override @Override
public void fail(int idPetition) { public void fail(int idPetition) {
importRequest.setStatus(ImportBitsharesAccountRequest.StatusCode.PETITION_FAILED); //importRequest.setStatus(ImportBitsharesAccountRequest.StatusCode.PETITION_FAILED);
} }
}); });
ApiRequest getAccountNamesBP39 = new ApiRequest(0, new ApiRequestListener() { ApiRequest getAccountNamesBP39 = new ApiRequest(0, new ApiRequestListener() {
@Override @Override
public void success(Object answer, int idPetition) { public void success(Object answer, int idPetition) {
if(answer != null) { if(answer != null && importRequest.getStatus().equals(ImportBitsharesAccountRequest.StatusCode.NOT_STARTED)) {
UserAccount userAccount = (UserAccount) answer; UserAccount userAccount = (UserAccount) answer;
importRequest.setSeedType(SeedType.BIP39); importRequest.setSeedType(SeedType.BIP39);
importRequest.setStatus(ImportBitsharesAccountRequest.StatusCode.SUCCEEDED); importRequest.setStatus(ImportBitsharesAccountRequest.StatusCode.SUCCEEDED);
@ -298,7 +298,7 @@ public class BitsharesAccountManager implements CryptoAccountManager, CryptoNetI
account.setCryptoNet(CryptoNet.BITSHARES); account.setCryptoNet(CryptoNet.BITSHARES);
account.setAccountIndex(0); account.setAccountIndex(0);
account.setSeedId(idSeed); account.setSeedId(idSeed);
account.setName(userAccount.getName()); account.setAccountId(userAccount.getObjectId());
importAccountFromSeed(account, importRequest.getContext()); importAccountFromSeed(account, importRequest.getContext());
} }
} }
@ -306,7 +306,7 @@ public class BitsharesAccountManager implements CryptoAccountManager, CryptoNetI
@Override @Override
public void fail(int idPetition) { public void fail(int idPetition) {
importRequest.setStatus(ImportBitsharesAccountRequest.StatusCode.PETITION_FAILED); //importRequest.setStatus(ImportBitsharesAccountRequest.StatusCode.PETITION_FAILED);
} }
}); });