mirror of
https://github.com/lightninglabs/loop.git
synced 2026-08-13 12:33:03 +02:00
swap_server_client: call server with SwapPublicationDeadline set
This commit is contained in:
parent
b2d1d99521
commit
d5c9a66c60
3 changed files with 11 additions and 6 deletions
|
|
@ -369,7 +369,9 @@ func (s *Client) LoopOutQuote(ctx context.Context,
|
|||
return nil, ErrSwapAmountTooHigh
|
||||
}
|
||||
|
||||
quote, err := s.Server.GetLoopOutQuote(ctx, request.Amount)
|
||||
quote, err := s.Server.GetLoopOutQuote(
|
||||
ctx, request.Amount, request.SwapPublicationDeadline,
|
||||
)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
|
|||
|
|
@ -94,8 +94,8 @@ func (s *serverMock) GetLoopOutTerms(ctx context.Context) (
|
|||
}, nil
|
||||
}
|
||||
|
||||
func (s *serverMock) GetLoopOutQuote(ctx context.Context, amt btcutil.Amount) (
|
||||
*LoopOutQuote, error) {
|
||||
func (s *serverMock) GetLoopOutQuote(ctx context.Context, amt btcutil.Amount,
|
||||
_ time.Time) (*LoopOutQuote, error) {
|
||||
|
||||
dest := [33]byte{1, 2, 3}
|
||||
|
||||
|
|
|
|||
|
|
@ -22,7 +22,8 @@ type swapServerClient interface {
|
|||
GetLoopOutTerms(ctx context.Context) (
|
||||
*LoopOutTerms, error)
|
||||
|
||||
GetLoopOutQuote(ctx context.Context, amt btcutil.Amount) (
|
||||
GetLoopOutQuote(ctx context.Context, amt btcutil.Amount,
|
||||
swapPublicationDeadline time.Time) (
|
||||
*LoopOutQuote, error)
|
||||
|
||||
GetLoopInTerms(ctx context.Context) (
|
||||
|
|
@ -93,13 +94,15 @@ func (s *grpcSwapServerClient) GetLoopOutTerms(ctx context.Context) (
|
|||
}
|
||||
|
||||
func (s *grpcSwapServerClient) GetLoopOutQuote(ctx context.Context,
|
||||
amt btcutil.Amount) (*LoopOutQuote, error) {
|
||||
amt btcutil.Amount, swapPublicationDeadline time.Time) (
|
||||
*LoopOutQuote, error) {
|
||||
|
||||
rpcCtx, rpcCancel := context.WithTimeout(ctx, globalCallTimeout)
|
||||
defer rpcCancel()
|
||||
quoteResp, err := s.server.LoopOutQuote(rpcCtx,
|
||||
&looprpc.ServerLoopOutQuoteRequest{
|
||||
Amt: uint64(amt),
|
||||
Amt: uint64(amt),
|
||||
SwapPublicationDeadline: swapPublicationDeadline.Unix(),
|
||||
},
|
||||
)
|
||||
if err != nil {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue