Fixed error feedback on import request
This commit is contained in:
parent
e8ceb88c6e
commit
c4ac6b4a29
2 changed files with 39 additions and 32 deletions
|
@ -129,9 +129,14 @@ public abstract class GrapheneApiGenerator {
|
||||||
List<UserAccount> accounts = resp.get(0);
|
List<UserAccount> accounts = resp.get(0);
|
||||||
if(accounts.size() > 0){
|
if(accounts.size() > 0){
|
||||||
for(UserAccount account : accounts) {
|
for(UserAccount account : accounts) {
|
||||||
request.getListener().success(account,request.getId());}}}
|
request.getListener().success(account, request.getId());
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}else{
|
||||||
request.getListener().fail(request.getId());
|
request.getListener().fail(request.getId());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onError(BaseResponse.Error error) {
|
public void onError(BaseResponse.Error error) {
|
||||||
|
|
|
@ -276,10 +276,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);
|
BIP39 bip39 = new BIP39(-1, importRequest.getMnemonic());
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
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) {
|
||||||
|
@ -306,14 +303,19 @@ 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);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
GrapheneApiGenerator.getAccountByOwnerOrActiveAddress(new Address(ECKey.fromPublicOnly(bip39.getBitsharesActiveKey(0).getPubKey())),getAccountNamesBP39);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
BrainKey bk = new BrainKey(importRequest.getMnemonic(), 0);
|
BrainKey bk = new BrainKey(importRequest.getMnemonic(), 0);
|
||||||
BIP39 bip39 = new BIP39(-1, importRequest.getMnemonic());
|
|
||||||
GrapheneApiGenerator.getAccountByOwnerOrActiveAddress(bk.getPublicAddress("BTS"),getAccountNamesBK);
|
GrapheneApiGenerator.getAccountByOwnerOrActiveAddress(bk.getPublicAddress("BTS"),getAccountNamesBK);
|
||||||
GrapheneApiGenerator.getAccountByOwnerOrActiveAddress(new Address(ECKey.fromPublicOnly(bip39.getBitsharesActiveKey(0).getPubKey())),getAccountNamesBP39);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue