def make_sized_handler(size, const_values, non_minimal_data_handler):
    """
    Create a handler for a data opcode that returns literal data of a fixed size.
    """
    const_values = list(const_values)

    def constant_size_opcode_handler(script, pc, verify_minimal_data=False):
        pc += 1
        data = bytes_as_hex(script[pc:pc+size])
        if len(data) < size:
            return pc+1, None
        if verify_minimal_data and data in const_values:
            non_minimal_data_handler("not minimal push of %s" % repr(data))
        return pc+size, data
    return constant_size_opcode_handler
def make_sized_handler ( size , const_values , non_minimal_data_handler ) : const_values = list ( const_values ) def constant_size_opcode_handler ( script , pc , verify_minimal_data = False ) : pc += 1 data = bytes_as_hex ( script [ pc : pc + size ] ) if len ( data ) < size : return pc + 1 , None if verify_minimal_data and data in const_values : non_minimal_data_handler ( "not minimal push of %s" % repr ( data ) ) return pc + size , data return constant_size_opcode_handler
Create a handler for a data opcode that returns literal data of a fixed size.