def retrieveProof(self, records: List[Record], network: Network = None, date: float = None) -> Proof:
     if not records:
         return None
     for m in records:
         if not Record.isValid(m):
             raise InvalidRecordException(m.getHash())
     return self.__proof_repository.retrieveProof(records, network, date)
Esempio n. 2
0
 def test_is_valid_not_record_instance(self):
     self.assertFalse(Record.isValid('test Record'), 'Record is not valid')
Esempio n. 3
0
 def test_is_valid_wrong_char(self):
     self.assertFalse(
         Record.isValid(
             Record(
                 'G010101010101010101010101010101010101010101010101010101010101010'
             )), 'Record is not valid')
Esempio n. 4
0
 def test_is_valid_okay(self):
     self.assertTrue(
         Record.isValid(
             Record(
                 '1010101010101010101010101010101010101010101010101010101010101010'
             )), 'Record is not valid')