eos icon indicating copy to clipboard operation
eos copied to clipboard

Cleos should have help text for invalid authorities (was: cleos set account permission bug!!!! ...)

Open shishi614 opened this issue 8 years ago • 4 comments

Repetition steps: create account:

cleos wallet import 5KXdExGfaz7r3kYH8FCL9trtCKDSqaufqCBPXHR5CK5Q99ysFRV cleos create account eosio liontable EOS55UqxQmM1A7Hdfp9kAe9vgHbjJM9iXp7EpCH5sNQier9sAB5gP EOS55UqxQmM1A7Hdfp9kAe9vgHbjJM9iXp7EpCH5sNQier9sAB5gP

cleos create account eosio liontoken EOS55UqxQmM1A7Hdfp9kAe9vgHbjJM9iXp7EpCH5sNQier9sAB5gP EOS55UqxQmM1A7Hdfp9kAe9vgHbjJM9iXp7EpCH5sNQier9sAB5gP

cleos create account eosio eosio1 EOS55UqxQmM1A7Hdfp9kAe9vgHbjJM9iXp7EpCH5sNQier9sAB5gP EOS55UqxQmM1A7Hdfp9kAe9vgHbjJM9iXp7EpCH5sNQier9sAB5gP cleos create account eosio 1 EOS55UqxQmM1A7Hdfp9kAe9vgHbjJM9iXp7EpCH5sNQier9sAB5gP EOS55UqxQmM1A7Hdfp9kAe9vgHbjJM9iXp7EpCH5sNQier9sAB5gP cleos create account eosio 2 EOS55UqxQmM1A7Hdfp9kAe9vgHbjJM9iXp7EpCH5sNQier9sAB5gP EOS55UqxQmM1A7Hdfp9kAe9vgHbjJM9iXp7EpCH5sNQier9sAB5gP cleos create account eosio 3 EOS55UqxQmM1A7Hdfp9kAe9vgHbjJM9iXp7EpCH5sNQier9sAB5gP EOS55UqxQmM1A7Hdfp9kAe9vgHbjJM9iXp7EpCH5sNQier9sAB5gP

➜ eos git:(db570801a) cleos set account permission liontoken active '{"threshold":1,"keys":[],"accounts":[{"permission":{"actor":"2","permission":"active"},"weight":1},{"permission":{"actor":"1","permission":"active"},"weight":1}]}' owner Error 3050000: action exception Error Details: Invalid authority: {"threshold":1,"keys":[],"accounts":[{"permission":{"actor":"2","permission":"active"},"weight":1},{"permission":{"actor":"1","permission":"active"},"weight":1}],"waits":[]} ➜ eos git:(db570801a) cleos set account permission liontoken active '{"threshold":1,"keys":[],"accounts":[{"permission":{"actor":"1","permission":"active"},"weight":1},{"permission":{"actor":"2","permission":"active"},"weight":1}]}' owner executed transaction: 555b7a5d741d18221ce382f2fde41b2c0fe9327a45b16d38d12855ef92005196 160 bytes 378 us

eosio <= eosio::updateauth {"account":"liontoken","permission":"active","parent":"owner","auth":{"threshold":1,"keys":[],"accou...

warning: transaction executed locally, but may not be confirmed by the network yet

where accounts array first actor is 2 and second actor is 1,arrive error Invalid authority, but while first actor is 1 and second actor is 2 is ok; Other users have similar problems, but I haven't found any specific rules

shishi614 avatar Jun 12 '18 01:06 shishi614

We require a certain form of authorities (like sorting on account names) that we are not currently documenting or explaining through cleos messaging.

For 1.0.4 we will try to get cleos to output useful messaging in this case

@dskvr we should consider documenting the requirements in the RPC too: see https://github.com/EOSIO/eos/blob/789490fdec8442a2b8d7dd14dc66d4bbc0adfe36/libraries/chain/include/eosio/chain/authority.hpp#L142-L187

wanderingbort avatar Jun 12 '18 22:06 wanderingbort

As of #4086 the error messaging and validation is improved. I will leave this ticked open for documentation.

wanderingbort avatar Jun 13 '18 21:06 wanderingbort

ok

shishi614 avatar Jun 15 '18 01:06 shishi614

Playing around with the order of the account names fixes this

FortisFortuna avatar Jun 16 '18 02:06 FortisFortuna