Skip to content

Commit

Permalink
Oct-2336: Processing of all pending multisigs fails when any is corru…
Browse files Browse the repository at this point in the history
…pted (#638)
  • Loading branch information
aziolek authored Jan 23, 2025
2 parents 355cebd + d5fd75e commit 332eb17
Showing 1 changed file with 26 additions and 14 deletions.
40 changes: 26 additions & 14 deletions backend/app/modules/facades/confirm_multisig.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import json

from flask import current_app as app

from app.modules.multisig_signatures.controller import (
apply_pending_tos_signature,
apply_pending_allocation_signature,
Expand All @@ -19,19 +21,29 @@ def confirm_multisig():
approvals = approve_pending_signatures()

for tos_signature in approvals.tos_signatures:
tos_controller.post_user_terms_of_service_consent(
tos_signature.user_address,
tos_signature.signature,
tos_signature.ip_address,
)
apply_pending_tos_signature(tos_signature.id)
# We don't want to fail the whole process if one TOS fails
try:
tos_controller.post_user_terms_of_service_consent(
tos_signature.user_address,
tos_signature.signature,
tos_signature.ip_address,
)
apply_pending_tos_signature(tos_signature.id)

except Exception as e:
app.logger.error(f"Error confirming TOS signature: {e}")

for allocation_signature in approvals.allocation_signatures:
message = json.loads(allocation_signature.message)
message["signature"] = allocation_signature.signature
allocations_controller.allocate(
allocation_signature.user_address,
message,
is_manually_edited=message.get("isManuallyEdited"),
)
apply_pending_allocation_signature(allocation_signature.id)
# We don't want to fail the whole process if one allocation fails
try:
message = json.loads(allocation_signature.message)
message["signature"] = allocation_signature.signature
allocations_controller.allocate(
allocation_signature.user_address,
message,
is_manually_edited=message.get("isManuallyEdited"),
)
apply_pending_allocation_signature(allocation_signature.id)

except Exception as e:
app.logger.error(f"Error confirming allocation signature: {e}")

0 comments on commit 332eb17

Please sign in to comment.