Revert "tweak: fix for ws payment" (#3060)
This commit is contained in:
parent
eb09e95e88
commit
f7e984198b
1 changed files with 7 additions and 3 deletions
|
|
@ -245,12 +245,16 @@ async def send_payment_notification(wallet: Wallet, payment: Payment):
|
||||||
|
|
||||||
|
|
||||||
async def send_ws_payment_notification(wallet: Wallet, payment: Payment):
|
async def send_ws_payment_notification(wallet: Wallet, payment: Payment):
|
||||||
payment_data = json.loads(payment.json())
|
# TODO: websocket message should be a clean payment model
|
||||||
payment_data.pop("wallet_id", None)
|
# await websocket_manager.send_data(payment.json(), wallet.inkey)
|
||||||
|
# TODO: figure out why we send the balance with the payment here.
|
||||||
|
# cleaner would be to have a separate message for the balance
|
||||||
|
# and send it with the id of the wallet so wallets can subscribe to it
|
||||||
payment_notification = json.dumps(
|
payment_notification = json.dumps(
|
||||||
{
|
{
|
||||||
"wallet_balance": wallet.balance,
|
"wallet_balance": wallet.balance,
|
||||||
"payment": payment_data,
|
# use pydantic json serialization to get the correct datetime format
|
||||||
|
"payment": json.loads(payment.json()),
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
await websocket_manager.send_data(payment_notification, wallet.inkey)
|
await websocket_manager.send_data(payment_notification, wallet.inkey)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue