This commit is contained in:
Javier Varona 2018-01-08 20:17:03 -04:00
commit 06ef3e3dc3
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 cy.agorise.crystalwallet.enums.CryptoCoin;
import cy.agorise.crystalwallet.models.GrapheneAccount;
/**
* Imports a bitsahres accounts,
@ -23,7 +24,7 @@ public class ValidateCreateBitsharesAccountRequest extends CryptoNetInfoRequest
*/
private Boolean accountExists;
private Boolean creationComplete;
private GrapheneAccount account;
private Context context;
@ -38,8 +39,8 @@ public class ValidateCreateBitsharesAccountRequest extends CryptoNetInfoRequest
this.validate();
}
public void setCreationComple(boolean value){
this.creationComplete = value;
public void setAccount(GrapheneAccount account){
this.account = account;
this.validate();
}
@ -47,12 +48,12 @@ public class ValidateCreateBitsharesAccountRequest extends CryptoNetInfoRequest
return this.accountExists;
}
public Boolean getCreationComplete() {
return creationComplete;
public GrapheneAccount getAccount() {
return account;
}
public void validate(){
if ((this.accountExists != null) && (this.creationComplete != null)){
if ((this.accountExists != null) && (this.account != null)){
this._fireOnCarryOutEvent();
}
}

View file

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