mirror of
https://github.com/lightninglabs/loop.git
synced 2026-08-13 12:33:03 +02:00
looprpc: update to new server protos
We update to new set of server protos where new Terms calls are added. Here static information will be returned from the server. We no longer have a feebase+feerate, but get a final fee directly returned by the server.
This commit is contained in:
parent
0cff92d265
commit
0023d1a0da
8 changed files with 470 additions and 139 deletions
|
|
@ -21,8 +21,7 @@ var (
|
|||
testLoopOutOnChainCltvDelta = int32(30)
|
||||
testChargeOnChainCltvDelta = int32(100)
|
||||
testCltvDelta = 50
|
||||
testSwapFeeBase = btcutil.Amount(21)
|
||||
testSwapFeeRate = int64(100)
|
||||
testSwapFee = btcutil.Amount(210)
|
||||
testInvoiceExpiry = 180 * time.Second
|
||||
testFixedPrepayAmount = btcutil.Amount(100)
|
||||
testMinSwapAmount = btcutil.Amount(10000)
|
||||
|
|
@ -45,6 +44,8 @@ type serverMock struct {
|
|||
swapHash lntypes.Hash
|
||||
}
|
||||
|
||||
var _ swapServerClient = (*serverMock)(nil)
|
||||
|
||||
func newServerMock() *serverMock {
|
||||
return &serverMock{
|
||||
expectedSwapAmt: 50000,
|
||||
|
|
@ -94,16 +95,22 @@ func (s *serverMock) NewLoopOutSwap(ctx context.Context,
|
|||
func (s *serverMock) GetLoopOutTerms(ctx context.Context) (
|
||||
*LoopOutTerms, error) {
|
||||
|
||||
return &LoopOutTerms{
|
||||
MinSwapAmount: testMinSwapAmount,
|
||||
MaxSwapAmount: testMaxSwapAmount,
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (s *serverMock) GetLoopOutQuote(ctx context.Context, amt btcutil.Amount) (
|
||||
*LoopOutQuote, error) {
|
||||
|
||||
dest := [33]byte{1, 2, 3}
|
||||
|
||||
return &LoopOutTerms{
|
||||
SwapFeeBase: testSwapFeeBase,
|
||||
SwapFeeRate: testSwapFeeRate,
|
||||
return &LoopOutQuote{
|
||||
SwapFee: testSwapFee,
|
||||
SwapPaymentDest: dest,
|
||||
CltvDelta: testLoopOutOnChainCltvDelta,
|
||||
MinSwapAmount: testMinSwapAmount,
|
||||
MaxSwapAmount: testMaxSwapAmount,
|
||||
PrepayAmt: testFixedPrepayAmount,
|
||||
PrepayAmount: testFixedPrepayAmount,
|
||||
}, nil
|
||||
}
|
||||
|
||||
|
|
@ -154,10 +161,16 @@ func (s *serverMock) GetLoopInTerms(ctx context.Context) (
|
|||
*LoopInTerms, error) {
|
||||
|
||||
return &LoopInTerms{
|
||||
SwapFeeBase: testSwapFeeBase,
|
||||
SwapFeeRate: testSwapFeeRate,
|
||||
CltvDelta: testChargeOnChainCltvDelta,
|
||||
MinSwapAmount: testMinSwapAmount,
|
||||
MaxSwapAmount: testMaxSwapAmount,
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (s *serverMock) GetLoopInQuote(ctx context.Context, amt btcutil.Amount) (
|
||||
*LoopInQuote, error) {
|
||||
|
||||
return &LoopInQuote{
|
||||
SwapFee: testSwapFee,
|
||||
CltvDelta: testChargeOnChainCltvDelta,
|
||||
}, nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue