def test_block_is_not_genesis(): genesis_block = SignedBeaconBlock.create().transform( ("message", "parent_root"), GENESIS_PARENT_ROOT) another_block = SignedBeaconBlock.from_parent(genesis_block, FromBlockParams()) assert genesis_block.is_genesis assert not another_block.is_genesis
def get_pseudo_chain(length, genesis_block): """ Get a pseudo chain, only slot and parent_root are valid. """ block = genesis_block yield genesis_block for slot in range(1, length * 3): block = SignedBeaconBlock.from_parent(block, FromBlockParams(slot=slot)) yield block