from typing import List


def parse_blocks(lines: List) -> List:
    """
    Parse list of blocks into singular data structure

    Args:
        lines (List): list of cleaned lines
    
    Returns:
        List of dictionaries, each dictionary a layer in the darknet
    """
    blocks = []
    block = {}

    for line in lines:
        if line[0] == "[":
            if len(block):
                blocks.append(block)
                block = {}
            block['arch'] = line[1:-1].rstrip()
        else:
            k,v = line.split("=")
            block[k.rstrip()] = v.lstrip()
    blocks.append(block)
    return blocks