publish() for Federated logic.

pull/318/head
jMyles 2018-06-22 18:09:11 -07:00
parent f5f6ef00f6
commit 1d42a797b6
2 changed files with 13 additions and 1 deletions

View File

@ -198,3 +198,15 @@ class BlockchainPolicy(Policy):
if len(accepted) < self.n:
raise Exception("Selected Ursulas rejected too many arrangements") # TODO: Better exception
def publish(self, network_middleware) -> None:
"""Publish enacted arrangements."""
if not self._enacted_arrangements:
raise RuntimeError("There are no enacted arrangements to publish to the network.")
while len(self._enacted_arrangements) > 0:
kfrag, arrangement = self._enacted_arrangements.popitem()
arrangement.publish()
super().publish(network_middleware)

View File

@ -9,4 +9,4 @@ KECCAK_DIGEST_LENGTH = 32
# These lengths are specific to secp256k1
CAPSULE_LENGTH(98)
PUBLIC_KEY_LENGTH(33)
PUBLIC_ADDRESS_LENGTH(42)
PUBLIC_ADDRESS_LENGTH(20)