24 lines
599 B
Python
24 lines
599 B
Python
import unittest
|
|
import binascii
|
|
|
|
import kasten
|
|
|
|
import onionrblocks
|
|
|
|
class TestVDFBlock(unittest.TestCase):
|
|
|
|
def test_vdf_create(self):
|
|
rounds = 10**4
|
|
data = b'test data'
|
|
k = onionrblocks.create_block_anonymous_vdf(rounds, data, **{'type': 'test', 'encrypt mode': 0})
|
|
raw = k.raw_bytes
|
|
id = int.from_bytes(k.dec_checksum, byteorder="big")
|
|
#print(id, raw)
|
|
print(id, raw)
|
|
kasten.generator.KastenMimcGenerator.validate_id(id, raw, rounds)
|
|
self.assertEqual(len(raw), 22)
|
|
|
|
def test_vdf_auto_validate_loader
|
|
|
|
|
|
unittest.main() |