mirror of https://github.com/nucypher/nucypher.git
Check whether ritual is active or expired before attempting to get ritual public key.
parent
7e6bafeeb1
commit
fb6a3ae800
|
@ -931,7 +931,8 @@ class CoordinatorAgent(EthereumContractAgent):
|
|||
return result
|
||||
|
||||
def get_ritual_public_key(self, ritual_id: int) -> DkgPublicKey:
|
||||
if self.get_ritual_status(ritual_id=ritual_id) != self.Ritual.Status.ACTIVE:
|
||||
status = self.get_ritual_status(ritual_id=ritual_id)
|
||||
if status != self.Ritual.Status.ACTIVE and status != self.Ritual.Status.EXPIRED:
|
||||
# TODO should we raise here instead?
|
||||
return None
|
||||
|
||||
|
|
|
@ -260,7 +260,8 @@ class MockCoordinatorAgent(MockContractAgent):
|
|||
)
|
||||
|
||||
def get_ritual_public_key(self, ritual_id: int) -> DkgPublicKey:
|
||||
if self.get_ritual_status(ritual_id=ritual_id) != self.RitualStatus.ACTIVE:
|
||||
status = self.get_ritual_status(ritual_id=ritual_id)
|
||||
if status != self.Ritual.Status.ACTIVE and status != self.Ritual.Status.EXPIRED:
|
||||
# TODO should we raise here instead?
|
||||
return None
|
||||
|
||||
|
|
Loading…
Reference in New Issue