A WorkOrder is only as long as its PFrags.

pull/142/head
jMyles 2017-12-07 20:38:51 -08:00
parent 537a782100
commit 8c243ed399
1 changed files with 3 additions and 0 deletions

View File

@ -308,6 +308,9 @@ class WorkOrder(object):
def __eq__(self, other):
return (self.receipt_bytes, self.receipt_signature) == (other.receipt_bytes, other.receipt_signature)
def __len__(self):
return len(self.pfrags)
@classmethod
def constructed_by_bob(cls, kfrag_hrac, pfrags, ursula_dht_key, bob):
receipt_bytes = b"wo:" + ursula_dht_key # TODO: represent the pfrags as bytes and hash them as part of the receipt, ie + keccak_digest(b"".join(pfrags)) - See #137