2

Have an issue with the action push: cleos --wallet-url "http://localhost:8889" push action contractx put '["test", "75c88c9593bec6b716f2cb9b60db79282b6f3389a39f3be9adef45e06b379b48"]' -p test Error 3090004: missing required authority Ensure that you have the related authority inside your transaction!; If you are currently using 'cleos push action' command, try to add the relevant authority using -p option.

From nodeos log: 3054778ms thread-0 http_plugin.cpp:405 handle_exception ] FC Exception encountered while processing chain.push_transaction 3054779ms thread-0 http_plugin.cpp:406 handle_exception ] Exception Details: 3090004 missing_auth_exception: missing required authority missing authority of qz3fx4wpln4b5 {"account":"qz3fx4wpln4b5"}

Why is account corrupted in the nodeos log? I expect 'test' there. nodeos tag: 1.0.6; OS: Fedora 27 x86_64; compiler: latest from docker eosio/eos-dev;

Updated: Action code:

  /// @abi action
  void put(account_name owner, hash_t document_hash) {
    auto key = record_t::primary_key(document_hash);
    print("put owner=", owner, ", key=", key, ", self=", _self);
    // require_auth(owner);
    records.emplace(key, [&] (auto& r) {
      r.owner = owner;
      r.ts = publication_time();
      r.document_hash = document_hash;
    });
  }
  • Is the contract action attempting to forward an action to another account? If so, it will require the authority of that account to succeed. We would need more info on what the contract/action in question is trying to do. – John Haager Jun 27 '18 at 21:40
  • @JohnHaager, code is attached. – Dennis Jun 28 '18 at 7:34
0

In your action, the emplace call is being used incorrectly. The first parameter to the emplace call is the account that will be charged for the storage of the data. In your case, you are using a key that isn't an account name. The call should look like:

...
records.emplace(owner, [&] (auto& r) {
...
| improve this answer | |

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.