Skip to content

Commit

Permalink
Merge pull request #4251 from BitGo/CS-2592-add-check-for-pa-info-in-…
Browse files Browse the repository at this point in the history
…post-approve

fix(sdk-core): add check to validate if PA triggered another condition
  • Loading branch information
alebusse authored Feb 1, 2024
2 parents 8e01eed + 0d773ec commit 5e0158b
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,14 @@ export class PendingApproval implements IPendingApproval {
// if the transaction already has a half signed property, we take that directly
approvalParams.halfSigned = transaction.halfSigned || transaction;
}
this._pendingApproval = await this.bitgo.put(this.url()).send(approvalParams).result();
const response = await this.bitgo.put(this.url()).send(approvalParams).result();

// if the response comes with an error, means that the transaction triggered another condition
if (response.hasOwnProperty('error') && response.hasOwnProperty('pendingApproval')) {
return response;
}

this._pendingApproval = response;
await this.postApprove(params, reqId);

return this._pendingApproval;
Expand Down

0 comments on commit 5e0158b

Please sign in to comment.