diff --git a/nkms/policy/models.py b/nkms/policy/models.py index 7474386a8..980b322c9 100644 --- a/nkms/policy/models.py +++ b/nkms/policy/models.py @@ -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