From 5e834c63306bc1018d3450c9e5e6c09c54bdcbf2 Mon Sep 17 00:00:00 2001 From: Kieran Prasch Date: Fri, 26 Jan 2024 03:13:03 +0100 Subject: [PATCH] exposes new coordinator views for getParticipantProviders and isProviderParticipating --- nucypher/blockchain/eth/agents.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/nucypher/blockchain/eth/agents.py b/nucypher/blockchain/eth/agents.py index b910e9430..d64e4b2ca 100644 --- a/nucypher/blockchain/eth/agents.py +++ b/nucypher/blockchain/eth/agents.py @@ -797,6 +797,11 @@ class CoordinatorAgent(EthereumContractAgent): participants.append(participant) return participants + @contract_api(CONTRACT_CALL) + def get_participant_providers(self, ritual_id: int) -> List[ChecksumAddress]: + result = self.contract.functions.getParticipantProviders(ritual_id).call() + return result + @contract_api(CONTRACT_CALL) def get_provider_public_key( self, provider: ChecksumAddress, ritual_id: int @@ -827,6 +832,15 @@ class CoordinatorAgent(EthereumContractAgent): ) return participant + @contract_api(CONTRACT_CALL) + def is_provider_participating( + self, ritual_id: int, provider: ChecksumAddress + ) -> bool: + result = self.contract.functions.isProviderParticipating( + ritual_id, provider + ).call() + return result + @contract_api(CONTRACT_CALL) def is_encryption_authorized( self, ritual_id: int, evidence: bytes, ciphertext_header: bytes