Skip to content

Commit

Permalink
fix: extract hash from decoded invoice
Browse files Browse the repository at this point in the history
  • Loading branch information
DhananjayPurohit committed Aug 16, 2024
1 parent bf5fb19 commit 7bd763f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions clients/libs/web/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,9 @@ const verifyInvoice = async (clientConfig, batchId, paymentRequest) => {

const decodedInvoice = await decodeInvoice(paymentRequest);
let paymentHash = await getPaymentHash(clientConfig, batchId);
console.log("Decoded Invoice: ", decodedInvoice);

return paymentHash === decodedInvoice.tagsObject.payment_hash;

const paymentHashFromInvoice = invoiceData.tags.find(tag => tag.tagName === "payment_hash")?.data;

Check failure on line 136 in clients/libs/web/main.js

View workflow job for this annotation

GitHub Actions / test

test/tb04-simple-lightning-latch.test.js > Coin receiver creates a non hold invoice, and sends to sender (i.e. an invoice with the a different payment hash). Sender should be able to determine this. > expected flow

ReferenceError: invoiceData is not defined ❯ Object.verifyInvoice ../../libs/web/main.js:136:34 ❯ test/tb04-simple-lightning-latch.test.js:702:32
return paymentHash === paymentHashFromInvoice;
}

export default {
Expand Down

0 comments on commit 7bd763f

Please sign in to comment.