From what you have said, the police will forensically examine your phone and read the messages.
Then they will most likely reinterview you when you answer bail.
Although your friend may have chipped in with the money, if you then went and made the purchase and was then going to give his some cocaine to use, them legally that is still supplying. It is an illegal substance and he did not give you Money to go and buy a packet of biscuits to share form the corner shop.
You could be charged with possession with intent to supply class A drugs.
But, depending on the content of the messages and you co operation the CPS are more likely to charge straight forward possession.
If the worst happened for such a small amount and they decided to charge supply, then I would advice pleading not guilty and elect trail at Crown Court.
A trial with the back log of cases is likely to be somewhere between 12-18 months to get to trial as things currently stand, and a senior prosecutor will review the file and if they see you are will ing to plead to possession it is very likely the supply will be dropped.