Skip to content

Commit

Permalink
fix(connext): set default lookupPayment status as pending (#1603)
Browse files Browse the repository at this point in the history
* fix(connext): set default lookupPayment status as pending
  • Loading branch information
Karl Ranna authored Jun 5, 2020
1 parent ebb715e commit 141bcc5
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/connextclient/ConnextClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,8 @@ class ConnextClient extends SwapClient {
try {
const assetId = this.getTokenAddress(currency);
const transferStatusResponse = await this.getHashLockStatus(rHash, assetId);
// TODO: Edge case. Once https://github.com/connext/rest-api-client/issues/31 is
// implemented check for the response code 404 and set the payment as failed.

switch (transferStatusResponse.status) {
case 'PENDING':
Expand All @@ -414,10 +416,11 @@ class ConnextClient extends SwapClient {
case 'FAILED':
return { state: PaymentState.Failed };
default:
return { state: PaymentState.Failed };
return { state: PaymentState.Pending };
}
} catch (e) {
throw errors.PAYMENT_NOT_FOUND;
this.logger.error(e);
throw errors.SERVER_ERROR;
}
}

Expand Down

0 comments on commit 141bcc5

Please sign in to comment.