1

In the vote.cpp, they use this type of public key:

namespace eosio {
   struct public_key {
      unsigned_int        type;
      std::array<char,33> data;
friend bool operator == ( const public_key& a, const public_key& b ) {
        return std::tie(a.type,a.data) == std::tie(b.type,b.data);
      }
      friend bool operator != ( const public_key& a, const public_key& b ) {
        return std::tie(a.type,a.data) != std::tie(b.type,b.data);
      }
      EOSLIB_SERIALIZE( public_key, (type)(data) )
   };
}

however, when use the recover_key() method in crypto.h the public key should be like this:

struct public_key {
   char data[34];
};

I'd like to know how to convert the first public_key to the second? when I store the second in the table, I can't use the get table action.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.