mirror of
https://github.com/RoboSats/robosats.git
synced 2025-01-31 02:21:35 +00:00
Small fixes missing finalization time and unit trade_satoshis response
This commit is contained in:
parent
192dcedbc4
commit
b4072b95da
@ -1720,6 +1720,9 @@ class Logics:
|
|||||||
)
|
)
|
||||||
if order.last_satoshis_time is not None:
|
if order.last_satoshis_time is not None:
|
||||||
platform_summary["contract_timestamp"] = order.last_satoshis_time
|
platform_summary["contract_timestamp"] = order.last_satoshis_time
|
||||||
|
if order.contract_finalization_time is None:
|
||||||
|
order.contract_finalization_time = timezone.now()
|
||||||
|
order.save()
|
||||||
platform_summary["contract_total_time"] = (
|
platform_summary["contract_total_time"] = (
|
||||||
order.contract_finalization_time - order.last_satoshis_time
|
order.contract_finalization_time - order.last_satoshis_time
|
||||||
)
|
)
|
||||||
|
@ -441,9 +441,14 @@ class OrderView(viewsets.ViewSet):
|
|||||||
if order.payout.status == LNPayment.Status.EXPIRE:
|
if order.payout.status == LNPayment.Status.EXPIRE:
|
||||||
data["invoice_expired"] = True
|
data["invoice_expired"] = True
|
||||||
# Add invoice amount once again if invoice was expired.
|
# Add invoice amount once again if invoice was expired.
|
||||||
|
# Start deprecate after v0.3.1
|
||||||
data["invoice_amount"] = Logics.payout_amount(order, request.user)[1][
|
data["invoice_amount"] = Logics.payout_amount(order, request.user)[1][
|
||||||
"invoice_amount"
|
"invoice_amount"
|
||||||
]
|
]
|
||||||
|
# End deprecate
|
||||||
|
data["trade_satoshis"] = Logics.payout_amount(order, request.user)[1][
|
||||||
|
"invoice_amount"
|
||||||
|
]
|
||||||
|
|
||||||
# 10) If status is 'Expired', "Sending", "Finished" or "failed routing", add info for renewal:
|
# 10) If status is 'Expired', "Sending", "Finished" or "failed routing", add info for renewal:
|
||||||
elif order.status in [
|
elif order.status in [
|
||||||
|
Loading…
Reference in New Issue
Block a user