eos icon indicating copy to clipboard operation
eos copied to clipboard

how to get authority of some one when push action?

Open chenlian2015 opened this issue 8 years ago • 2 comments

mycontract .cpp code as below:

void test_transaction::send_deferred_transaction_oct() {
   using namespace eosio;
   auto trx = transaction();
   transfer trans = unpack_action_data<transfer>();
   test_action_action<N(currency), N(transfer)> transferaction;
   copy_data((char*)&trans, sizeof(trans), transferaction.data);
   trx.actions.emplace_back(vector<permission_level>{{trans.from, N(active)}}, transferaction);
   trx.send( 0xffffffffffffffff, now()+2 );
}

exec commad: cleos push action mycontract transfer '{"from":"chenlian", "to":"oct", "quantity":"10 CUR", "memo":""}' -p chenlian@owner

then i get error as below:

3030001 tx_missing_auth: missing required authority
missing authority of chenlian
    {"account":"chenlian"}
    thread-0  apply_context.cpp:122 require_authorization

    {"_pending_console_output.str()":""}
    thread-0  apply_context.cpp:29 exec_one

    {}
    thread-0  chain_controller.cpp:1662 __apply_transaction

but how i get the authority of chenlian??

chenlian2015 avatar Apr 04 '18 03:04 chenlian2015

你解决了吗?我现在用内联action也出现类似的错误

jsonsnow avatar May 14 '18 02:05 jsonsnow

I saw you also posted the similar issue beforehand (#2083), I have added a comment there, please create a new issue if you still encounter the problem! Thanks

andriantolie avatar Jul 03 '18 10:07 andriantolie