mirror of https://github.com/nucypher/nucypher.git
Make updates based on latest Coordinator contract changes.
parent
14305350fc
commit
d3bab657f3
|
@ -560,7 +560,7 @@ class CoordinatorAgent(EthereumContractAgent):
|
|||
provider: ChecksumAddress
|
||||
aggregated: bool = False
|
||||
transcript: bytes = bytes()
|
||||
requestEncryptingKey: bytes = bytes()
|
||||
decryption_request_static_key: bytes = bytes()
|
||||
|
||||
class G1Point(NamedTuple):
|
||||
"""Coordinator contract representation of DkgPublicKey."""
|
||||
|
@ -621,7 +621,7 @@ class CoordinatorAgent(EthereumContractAgent):
|
|||
participant_public_keys = {}
|
||||
for p in self.participants:
|
||||
participant_public_keys[p.provider] = RequestPublicKey.from_bytes(
|
||||
p.requestEncryptingKey
|
||||
p.decryption_request_static_key
|
||||
)
|
||||
|
||||
return participant_public_keys
|
||||
|
@ -667,7 +667,7 @@ class CoordinatorAgent(EthereumContractAgent):
|
|||
provider=ChecksumAddress(r[0]),
|
||||
aggregated=r[1],
|
||||
transcript=bytes(r[2]),
|
||||
requestEncryptingKey=bytes(r[3]),
|
||||
decryption_request_static_key=bytes(r[3]),
|
||||
)
|
||||
participants.append(participant)
|
||||
return participants
|
||||
|
@ -688,7 +688,7 @@ class CoordinatorAgent(EthereumContractAgent):
|
|||
provider=ChecksumAddress(result[0]),
|
||||
aggregated=result[1],
|
||||
transcript=bytes(result[2]),
|
||||
requestEncryptingKey=bytes(result[3]),
|
||||
decryption_request_static_key=bytes(result[3]),
|
||||
)
|
||||
return participant
|
||||
|
||||
|
@ -731,7 +731,7 @@ class CoordinatorAgent(EthereumContractAgent):
|
|||
ritualId=ritual_id,
|
||||
aggregatedTranscript=bytes(aggregated_transcript),
|
||||
publicKey=self.Ritual.G1Point.from_dkg_public_key(public_key),
|
||||
requestEncryptingKey=bytes(participant_public_key),
|
||||
decryptionRequestStaticKey=bytes(participant_public_key),
|
||||
)
|
||||
receipt = self.blockchain.send_transaction(
|
||||
contract_function=contract_function,
|
||||
|
|
|
@ -151,7 +151,9 @@ def test_post_aggregation(
|
|||
participants = agent.get_participants(ritual_id)
|
||||
for p in participants:
|
||||
assert p.aggregated
|
||||
assert p.requestEncryptingKey == bytes(participant_public_keys[p.provider])
|
||||
assert p.decryption_request_static_key == bytes(
|
||||
participant_public_keys[p.provider]
|
||||
)
|
||||
|
||||
ritual = agent.get_ritual(ritual_id)
|
||||
assert ritual.participant_public_keys == participant_public_keys
|
||||
|
|
|
@ -4,9 +4,10 @@ plugins:
|
|||
- name: solidity
|
||||
|
||||
dependencies:
|
||||
# TODO change back to nucypher/nucypher-contracts once https://github.com/nucypher/nucypher-contracts/pull/84 is merged
|
||||
- name: nucypher-contracts
|
||||
github: nucypher/nucypher-contracts
|
||||
ref: main
|
||||
github: derekpierre/nucypher-contracts
|
||||
ref: 25519
|
||||
- name: openzeppelin
|
||||
github: OpenZeppelin/openzeppelin-contracts
|
||||
version: 4.8.1
|
||||
|
|
|
@ -124,7 +124,7 @@ class MockCoordinatorAgent(MockContractAgent):
|
|||
)
|
||||
participant = self.get_participant_from_provider(ritual_id, provider)
|
||||
participant.aggregated = True
|
||||
participant.requestEncryptingKey = bytes(participant_public_key)
|
||||
participant.decryption_request_static_key = bytes(participant_public_key)
|
||||
|
||||
g1_point = self.Ritual.G1Point.from_dkg_public_key(public_key)
|
||||
if len(ritual.aggregated_transcript) == 0:
|
||||
|
|
|
@ -128,7 +128,7 @@ def test_mock_coordinator_round_2(
|
|||
# unchanged
|
||||
assert p.transcript == bytes(random_transcript)
|
||||
assert p.transcript != bytes(aggregated_transcript)
|
||||
assert p.requestEncryptingKey == bytes(participant_public_keys[index])
|
||||
assert p.decryption_request_static_key == bytes(participant_public_keys[index])
|
||||
|
||||
assert len(coordinator.EVENTS) == 2 # no additional event emitted here?
|
||||
assert (
|
||||
|
|
Loading…
Reference in New Issue