Yes Holmes did use cocaine but remember this was in Victorian England or a little later.
Also Dr. Watson keeps telling Sherlock that the Cocaine is bad for his health.
It was cocaine....a 7 percent solution. :-)
It also WAS still the Victorian ear...not quite Edwardian.