create request for creation of account

This commit is contained in:
henry 2018-01-07 22:22:56 -04:00
parent 7b59a63f04
commit 81e6f1940a
2 changed files with 11 additions and 8 deletions

View file

@ -3,6 +3,7 @@ package cy.agorise.crystalwallet.cryptonetinforequests;
import android.content.Context; import android.content.Context;
import cy.agorise.crystalwallet.enums.CryptoCoin; import cy.agorise.crystalwallet.enums.CryptoCoin;
import cy.agorise.crystalwallet.models.GrapheneAccount;
/** /**
* Imports a bitsahres accounts, * Imports a bitsahres accounts,
@ -23,7 +24,7 @@ public class ValidateCreateBitsharesAccountRequest extends CryptoNetInfoRequest
*/ */
private Boolean accountExists; private Boolean accountExists;
private Boolean creationComplete; private GrapheneAccount account;
private Context context; private Context context;
@ -38,8 +39,8 @@ public class ValidateCreateBitsharesAccountRequest extends CryptoNetInfoRequest
this.validate(); this.validate();
} }
public void setCreationComple(boolean value){ public void setAccount(GrapheneAccount account){
this.creationComplete = value; this.account = account;
this.validate(); this.validate();
} }
@ -47,12 +48,12 @@ public class ValidateCreateBitsharesAccountRequest extends CryptoNetInfoRequest
return this.accountExists; return this.accountExists;
} }
public Boolean getCreationComplete() { public GrapheneAccount getAccount() {
return creationComplete; return account;
} }
public void validate(){ public void validate(){
if ((this.accountExists != null) && (this.creationComplete != null)){ if ((this.accountExists != null) && (this.account != null)){
this._fireOnCarryOutEvent(); this._fireOnCarryOutEvent();
} }
} }

View file

@ -226,10 +226,12 @@ public class BitsharesAccountManager implements CryptoAccountManager, CryptoNetI
account.setSeedId(idSeed); account.setSeedId(idSeed);
account.setAccountIndex(0); account.setAccountIndex(0);
account.setCryptoNet(CryptoNet.BITSHARES); account.setCryptoNet(CryptoNet.BITSHARES);
if (this.createAccountFromSeed(account,context) != null){ GrapheneAccount answer =(GrapheneAccount) this.createAccountFromSeed(account,context);
if (answer != null){
createRequest.setAccountExists(false); createRequest.setAccountExists(false);
createRequest.setCreationComple(true); createRequest.setAccount(answer);;
} }
createRequest.setAccountExists(false);
} }