In situ electrochemistry