So I wanted to do delegatebw in my contract as a deferred transaction:
eosio::transaction out;
out.actions.emplace_back(eosio::permission_level{_self, N(active) }, N(eosio), N(delegatebw), std::make_tuple(_self, someone, stake_net_quantity, stake_cpu_quantity, false));
out.delay_sec = 1;
out.send(id + N(delegate) + current_time(), _self, false);
The values for stake_net_quantity
and stake_cpu_quantity
are definitely 120 and 80 respectively, however when the code is executed, I get the following error:
2018-08-15T18:09:19.506 thread-0 wasm_interface.cpp:929 eosio_assert ] message: addition overflow
2018-08-15T18:09:19.506 thread-0 controller.cpp:612 push_scheduled_trans ] 3050003 eosio_assert_message_exception: eosio_assert_message assertion failure
assertion failure with message: addition overflow
{"s":"addition overflow"}
thread-0 wasm_interface.cpp:930 eosio_assert
pending console output:
{"console":""}
thread-0 apply_context.cpp:61 exec_one
2018-08-15T18:09:19.507 thread-0 apply_context.cpp:28 print_debug ]
I looked deep in the code, but there is no way that 120+80 is an addition overflow. Does anyone have any idea what could be happening here?
id + N(delegate) + current_time()
1
. The error is still presentN(delegate) + current_time()
still overflowsout.send(1, _self, false);