From 81e6f1940ac2040f8393af69c0edfc0c28c43321 Mon Sep 17 00:00:00 2001 From: henry Date: Sun, 7 Jan 2018 22:22:56 -0400 Subject: [PATCH] create request for creation of account --- .../ValidateCreateBitsharesAccountRequest.java | 13 +++++++------ .../manager/BitsharesAccountManager.java | 6 ++++-- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/app/src/main/java/cy/agorise/crystalwallet/cryptonetinforequests/ValidateCreateBitsharesAccountRequest.java b/app/src/main/java/cy/agorise/crystalwallet/cryptonetinforequests/ValidateCreateBitsharesAccountRequest.java index d85edf9..ca2e977 100644 --- a/app/src/main/java/cy/agorise/crystalwallet/cryptonetinforequests/ValidateCreateBitsharesAccountRequest.java +++ b/app/src/main/java/cy/agorise/crystalwallet/cryptonetinforequests/ValidateCreateBitsharesAccountRequest.java @@ -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(); } } diff --git a/app/src/main/java/cy/agorise/crystalwallet/manager/BitsharesAccountManager.java b/app/src/main/java/cy/agorise/crystalwallet/manager/BitsharesAccountManager.java index 76690c1..15babdb 100644 --- a/app/src/main/java/cy/agorise/crystalwallet/manager/BitsharesAccountManager.java +++ b/app/src/main/java/cy/agorise/crystalwallet/manager/BitsharesAccountManager.java @@ -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); }