I am using the following function in my pallet to convert a string into a public key
fn split_publickey_from_input(input: &Vec<u8>) -> T::Public {
let input_string = sp_std::str::from_utf8(input).unwrap();
let input_vec: Vec<&str> = input_string.split(":").collect();
let pub_key = sp_core::sr25519::Public::from_str(input_vec[2]).unwrap();
T::Public::from(pub_key)
}
Unfortunately this works well in the pallet but when i try to build the node with cargo build --release
i face this error below
let pub_key = sp_core::sr25519::Public::from_str(did_vec[2]).unwrap();
| ^^^^^^^^ function or associated item not found in `Public`
How can i resolve this error? An explanation of what's going wrong is highly appreciated