19 lines
626 B
Python
19 lines
626 B
Python
from typing import Union
|
|
|
|
from kasten.types import KastenPacked
|
|
from kasten import Kasten
|
|
from kasten.generator import KastenMimcGenerator
|
|
|
|
from .types import DecChecksum, DecChecksumStr, HexChecksum
|
|
|
|
|
|
def load_anonymous_vdf_block(
|
|
expected_id: Union[DecChecksum, DecChecksumStr, HexChecksum],
|
|
raw_block: KastenPacked,
|
|
rounds: 'MimcRoundsInt') -> Kasten:
|
|
"""Load a block created with the KastenMimcGenerator
|
|
|
|
take expected checksum, bytes and rounds
|
|
|
|
Throws kasten.generator.InvalidID if data does not match raw bytes"""
|
|
return Kasten(expected_id, raw_block, KastenMimcGenerator, *[rounds]) |