Skip to content

Commit

Permalink
FIX-OCT-1521: Dont apply allocation multisig messages outside AW
Browse files Browse the repository at this point in the history
  • Loading branch information
kgarbacinski authored Apr 3, 2024
1 parent 3cfe34a commit c572724
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions backend/app/modules/multisig_signatures/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from app.modules.dto import SignatureOpType
from app.modules.multisig_signatures.dto import Signature, ApprovedSignatureTypes
from app.modules.registry import get_services
from app.exceptions import InvalidEpoch


def get_last_pending_signature(
Expand Down Expand Up @@ -43,14 +44,22 @@ def apply_pending_allocation_signature(signature_id: int):


def _apply(op_type: SignatureOpType, signature_id):
context = _get_context(op_type)
try:
context = _get_context(op_type)
except InvalidEpoch:
return None

service = get_services(context.epoch_state).multisig_signatures_service

service.apply_staged_signatures(context, signature_id)


def _approve(op_type: SignatureOpType) -> list[Signature]:
context = _get_context(op_type)
try:
context = _get_context(op_type)
except InvalidEpoch:
return []

service = get_services(context.epoch_state).multisig_signatures_service

return service.approve_pending_signatures(context)
Expand Down

0 comments on commit c572724

Please sign in to comment.