Merge branch 'master' of https://github.com/Agorise/crystal-wallet-android
This commit is contained in:
commit
06ef3e3dc3
2 changed files with 11 additions and 8 deletions
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue