-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
e2e(cch): pay btc invoice for ReceiveBTC order
- Loading branch information
Showing
8 changed files
with
121 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
meta { | ||
name: 10-pay-btc-invoice | ||
type: http | ||
seq: 10 | ||
} | ||
|
||
post { | ||
url: {{LND_BOB_RPC_URL}}/v2/router/send | ||
body: json | ||
auth: none | ||
} | ||
|
||
body:json { | ||
{ | ||
"payment_request": "{{BTC_PAY_REQ}}", | ||
"timeout_seconds": 1 | ||
} | ||
} | ||
|
||
assert { | ||
res.status: eq 409 | ||
} | ||
|
||
script:pre-request { | ||
const axios = require('axios'); | ||
|
||
const url = bru.getEnvVar("LND_BOB_RPC_URL") + "/v2/router/send"; | ||
const body = { | ||
payment_request: bru.getVar("BTC_PAY_REQ"), | ||
timeout_seconds: 1 | ||
}; | ||
console.log(url); | ||
console.log(body); | ||
|
||
await axios({ | ||
method: 'POST', | ||
url: url, | ||
data: body, | ||
responseType: 'stream' | ||
}); | ||
} | ||
|
||
docs { | ||
Send payment via lnd RPC https://lightning.engineering/api-docs/api/lnd/router/send-payment-v2. | ||
|
||
This is a server-streaming RPC which will block Bruno. The workaround is sending the request in the pre-script so the Bruno request will return 409 because the payment is already sent. | ||
} |