eos icon indicating copy to clipboard operation
eos copied to clipboard

updateauth action from contract

Open StarryJapanNight opened this issue 8 years ago • 3 comments

I am unable to generate an authorization from a JSON, so that a contract can send an updateauth action. Building an authorization requires eosio::chain::public_key_type, which i can't include as eosiocpp wont compile 'float.h'. Any way around this?

StarryJapanNight avatar Jul 08 '18 02:07 StarryJapanNight

You should include public_key_type defined in contracts/eosiolib/types.h and it doesn't require float.h

andriantolie avatar Jul 09 '18 10:07 andriantolie

There is no public_key_type defined in types.h. Only public_key struct. The chain version links to fc::crypto::public_key which has methods for converting a base58 key string to public_key type (data[34])

StarryJapanNight avatar Jul 09 '18 11:07 StarryJapanNight

Anything inside libraries/chain contains dependencies that might not be supported by Web Assembly. I don't think it's safe to include those files.

If you pass the public key to your user-generated action (not the inline action), the abi serializer will automatically convert your public key string to public key type (and I guess this is what usually most of the people do).

andriantolie avatar Jul 10 '18 02:07 andriantolie