mirror of
https://github.com/lightninglabs/loop.git
synced 2026-08-13 12:33:03 +02:00
loop: add cancel swap to server interface
This commit is contained in:
parent
71501ef2e8
commit
969e300241
2 changed files with 115 additions and 0 deletions
|
|
@ -43,6 +43,9 @@ type serverMock struct {
|
|||
// preimagePush is a channel that preimage pushes are sent into.
|
||||
preimagePush chan lntypes.Preimage
|
||||
|
||||
// cancelSwap is a channel that swap cancelations are sent into.
|
||||
cancelSwap chan *outCancelDetails
|
||||
|
||||
lnd *test.LndMockServices
|
||||
}
|
||||
|
||||
|
|
@ -59,6 +62,7 @@ func newServerMock(lnd *test.LndMockServices) *serverMock {
|
|||
height: 600,
|
||||
|
||||
preimagePush: make(chan lntypes.Preimage),
|
||||
cancelSwap: make(chan *outCancelDetails),
|
||||
|
||||
lnd: lnd,
|
||||
}
|
||||
|
|
@ -178,6 +182,14 @@ func (s *serverMock) PushLoopOutPreimage(_ context.Context,
|
|||
return nil
|
||||
}
|
||||
|
||||
// CancelLoopOutSwap pushes a request to cancel a swap into our mock's channel.
|
||||
func (s *serverMock) CancelLoopOutSwap(ctx context.Context,
|
||||
details *outCancelDetails) error {
|
||||
|
||||
s.cancelSwap <- details
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s *serverMock) GetLoopInTerms(ctx context.Context) (
|
||||
*LoopInTerms, error) {
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue