Moving over to MessageKit.to_bytes.

pull/165/head
jMyles 2018-02-14 00:18:31 -08:00
parent 424a75b4ef
commit 31dfbaa3e9
2 changed files with 3 additions and 3 deletions

View File

@ -184,7 +184,7 @@ class Policy(object):
# In order to know this is safe to propagate, Ursula needs to see a signature, our public key,
# and, reasons explained in treasure_map_dht_key above, the uri_hash.
dht_value = signature_for_ursula + self.alice.seal + self.hrac() + bytes(tmap_message_kit)
dht_value = signature_for_ursula + self.alice.seal + self.hrac() + tmap_message_kit.to_bytes()
dht_key = self.treasure_map_dht_key()
setter = self.alice.server.set(dht_key, b"trmap" + dht_value)
@ -197,7 +197,7 @@ class Policy(object):
policy_message_kit = contract.encrypt_payload_for_ursula()
response = networky_stuff.enact_policy(contract.ursula,
self.hrac(),
bytes(policy_message_kit))
policy_message_kit.to_bytes())
# TODO: Parse response for confirmation.
response

View File

@ -132,7 +132,7 @@ def test_treasure_map_with_bad_id_does_not_propagate(idle_policy, ursulas):
message_kit, signature = alice.encrypt_for(bob, treasure_map.packed_payload())
setter = alice.server.set(illegal_policygroup_id, bytes(message_kit))
setter = alice.server.set(illegal_policygroup_id, message_kit.to_bytes())
_set_event = EVENT_LOOP.run_until_complete(setter)
with pytest.raises(KeyError):