onionrblocks/tests/test_vdf_block.py

21 lines
512 B
Python
Raw Normal View History

import unittest
import binascii
import kasten
import onionrblocks
class TestVDFBlock(unittest.TestCase):
def test_basic(self):
rounds = 10**4
2020-12-07 01:58:09 +00:00
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.hex_checksum, byteorder="big")
#print(id, raw)
print(raw)
kasten.generator.KastenMimcGenerator.validate_id(id, raw, rounds)
unittest.main()