mirror of
https://github.com/aljazceru/nutshell.git
synced 2026-02-23 01:24:20 +01:00
Mint: blink fix fee estimation (#439)
* blink: fix fee esimation * fix line length * fix line length * fix line length * remove noqa
This commit is contained in:
@@ -49,7 +49,6 @@ async def test_blink_create_invoice():
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
respx.post(blink.endpoint).mock(return_value=Response(200, json=mock_response))
|
||||
invoice = await blink.create_invoice(Amount(Unit.sat, 1000))
|
||||
assert invoice.checking_id == invoice.payment_request
|
||||
@@ -129,9 +128,18 @@ async def test_blink_get_payment_status():
|
||||
@respx.mock
|
||||
@pytest.mark.asyncio
|
||||
async def test_blink_get_payment_quote():
|
||||
# response says 1 sat fees but invoice * 0.5% is 5 sat so we expect 5 sat
|
||||
mock_response = {"data": {"lnInvoiceFeeProbe": {"amount": 1}}}
|
||||
respx.post(blink.endpoint).mock(return_value=Response(200, json=mock_response))
|
||||
quote = await blink.get_payment_quote(payment_request)
|
||||
assert quote.checking_id == payment_request
|
||||
assert quote.amount == Amount(Unit.msat, 1000000) # msat
|
||||
assert quote.fee == Amount(Unit.msat, 5000) # msat
|
||||
|
||||
# response says 10 sat fees but invoice * 0.5% is 5 sat so we expect 10 sat
|
||||
mock_response = {"data": {"lnInvoiceFeeProbe": {"amount": 10}}}
|
||||
respx.post(blink.endpoint).mock(return_value=Response(200, json=mock_response))
|
||||
quote = await blink.get_payment_quote(payment_request)
|
||||
assert quote.checking_id == payment_request
|
||||
assert quote.amount == Amount(Unit.msat, 1000000) # msat
|
||||
assert quote.fee == Amount(Unit.msat, 500000) # msat
|
||||
assert quote.fee == Amount(Unit.msat, 10000) # msat
|
||||
|
||||
Reference in New Issue
Block a user