diff --git a/libraries/chain/chain_controller.cpp b/libraries/chain/chain_controller.cpp index f8c94727e2393a7f4df62d9c5df73d495b421a3c..aeb712bb6cdf1849b8b7672147c8d4ef647f6918 100644 --- a/libraries/chain/chain_controller.cpp +++ b/libraries/chain/chain_controller.cpp @@ -369,7 +369,8 @@ transaction_trace chain_controller::delayed_transaction_processing( const transa time_point_sec execute_after = head_block_time(); execute_after += mtrx.delay; //TODO: !!! WHO GETS BILLED TO STORE THE DELAYED TX? - deferred_transaction dtrx(*reinterpret_cast(trx.id()._hash), config::system_account_name, config::system_account_name, execute_after, trx); + fc::uint128_t _id(trx.id()._hash[3], trx.id()._hash[2]); + deferred_transaction dtrx((unsigned __int128)_id, config::system_account_name, config::system_account_name, execute_after, trx); FC_ASSERT( dtrx.execute_after < dtrx.expiration, "transaction expires before it can execute" ); result.deferred_transaction_requests.push_back(std::move(dtrx)); diff --git a/libraries/chain/contracts/eosio_contract.cpp b/libraries/chain/contracts/eosio_contract.cpp index b88d9db54f3694c62fc624f69995e3f567940dd9..9cf0ac71dd366b0400e28603c7d76d9ea9cb0f4a 100644 --- a/libraries/chain/contracts/eosio_contract.cpp +++ b/libraries/chain/contracts/eosio_contract.cpp @@ -483,8 +483,9 @@ void apply_eosio_postrecovery(apply_context& context) { .parent = 0, .data = recover_act.data }, update); - - auto& request_id = *reinterpret_cast(context.trx_meta.id._hash); + + const fc::uint128_t _request_id(context.trx_meta.id._hash[3], context.trx_meta.id._hash[2]); + const uint128_t request_id = (unsigned __int128)_request_id; auto record_data = mutable_variant_object() ("account", account) ("request_id", request_id) @@ -592,8 +593,9 @@ void apply_eosio_canceldelay(apply_context& context) { FC_ASSERT (found, "canceldelay action must be signed with the \"active\" permission for one of the actors" " provided in the authorizations on the original transaction"); - - context.cancel_deferred(*reinterpret_cast(trx_id._hash)); + + const fc::uint128_t _id(trx_id._hash[3], trx_id._hash[2]); + context.cancel_deferred((unsigned __int128)_id); } void apply_eosio_mindelay(apply_context& context) { diff --git a/tests/chain_tests/delay_tests.cpp b/tests/chain_tests/delay_tests.cpp index 3b4f0dea32bccc925fba94bf63db652b7c01b96f..72f1df1eb20283150250f4248fae5deda4727bb5 100644 --- a/tests/chain_tests/delay_tests.cpp +++ b/tests/chain_tests/delay_tests.cpp @@ -1431,6 +1431,7 @@ BOOST_AUTO_TEST_CASE( canceldelay_test ) { try { BOOST_REQUIRE_EQUAL(transaction_receipt::delayed, trace.status); BOOST_REQUIRE_EQUAL(1, trace.deferred_transaction_requests.size()); BOOST_REQUIRE_EQUAL(0, trace.action_traces.size()); + const auto sender_id_to_cancel = trace.deferred_transaction_requests[0].get().sender_id; chain.produce_blocks();