File tree Expand file tree Collapse file tree 2 files changed +18
-1
lines changed
abstract-lightning/src/wallet
bitgo/test/v2/unit/lightning Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ export type PayInvoiceResponse = {
3333 pendingApproval ?: PendingApprovalData ;
3434 // Absent if there's a pending approval
3535 paymentStatus ?: LndCreatePaymentResponse ;
36+ transfer ?: any ;
3637} ;
3738
3839/**
@@ -254,13 +255,17 @@ export class LightningWallet implements ILightningWallet {
254255 ) ;
255256
256257 const coinSpecific = transactionRequestSend . transactions ?. [ 0 ] ?. unsignedTx ?. coinSpecific ;
257-
258+ let transfer ;
259+ if ( coinSpecific && coinSpecific . paymentHash && typeof coinSpecific . paymentHash === 'string' ) {
260+ transfer = await this . wallet . getTransfer ( { id : coinSpecific . paymentHash } ) ;
261+ }
258262 return {
259263 txRequestId : transactionRequestCreate . txRequestId ,
260264 txRequestState : transactionRequestSend . state ,
261265 paymentStatus : coinSpecific
262266 ? t . exact ( LndCreatePaymentResponse ) . encode ( coinSpecific as LndCreatePaymentResponse )
263267 : undefined ,
268+ transfer,
264269 } ;
265270 }
266271
Original file line number Diff line number Diff line change @@ -358,6 +358,17 @@ describe('Lightning wallets', function () {
358358 ] ,
359359 } ;
360360
361+ const transferData = {
362+ id : 'fake_id' ,
363+ coin : 'tlnbtc' ,
364+ state : 'confirmed' ,
365+ txid : lndResponse . paymentHash ,
366+ } ;
367+
368+ const getTransferNock = nock ( bgUrl )
369+ . get ( `/api/v2/${ coinName } /wallet/${ wallet . wallet . id ( ) } /transfer/${ lndResponse . paymentHash } ` )
370+ . reply ( 200 , transferData ) ;
371+
361372 const createTxRequestNock = nock ( bgUrl )
362373 . post ( `/api/v2/wallet/${ wallet . wallet . id ( ) } /txrequests` )
363374 . reply ( 200 , txRequestResponse ) ;
@@ -398,6 +409,7 @@ describe('Lightning wallets', function () {
398409 finalPaymentResponse . transactions [ 0 ] . unsignedTx . coinSpecific . paymentPreimage
399410 ) ;
400411
412+ getTransferNock . done ( ) ;
401413 createTxRequestNock . done ( ) ;
402414 sendTxRequestNock . done ( ) ;
403415 userAuthKeyNock . done ( ) ;
You can’t perform that action at this time.
0 commit comments