Skip to content

Commit

Permalink
feature: use new alloc in websockets
Browse files Browse the repository at this point in the history
  • Loading branch information
pik694 committed Mar 27, 2024
1 parent 6c617af commit b8abb30
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions backend/app/infrastructure/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,9 @@
from app.modules.dto import ProposalDonationDTO
from app.modules.user.allocations import controller

from app.legacy.controllers.allocations import allocate
from app.legacy.controllers.rewards import (
get_allocation_threshold,
)
from app.legacy.core.allocations import AllocationRequest
from app.modules.project_rewards.controller import get_estimated_project_rewards


Expand All @@ -39,12 +37,11 @@ def handle_disconnect():
@socketio.on("allocate")
def handle_allocate(msg):
msg = json.loads(msg)
payload, signature = msg["payload"], msg["signature"]
is_manually_edited = msg["isManuallyEdited"] if "isManuallyEdited" in msg else None
app.logger.info(f"User allocation payload: {payload}, signature: {signature}")
user_address = allocate(
AllocationRequest(payload, signature, override_existing_allocations=True),
is_manually_edited,
app.logger.info(f"User allocation payload: {msg}")
user_address = controller.allocate(
msg,
is_manually_edited=is_manually_edited,
)
app.logger.info(f"User: {user_address} allocated successfully")

Expand Down

0 comments on commit b8abb30

Please sign in to comment.