Fixed error feedback on import request

This commit is contained in:
hvarona 2018-10-25 08:09:54 -04:00
parent e8ceb88c6e
commit c4ac6b4a29
2 changed files with 39 additions and 32 deletions

View file

@ -129,9 +129,14 @@ public abstract class GrapheneApiGenerator {
List<UserAccount> accounts = resp.get(0);
if(accounts.size() > 0){
for(UserAccount account : accounts) {
request.getListener().success(account,request.getId());}}}
request.getListener().success(account, request.getId());
break;
}
}
}else{
request.getListener().fail(request.getId());
}
}
@Override
public void onError(BaseResponse.Error error) {

View file

@ -276,10 +276,7 @@ public class BitsharesAccountManager implements CryptoAccountManager, CryptoNetI
@Override
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() {
@Override
public void success(Object answer, int idPetition) {
@ -306,14 +303,19 @@ public class BitsharesAccountManager implements CryptoAccountManager, CryptoNetI
@Override
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);
BIP39 bip39 = new BIP39(-1, importRequest.getMnemonic());
GrapheneApiGenerator.getAccountByOwnerOrActiveAddress(bk.getPublicAddress("BTS"),getAccountNamesBK);
GrapheneApiGenerator.getAccountByOwnerOrActiveAddress(new Address(ECKey.fromPublicOnly(bip39.getBitsharesActiveKey(0).getPubKey())),getAccountNamesBP39);
}