Skip to main content
deleted 14 characters in body
Source Link

I am using the following 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

I am using the following 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

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

deleted 20 characters in body
Source Link

I am using the following 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

I am using the following 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

I am using the following 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

Source Link

How can i resolve an error with converting a string into a public key

I am using the following 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