Thank you for choosing DoctorSpring.
Well, that indeed was a stupid thing to do ! Cocaine can interact with the anaesthetics and may cause adverse effects. So in case of non emergency elective surgeries it is safe to wait till the drug is off your body.
Typically it is 72 hours after the last use (cut off varies in certain institutions or when there is negative cocaine screening test.
So your best option would be to declare this information to your Anaesthetist / Surgeon and let them decide whether the Surgery need to be postponed or not.
If you choose not to disclose, most likely you should be safe, but there is a small but sizeable risk.
Hope this helps
Feel free to ask followups