2020-12-06 09:19:39 +00:00
|
|
|
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)
|
2020-12-06 09:19:39 +00:00
|
|
|
|
|
|
|
|
|
|
|
unittest.main()
|