Verify testCreateInvoice returns a payment request (#2063)
* Verify testCreateInvoice returns a payment request * Use GqlInputError
This commit is contained in:
parent
b617ac0a56
commit
78f7e006d5
@ -854,7 +854,10 @@ async function upsertWallet (
|
||||
|
||||
if (testCreateInvoice) {
|
||||
try {
|
||||
await testCreateInvoice(data)
|
||||
const pr = await testCreateInvoice(data)
|
||||
if (!pr || typeof pr !== 'string' || !pr.startsWith('lnbc')) {
|
||||
throw new GqlInputError('not a valid payment request')
|
||||
}
|
||||
} catch (err) {
|
||||
const message = 'failed to create test invoice: ' + (err.message || err.toString?.())
|
||||
logger.error(message)
|
||||
|
Loading…
x
Reference in New Issue
Block a user