def check_minimal_push(data, opcode)
      if data.bytesize == 0
        # Could have used OP_0.
        return opcode == OP_0
      elsif data.bytesize == 1 && data.bytes[0] >= 1 && data.bytes[0] <= 16
        # Could have used OP_1 .. OP_16.
        return opcode == OP_1 + (data.bytes[0] - 1)
      elsif data.bytesize == 1 && data.bytes[0] == 0x81
        # Could have used OP_1NEGATE.
        return opcode == OP_1NEGATE
      elsif data.bytesize <= 75
        # Could have used a direct push (opcode indicating number of bytes pushed + those bytes).
        return opcode == data.bytesize
      elsif data.bytesize <= 255
        # Could have used OP_PUSHDATA.
        return opcode == OP_PUSHDATA1
      elsif (data.bytesize <= 65535)
        # Could have used OP_PUSHDATA2.
        return opcode == OP_PUSHDATA2
      end
      return true
    end
def check_minimal_push(data, opcode)
      if data.bytesize == 0
        # Could have used OP_0.
        return opcode == OP_0
      elsif data.bytesize == 1 && data.bytes[0] >= 1 && data.bytes[0] <= 16
        # Could have used OP_1 .. OP_16.
        return opcode == OP_1 + (data.bytes[0] - 1)
      elsif data.bytesize == 1 && data.bytes[0] == 0x81
        # Could have used OP_1NEGATE.
        return opcode == OP_1NEGATE
      elsif data.bytesize <= 75
        # Could have used a direct push (opcode indicating number of bytes pushed + those bytes).
        return opcode == data.bytesize
      elsif data.bytesize <= 255
        # Could have used OP_PUSHDATA.
        return opcode == OP_PUSHDATA1
      elsif (data.bytesize <= 65535)
        # Could have used OP_PUSHDATA2.
        return opcode == OP_PUSHDATA2
      end
      return true
    end
aka CheckMinimalPush(const valtype& data, opcodetype opcode)