1

I have a function which takes in T::AccountId type

    Citizen get(fn candidate_name): map hasher(blake2_128_concat) T::AccountId => Option<Vec<u8>>;

e.g.

    fn add_count(origin, account:T::AccountId, phrase: Vec<u8>) {
       // I need to concatenate : account + _ + phrase, then convert it to Vec<u8> or bytes
       // Then change the Citizen storage using account
    }

Another way is:

    fn add_count(origin, account:Vec<u8>, phrase: Vec<u8>) {
       // Concatenate : account + _ + phrase, then convert it to Vec<u8> or bytes
       // Then change account to T::AccountId and then change the Citizen storage
    }

But I am unable to convert the T::AccountId type to bytes/vec<u8> or vice versa.

Amiya Behera
  • 2,210
  • 19
  • 32

0 Answers0