diff --git a/contracts/eosiolib/transaction.h b/contracts/eosiolib/transaction.h index 41dd2e9d3c0b988c2adfe6dbee4bc9d48d53ba74..0de234126ed506c14f01ff4f64c52f479ca6603f 100644 --- a/contracts/eosiolib/transaction.h +++ b/contracts/eosiolib/transaction.h @@ -59,9 +59,9 @@ extern "C" { * @{ */ - void send_deferred(uint64_t sender_id, time delay_until, char *serialized_transaction, size_t size); + void send_deferred(const uint128_t& sender_id, time delay_until, char *serialized_transaction, size_t size); - void cancel_deferred(uint64_t sender_id); + void cancel_deferred(const uint128_t& sender_id); /** * access a copy of the currently executing transaction diff --git a/contracts/eosiolib/transaction.hpp b/contracts/eosiolib/transaction.hpp index 75e36859e3d9a145d4407c2245877b09bdf0f19b..cbe8c3e7c4f86c8d2f81cdc6c29e68bae8ff17e4 100644 --- a/contracts/eosiolib/transaction.hpp +++ b/contracts/eosiolib/transaction.hpp @@ -48,7 +48,7 @@ namespace eosio { class deferred_transaction : public transaction { public: - uint64_t sender_id; + uint128_t sender_id; account_name sender; time delay_until; diff --git a/libraries/chain/apply_context.cpp b/libraries/chain/apply_context.cpp index 3b53799de095efce9c04630bd960805e8b4f03ca..6eeeb9a273e1abeb1fbcbaaba5855f9d401b706f 100644 --- a/libraries/chain/apply_context.cpp +++ b/libraries/chain/apply_context.cpp @@ -251,7 +251,7 @@ void apply_context::execute_deferred( deferred_transaction&& trx ) { } FC_CAPTURE_AND_RETHROW((trx)); } -void apply_context::cancel_deferred( uint64_t sender_id ) { +void apply_context::cancel_deferred( uint128_t sender_id ) { results.deferred_transaction_requests.push_back(deferred_reference(receiver, sender_id)); } diff --git a/libraries/chain/chain_controller.cpp b/libraries/chain/chain_controller.cpp index f86ff373fa0ec0ef90c2401f349e02110b446eb5..c2e45ac87b261b64adc437541d21adbcbe8a7cbb 100644 --- a/libraries/chain/chain_controller.cpp +++ b/libraries/chain/chain_controller.cpp @@ -249,13 +249,19 @@ bool chain_controller::_push_block(const signed_block& new_block) * queues. */ transaction_trace chain_controller::push_transaction(const packed_transaction& trx, uint32_t skip) - { try { - return with_skip_flags(skip, [&]() { - return _db.with_write_lock([&]() { - return _push_transaction(trx); - }); - }); - } EOS_CAPTURE_AND_RETHROW( transaction_exception ) } +{ try { + // If this is the first transaction pushed after applying a block, start a new undo session. + // This allows us to quickly rewind to the clean state of the head block, in case a new block arrives. + if( !_pending_block ) { + _start_pending_block(); + } + + return with_skip_flags(skip, [&]() { + return _db.with_write_lock([&]() { + return _push_transaction(trx); + }); + }); +} EOS_CAPTURE_AND_RETHROW( transaction_exception ) } transaction_trace chain_controller::_push_transaction(const packed_transaction& packed_trx) { try { @@ -324,18 +330,16 @@ static void record_locks_for_data_access(const vector& action_trac transaction_trace chain_controller::_push_transaction( transaction_metadata&& data ) { try { + FC_ASSERT( _pending_block, " block not started" ); + if (_limits.max_push_transaction_us.count() > 0) { - data.processing_deadline = fc::time_point::now() + _limits.max_push_transaction_us; + auto newval = fc::time_point::now() + _limits.max_push_transaction_us; + if ( !data.processing_deadline || newval < *data.processing_deadline ) { + data.processing_deadline = newval; + } } const transaction& trx = data.trx(); - - // If this is the first transaction pushed after applying a block, start a new undo session. - // This allows us to quickly rewind to the clean state of the head block, in case a new block arrives. - if( !_pending_block ) { - _start_pending_block(); - } - auto temp_session = _db.start_undo_session(true); // for now apply the transaction serially but schedule it according to those invariants @@ -383,7 +387,7 @@ block_header chain_controller::head_block_header() const return block_header(); } -void chain_controller::_start_pending_block() +void chain_controller::_start_pending_block( bool skip_deferred ) { FC_ASSERT( !_pending_block ); _pending_block = signed_block(); @@ -391,10 +395,20 @@ void chain_controller::_start_pending_block() _pending_block_session = _db.start_undo_session(true); _pending_block->regions.resize(1); _pending_block_trace->region_traces.resize(1); + _start_pending_cycle(); _apply_on_block_transaction(); _finalize_pending_cycle(); + _start_pending_cycle(); + + if ( !skip_deferred ) { + _push_deferred_transactions( false ); + if (_pending_cycle_trace && _pending_cycle_trace->shard_traces.size() > 0 && _pending_cycle_trace->shard_traces.back().transaction_traces.size() > 0) { + _finalize_pending_cycle(); + _start_pending_cycle(); + } + } } transaction chain_controller::_get_on_block_transaction() @@ -764,6 +778,7 @@ void chain_controller::__apply_block(const signed_block& next_block) const auto* gtrx = _db.find(receipt.id); if (gtrx != nullptr) { auto trx = fc::raw::unpack(gtrx->packed_trx.data(), gtrx->packed_trx.size()); + FC_ASSERT( trx.execute_after <= head_block_time() , "deffered transaction executed prematurely" ); _temp.emplace(trx, gtrx->published, trx.sender, trx.sender_id, gtrx->packed_trx.data(), gtrx->packed_trx.size() ); return &*_temp; } else { @@ -1726,8 +1741,23 @@ transaction_trace chain_controller::_apply_error( transaction_metadata& meta ) { return result; } -vector chain_controller::push_deferred_transactions( bool flush ) +vector chain_controller::push_deferred_transactions( bool flush, uint32_t skip ) +{ try { + if( !_pending_block ) { + _start_pending_block( true ); + } + + return with_skip_flags(skip, [&]() { + return _db.with_write_lock([&]() { + return _push_deferred_transactions( flush ); + }); + }); +} FC_CAPTURE_AND_RETHROW() } + +vector chain_controller::_push_deferred_transactions( bool flush ) { + FC_ASSERT( _pending_block, " block not started" ); + if (flush && _pending_cycle_trace && _pending_cycle_trace->shard_traces.size() > 0) { // TODO: when we go multithreaded this will need a better way to see if there are flushable // deferred transactions in the shards @@ -1761,18 +1791,22 @@ vector chain_controller::push_deferred_transactions( bool flu candidates.emplace_back(>rx); } + auto deferred_transactions_deadline = fc::time_point::now() + fc::microseconds(config::deffered_transactions_max_time_per_block_us); vector res; for (const auto* trx_p: candidates) { if (!is_known_transaction(trx_p->trx_id)) { try { auto trx = fc::raw::unpack(trx_p->packed_trx.data(), trx_p->packed_trx.size()); - transaction_metadata mtrx (trx, trx_p->published, trx.sender, trx.sender_id, trx_p->packed_trx.data(), trx_p->packed_trx.size()); + transaction_metadata mtrx (trx, trx_p->published, trx.sender, trx.sender_id, trx_p->packed_trx.data(), trx_p->packed_trx.size(), deferred_transactions_deadline); res.push_back( _push_transaction(std::move(mtrx)) ); generated_transaction_idx.remove(*trx_p); } FC_CAPTURE_AND_LOG((trx_p->trx_id)(trx_p->sender)); } else { generated_transaction_idx.remove(*trx_p); } + if ( deferred_transactions_deadline <= fc::time_point::now() ) { + break; + } } return res; } diff --git a/libraries/chain/include/eosio/chain/apply_context.hpp b/libraries/chain/include/eosio/chain/apply_context.hpp index c594ed9b5030106ab3d35ffad16e06ae968c9a19..c11f0b48fda97c0d1d58a5a3929f47029e3c8b03 100644 --- a/libraries/chain/include/eosio/chain/apply_context.hpp +++ b/libraries/chain/include/eosio/chain/apply_context.hpp @@ -464,7 +464,7 @@ class apply_context { void execute_inline( action &&a ); void execute_context_free_inline( action &&a ); void execute_deferred( deferred_transaction &&trx ); - void cancel_deferred( uint64_t sender_id ); + void cancel_deferred( uint128_t sender_id ); /** * @brief Require @ref account to have approved of this message diff --git a/libraries/chain/include/eosio/chain/chain_controller.hpp b/libraries/chain/include/eosio/chain/chain_controller.hpp index 55aae2bf1ff5ff71e8b8b51e9c9a140a9dfc3073..c64b83ffa7189c8b45b1531d6d97a742931243d1 100644 --- a/libraries/chain/include/eosio/chain/chain_controller.hpp +++ b/libraries/chain/include/eosio/chain/chain_controller.hpp @@ -87,8 +87,7 @@ namespace eosio { namespace chain { void push_block( const signed_block& b, uint32_t skip = skip_nothing ); transaction_trace push_transaction( const packed_transaction& trx, uint32_t skip = skip_nothing ); - vector push_deferred_transactions( bool flush = false ); - + vector push_deferred_transactions( bool flush = false, uint32_t skip = skip_nothing ); /** @@ -316,6 +315,7 @@ namespace eosio { namespace chain { transaction_trace _apply_transaction( transaction_metadata& data ); transaction_trace __apply_transaction( transaction_metadata& data ); transaction_trace _apply_error( transaction_metadata& data ); + vector _push_deferred_transactions( bool flush = false ); /// Reset the object graph in-memory void _initialize_indexes(); @@ -414,7 +414,7 @@ namespace eosio { namespace chain { void _spinup_db(); void _spinup_fork_db(); - void _start_pending_block(); + void _start_pending_block( bool skip_deferred = false ); void _start_pending_cycle(); void _start_pending_shard(); void _finalize_pending_cycle(); diff --git a/libraries/chain/include/eosio/chain/config.hpp b/libraries/chain/include/eosio/chain/config.hpp index 0fc4354c38e1b92f399b3255b3b1ce89d00a3bdd..98a862b351327df3220c1dc137ad5e11451542bd 100644 --- a/libraries/chain/include/eosio/chain/config.hpp +++ b/libraries/chain/include/eosio/chain/config.hpp @@ -72,6 +72,11 @@ const static eosio::chain::wasm_interface::vm_type default_wasm_runtime = eosio: */ const static int producer_repetitions = 12; +/** + * In block production, at the begining of each block we schedule deferred transactions until reach this time + */ +const static uint32_t deffered_transactions_max_time_per_block_us = 20*1000; //20ms + /** * The number of blocks produced per round is based upon all producers having a chance * to produce all of their consecutive blocks. diff --git a/libraries/chain/include/eosio/chain/generated_transaction_object.hpp b/libraries/chain/include/eosio/chain/generated_transaction_object.hpp index a0796e138944cb76e1e665aa59e1c9d016621d42..45c097d6309475ebe988f3cbe2d4c5baf62b7bb4 100644 --- a/libraries/chain/include/eosio/chain/generated_transaction_object.hpp +++ b/libraries/chain/include/eosio/chain/generated_transaction_object.hpp @@ -29,7 +29,7 @@ namespace eosio { namespace chain { id_type id; transaction_id_type trx_id; account_name sender; - uint64_t sender_id = 0; /// ID given this transaction by the sender + uint128_t sender_id = 0; /// ID given this transaction by the sender time_point delay_until; /// this generated transaction will not be applied until the specified time time_point expiration; /// this generated transaction will not be applied after this time time_point published; @@ -62,7 +62,7 @@ namespace eosio { namespace chain { ordered_unique< tag, composite_key< generated_transaction_object, BOOST_MULTI_INDEX_MEMBER( generated_transaction_object, account_name, sender), - BOOST_MULTI_INDEX_MEMBER( generated_transaction_object, uint64_t, sender_id) + BOOST_MULTI_INDEX_MEMBER( generated_transaction_object, uint128_t, sender_id) > > > diff --git a/libraries/chain/include/eosio/chain/transaction.hpp b/libraries/chain/include/eosio/chain/transaction.hpp index bae2c0d61ec096ab583f44616c614039a307704e..d3030d32f97458f70080710c99fae6ce6f9591ff 100644 --- a/libraries/chain/include/eosio/chain/transaction.hpp +++ b/libraries/chain/include/eosio/chain/transaction.hpp @@ -214,13 +214,13 @@ namespace eosio { namespace chain { */ struct deferred_transaction : public transaction { - uint64_t sender_id; /// ID assigned by sender of generated, accessible via WASM api when executing normal or error + uint128_t sender_id; /// ID assigned by sender of generated, accessible via WASM api when executing normal or error account_name sender; /// receives error handler callback time_point_sec execute_after; /// delayed exeuction deferred_transaction() = default; - deferred_transaction(uint32_t sender_id, account_name sender, time_point_sec execute_after, const transaction& txn) + deferred_transaction(uint128_t sender_id, account_name sender, time_point_sec execute_after, const transaction& txn) : transaction(txn), sender_id(sender_id), sender(sender), @@ -229,12 +229,12 @@ namespace eosio { namespace chain { }; struct deferred_reference { - deferred_reference( const account_name& sender, uint64_t sender_id) + deferred_reference( const account_name& sender, uint128_t sender_id) :sender(sender),sender_id(sender_id) {} account_name sender; - uint64_t sender_id; + uint128_t sender_id; }; struct data_access_info { diff --git a/libraries/chain/include/eosio/chain/transaction_metadata.hpp b/libraries/chain/include/eosio/chain/transaction_metadata.hpp index 8cc1bc9e25ebc84c7fcc8283e7698bfbeebe9801..60f2c0fce6f271fdc7afd2c47334a611f4657032 100644 --- a/libraries/chain/include/eosio/chain/transaction_metadata.hpp +++ b/libraries/chain/include/eosio/chain/transaction_metadata.hpp @@ -16,6 +16,14 @@ class transaction_metadata { ,sender(sender),sender_id(sender_id),raw_data(raw_data),raw_size(raw_size),_trx(&t) {} + transaction_metadata( const transaction& t, const time_point& published, const account_name& sender, uint32_t sender_id, const char* raw_data, size_t raw_size, fc::time_point deadline ) + :id(t.id()) + ,published(published) + ,sender(sender),sender_id(sender_id),raw_data(raw_data),raw_size(raw_size) + ,processing_deadline(deadline) + ,_trx(&t) + {} + transaction_metadata( const packed_transaction& t, chain_id_type chainid, const time_point& published ); transaction_metadata( transaction_metadata && ) = default; @@ -39,7 +47,7 @@ class transaction_metadata { // things for processing deferred transactions optional sender; - uint32_t sender_id = 0; + uint128_t sender_id = 0; // packed form to pass to contracts if needed const char* raw_data = nullptr; diff --git a/libraries/chain/wasm_interface.cpp b/libraries/chain/wasm_interface.cpp index adc5d13b639c28fe308a7e349ca7f3f33941525d..7abb45a40562066a3e505c3b7ef3e6fd5b9853f9 100644 --- a/libraries/chain/wasm_interface.cpp +++ b/libraries/chain/wasm_interface.cpp @@ -1030,23 +1030,24 @@ class transaction_api : public context_aware_api { context.execute_context_free_inline(std::move(act)); } - void send_deferred( uint64_t sender_id, const fc::time_point_sec& execute_after, array_ptr data, size_t data_len ) { + void send_deferred( const unsigned __int128& val, const fc::time_point_sec& execute_after, array_ptr data, size_t data_len ) { try { - // TODO: use global properties object for dynamic configuration of this default_max_gen_trx_size + fc::uint128_t sender_id(val>>64, uint64_t(val) ); const auto& gpo = context.controller.get_global_properties(); FC_ASSERT(data_len < gpo.configuration.max_generated_transaction_size, "generated transaction too big"); deferred_transaction dtrx; fc::raw::unpack(data, data_len, dtrx); dtrx.sender = context.receiver; - dtrx.sender_id = sender_id; + dtrx.sender_id = (unsigned __int128)sender_id; dtrx.execute_after = execute_after; context.execute_deferred(std::move(dtrx)); } FC_CAPTURE_AND_RETHROW((fc::to_hex(data, data_len))); } - void cancel_deferred( uint64_t sender_id ) { - context.cancel_deferred( sender_id ); + void cancel_deferred( const unsigned __int128& val ) { + fc::uint128_t sender_id(val>>64, uint64_t(val) ); + context.cancel_deferred( (unsigned __int128)sender_id ); } }; @@ -1553,8 +1554,8 @@ REGISTER_INTRINSICS(context_free_transaction_api, REGISTER_INTRINSICS(transaction_api, (send_inline, void(int, int) ) (send_context_free_inline, void(int, int) ) - (send_deferred, void(int64_t, int, int, int) ) - (cancel_deferred, void(int64_t) ) + (send_deferred, void(int, int, int, int) ) + (cancel_deferred, void(int) ) ); REGISTER_INTRINSICS(context_free_api, diff --git a/libraries/fc/include/fc/static_variant.hpp b/libraries/fc/include/fc/static_variant.hpp index 3a0a7ab72ad3364567bb65984019f1259ad741c2..e8f4b91fcd5cb83bf2255a23b86e39f2d273507e 100644 --- a/libraries/fc/include/fc/static_variant.hpp +++ b/libraries/fc/include/fc/static_variant.hpp @@ -195,8 +195,8 @@ class static_variant { static_assert(impl::type_info::no_reference_types, "Reference types are not permitted in static_variant."); static_assert(impl::type_info::no_duplicates, "static_variant type arguments contain duplicate types."); + alignas(Types...) char storage[impl::type_info::size]; int _tag; - char storage[impl::type_info::size]; template void init(const X& x) { diff --git a/libraries/fc/src/uint128.cpp b/libraries/fc/src/uint128.cpp index aa5a2bcb08e3805862501f8d2bf7c56d361f472d..ec9fc4300a50d48f534410a949e3e3f8b32244fd 100644 --- a/libraries/fc/src/uint128.cpp +++ b/libraries/fc/src/uint128.cpp @@ -376,8 +376,12 @@ namespace fc void to_variant( const uint128& var, variant& vo ) { vo = std::string(var); } void from_variant( const variant& var, uint128& vo ){ vo = uint128(var.as_string()); } - void to_variant( const unsigned __int128& var, variant& vo ) { to_variant( *((uint128*)var), vo); } - void from_variant( const variant& var, unsigned __int128& vo ) { from_variant( var, *((uint128*)&vo)); } + void to_variant( const unsigned __int128& var, variant& vo ) { to_variant( uint128(var), vo); } + void from_variant( const variant& var, unsigned __int128& vo ) { + uint128 tmp; + from_variant( var, tmp ); + vo = (unsigned __int128)tmp; + } } // namespace fc diff --git a/tests/api_tests/api_tests.cpp b/tests/api_tests/api_tests.cpp index ce8bcf7ac2653bf0bca8fdb8a55e48ca6cedcfb5..d84c6ff3de027b2ce68366d9f0abd8399b53fe11 100644 --- a/tests/api_tests/api_tests.cpp +++ b/tests/api_tests/api_tests.cpp @@ -363,7 +363,7 @@ BOOST_FIXTURE_TEST_CASE(action_tests, tester) { try { // test send_action_sender CALL_TEST_FUNCTION( *this, "test_transaction", "send_action_sender", fc::raw::pack(N(testapi))); - control->push_deferred_transactions( true ); + produce_block(); // test_publication_time uint32_t pub_time = control->head_block_time().sec_since_epoch(); @@ -662,11 +662,11 @@ BOOST_FIXTURE_TEST_CASE(deferred_transaction_tests, tester) { try { produce_blocks(1); //schedule - CALL_TEST_FUNCTION(*this, "test_transaction", "send_deferred_transaction", fc::raw::pack(uint64_t(1)) ); + CALL_TEST_FUNCTION(*this, "test_transaction", "send_deferred_transaction", {} ); //check that it doesn't get executed immediately auto traces = control->push_deferred_transactions( true ); BOOST_CHECK_EQUAL( 0, traces.size() ); - produce_blocks(24); + produce_block( fc::seconds(2) ); //check that it gets executed afterwards traces = control->push_deferred_transactions( true ); BOOST_CHECK_EQUAL( 1, traces.size() ); @@ -674,7 +674,7 @@ BOOST_FIXTURE_TEST_CASE(deferred_transaction_tests, tester) { try { //schedule twice (second deferred transaction should replace first one) CALL_TEST_FUNCTION(*this, "test_transaction", "send_deferred_transaction", {}); CALL_TEST_FUNCTION(*this, "test_transaction", "send_deferred_transaction", {}); - produce_blocks( 24 ); + produce_block( fc::seconds(2) ); //check that only one deferred transaction executed traces = control->push_deferred_transactions( true ); BOOST_CHECK_EQUAL( 1, traces.size() ); @@ -682,14 +682,14 @@ BOOST_FIXTURE_TEST_CASE(deferred_transaction_tests, tester) { try { //schedule and cancel CALL_TEST_FUNCTION(*this, "test_transaction", "send_deferred_transaction", {}); CALL_TEST_FUNCTION(*this, "test_transaction", "cancel_deferred_transaction", {}); - produce_blocks( 24 ); + produce_block( fc::seconds(2) ); traces = control->push_deferred_transactions( true ); BOOST_CHECK_EQUAL( 0, traces.size() ); //cancel_deferred() before scheduling transaction should not prevent the transaction from being scheduled (check that previous bug is fixed) CALL_TEST_FUNCTION(*this, "test_transaction", "cancel_deferred_transaction", {}); CALL_TEST_FUNCTION(*this, "test_transaction", "send_deferred_transaction", {}); - produce_blocks( 24 ); + produce_block( fc::seconds(2) ); traces = control->push_deferred_transactions( true ); BOOST_CHECK_EQUAL( 1, traces.size() ); } FC_LOG_AND_RETHROW() } diff --git a/tests/chain_tests/delay_tests.cpp b/tests/chain_tests/delay_tests.cpp index a9d4fee3f39607381107130a1292992306638457..6a29e4f0f8578e1282077c29a3b2c517e075693a 100644 --- a/tests/chain_tests/delay_tests.cpp +++ b/tests/chain_tests/delay_tests.cpp @@ -128,8 +128,6 @@ BOOST_AUTO_TEST_CASE( link_delay_direct_test ) { try { liquid_balance = get_currency_balance(chain, N(tester2)); BOOST_REQUIRE_EQUAL(asset::from_string("1.0000 CUR"), liquid_balance); - chain.control->push_deferred_transactions(true); - chain.produce_blocks(); liquid_balance = get_currency_balance(chain, N(tester)); @@ -137,8 +135,6 @@ BOOST_AUTO_TEST_CASE( link_delay_direct_test ) { try { liquid_balance = get_currency_balance(chain, N(tester2)); BOOST_REQUIRE_EQUAL(asset::from_string("1.0000 CUR"), liquid_balance); - chain.control->push_deferred_transactions(true); - chain.produce_blocks(18); liquid_balance = get_currency_balance(chain, N(tester)); @@ -146,8 +142,6 @@ BOOST_AUTO_TEST_CASE( link_delay_direct_test ) { try { liquid_balance = get_currency_balance(chain, N(tester2)); BOOST_REQUIRE_EQUAL(asset::from_string("1.0000 CUR"), liquid_balance); - chain.control->push_deferred_transactions(true); - chain.produce_blocks(); liquid_balance = get_currency_balance(chain, N(tester)); @@ -155,8 +149,6 @@ BOOST_AUTO_TEST_CASE( link_delay_direct_test ) { try { liquid_balance = get_currency_balance(chain, N(tester2)); BOOST_REQUIRE_EQUAL(asset::from_string("1.0000 CUR"), liquid_balance); - chain.control->push_deferred_transactions(true); - chain.produce_blocks(); liquid_balance = get_currency_balance(chain, N(tester)); @@ -276,8 +268,6 @@ BOOST_AUTO_TEST_CASE( link_delay_direct_parent_permission_test ) { try { liquid_balance = get_currency_balance(chain, N(tester2)); BOOST_REQUIRE_EQUAL(asset::from_string("1.0000 CUR"), liquid_balance); - chain.control->push_deferred_transactions(true); - chain.produce_blocks(); liquid_balance = get_currency_balance(chain, N(tester)); @@ -285,8 +275,6 @@ BOOST_AUTO_TEST_CASE( link_delay_direct_parent_permission_test ) { try { liquid_balance = get_currency_balance(chain, N(tester2)); BOOST_REQUIRE_EQUAL(asset::from_string("1.0000 CUR"), liquid_balance); - chain.control->push_deferred_transactions(true); - chain.produce_blocks(28); liquid_balance = get_currency_balance(chain, N(tester)); @@ -294,8 +282,6 @@ BOOST_AUTO_TEST_CASE( link_delay_direct_parent_permission_test ) { try { liquid_balance = get_currency_balance(chain, N(tester2)); BOOST_REQUIRE_EQUAL(asset::from_string("1.0000 CUR"), liquid_balance); - chain.control->push_deferred_transactions(true); - chain.produce_blocks(); liquid_balance = get_currency_balance(chain, N(tester)); @@ -303,8 +289,6 @@ BOOST_AUTO_TEST_CASE( link_delay_direct_parent_permission_test ) { try { liquid_balance = get_currency_balance(chain, N(tester2)); BOOST_REQUIRE_EQUAL(asset::from_string("1.0000 CUR"), liquid_balance); - chain.control->push_deferred_transactions(true); - chain.produce_blocks(); liquid_balance = get_currency_balance(chain, N(tester)); @@ -430,8 +414,6 @@ BOOST_AUTO_TEST_CASE( link_delay_direct_walk_parent_permissions_test ) { try { liquid_balance = get_currency_balance(chain, N(tester2)); BOOST_REQUIRE_EQUAL(asset::from_string("1.0000 CUR"), liquid_balance); - chain.control->push_deferred_transactions(true); - chain.produce_blocks(); liquid_balance = get_currency_balance(chain, N(tester)); @@ -439,8 +421,6 @@ BOOST_AUTO_TEST_CASE( link_delay_direct_walk_parent_permissions_test ) { try { liquid_balance = get_currency_balance(chain, N(tester2)); BOOST_REQUIRE_EQUAL(asset::from_string("1.0000 CUR"), liquid_balance); - chain.control->push_deferred_transactions(true); - chain.produce_blocks(38); liquid_balance = get_currency_balance(chain, N(tester)); @@ -448,8 +428,6 @@ BOOST_AUTO_TEST_CASE( link_delay_direct_walk_parent_permissions_test ) { try { liquid_balance = get_currency_balance(chain, N(tester2)); BOOST_REQUIRE_EQUAL(asset::from_string("1.0000 CUR"), liquid_balance); - chain.control->push_deferred_transactions(true); - chain.produce_blocks(); liquid_balance = get_currency_balance(chain, N(tester)); @@ -457,8 +435,6 @@ BOOST_AUTO_TEST_CASE( link_delay_direct_walk_parent_permissions_test ) { try { liquid_balance = get_currency_balance(chain, N(tester2)); BOOST_REQUIRE_EQUAL(asset::from_string("1.0000 CUR"), liquid_balance); - chain.control->push_deferred_transactions(true); - chain.produce_blocks(); liquid_balance = get_currency_balance(chain, N(tester)); @@ -573,8 +549,6 @@ BOOST_AUTO_TEST_CASE( link_delay_permission_change_test ) { try { liquid_balance = get_currency_balance(chain, N(tester2)); BOOST_REQUIRE_EQUAL(asset::from_string("0.0000 CUR"), liquid_balance); - chain.control->push_deferred_transactions(true); - chain.produce_blocks(16); liquid_balance = get_currency_balance(chain, N(tester)); @@ -601,8 +575,6 @@ BOOST_AUTO_TEST_CASE( link_delay_permission_change_test ) { try { liquid_balance = get_currency_balance(chain, N(tester2)); BOOST_REQUIRE_EQUAL(asset::from_string("0.0000 CUR"), liquid_balance); - chain.control->push_deferred_transactions(true); - chain.produce_blocks(); liquid_balance = get_currency_balance(chain, N(tester)); @@ -611,8 +583,6 @@ BOOST_AUTO_TEST_CASE( link_delay_permission_change_test ) { try { BOOST_REQUIRE_EQUAL(asset::from_string("0.0000 CUR"), liquid_balance); // first transfer will finally be performed - chain.control->push_deferred_transactions(true); - chain.produce_blocks(); liquid_balance = get_currency_balance(chain, N(tester)); @@ -630,8 +600,6 @@ BOOST_AUTO_TEST_CASE( link_delay_permission_change_test ) { try { BOOST_REQUIRE_EQUAL(transaction_receipt::executed, trace.status); BOOST_REQUIRE_EQUAL(0, trace.deferred_transaction_requests.size()); - chain.control->push_deferred_transactions(true); - chain.produce_blocks(); liquid_balance = get_currency_balance(chain, N(tester)); @@ -639,8 +607,6 @@ BOOST_AUTO_TEST_CASE( link_delay_permission_change_test ) { try { liquid_balance = get_currency_balance(chain, N(tester2)); BOOST_REQUIRE_EQUAL(asset::from_string("11.0000 CUR"), liquid_balance); - chain.control->push_deferred_transactions(true); - chain.produce_blocks(15); liquid_balance = get_currency_balance(chain, N(tester)); @@ -648,8 +614,6 @@ BOOST_AUTO_TEST_CASE( link_delay_permission_change_test ) { try { liquid_balance = get_currency_balance(chain, N(tester2)); BOOST_REQUIRE_EQUAL(asset::from_string("11.0000 CUR"), liquid_balance); - chain.control->push_deferred_transactions(true); - chain.produce_blocks(); liquid_balance = get_currency_balance(chain, N(tester)); @@ -658,8 +622,6 @@ BOOST_AUTO_TEST_CASE( link_delay_permission_change_test ) { try { BOOST_REQUIRE_EQUAL(asset::from_string("11.0000 CUR"), liquid_balance); // second transfer finally is performed - chain.control->push_deferred_transactions(true); - chain.produce_blocks(); liquid_balance = get_currency_balance(chain, N(tester)); @@ -780,8 +742,6 @@ BOOST_AUTO_TEST_CASE( link_delay_permission_change_with_delay_heirarchy_test ) { liquid_balance = get_currency_balance(chain, N(tester2)); BOOST_REQUIRE_EQUAL(asset::from_string("0.0000 CUR"), liquid_balance); - chain.control->push_deferred_transactions(true); - chain.produce_blocks(16); liquid_balance = get_currency_balance(chain, N(tester)); @@ -808,8 +768,6 @@ BOOST_AUTO_TEST_CASE( link_delay_permission_change_with_delay_heirarchy_test ) { liquid_balance = get_currency_balance(chain, N(tester2)); BOOST_REQUIRE_EQUAL(asset::from_string("0.0000 CUR"), liquid_balance); - chain.control->push_deferred_transactions(true); - chain.produce_blocks(); liquid_balance = get_currency_balance(chain, N(tester)); @@ -818,8 +776,6 @@ BOOST_AUTO_TEST_CASE( link_delay_permission_change_with_delay_heirarchy_test ) { BOOST_REQUIRE_EQUAL(asset::from_string("0.0000 CUR"), liquid_balance); // first transfer will finally be performed - chain.control->push_deferred_transactions(true); - chain.produce_blocks(); liquid_balance = get_currency_balance(chain, N(tester)); @@ -837,8 +793,6 @@ BOOST_AUTO_TEST_CASE( link_delay_permission_change_with_delay_heirarchy_test ) { BOOST_REQUIRE_EQUAL(transaction_receipt::executed, trace.status); BOOST_REQUIRE_EQUAL(0, trace.deferred_transaction_requests.size()); - chain.control->push_deferred_transactions(true); - chain.produce_blocks(); liquid_balance = get_currency_balance(chain, N(tester)); @@ -846,8 +800,6 @@ BOOST_AUTO_TEST_CASE( link_delay_permission_change_with_delay_heirarchy_test ) { liquid_balance = get_currency_balance(chain, N(tester2)); BOOST_REQUIRE_EQUAL(asset::from_string("11.0000 CUR"), liquid_balance); - chain.control->push_deferred_transactions(true); - chain.produce_blocks(15); liquid_balance = get_currency_balance(chain, N(tester)); @@ -855,8 +807,6 @@ BOOST_AUTO_TEST_CASE( link_delay_permission_change_with_delay_heirarchy_test ) { liquid_balance = get_currency_balance(chain, N(tester2)); BOOST_REQUIRE_EQUAL(asset::from_string("11.0000 CUR"), liquid_balance); - chain.control->push_deferred_transactions(true); - chain.produce_blocks(); liquid_balance = get_currency_balance(chain, N(tester)); @@ -865,8 +815,6 @@ BOOST_AUTO_TEST_CASE( link_delay_permission_change_with_delay_heirarchy_test ) { BOOST_REQUIRE_EQUAL(asset::from_string("11.0000 CUR"), liquid_balance); // second transfer finally is performed - chain.control->push_deferred_transactions(true); - chain.produce_blocks(); liquid_balance = get_currency_balance(chain, N(tester)); @@ -986,8 +934,6 @@ BOOST_AUTO_TEST_CASE( link_delay_link_change_test ) { try { liquid_balance = get_currency_balance(chain, N(tester2)); BOOST_REQUIRE_EQUAL(asset::from_string("0.0000 CUR"), liquid_balance); - chain.control->push_deferred_transactions(true); - chain.produce_blocks(16); liquid_balance = get_currency_balance(chain, N(tester)); @@ -1014,8 +960,6 @@ BOOST_AUTO_TEST_CASE( link_delay_link_change_test ) { try { liquid_balance = get_currency_balance(chain, N(tester2)); BOOST_REQUIRE_EQUAL(asset::from_string("0.0000 CUR"), liquid_balance); - chain.control->push_deferred_transactions(true); - chain.produce_blocks(); liquid_balance = get_currency_balance(chain, N(tester)); @@ -1024,8 +968,6 @@ BOOST_AUTO_TEST_CASE( link_delay_link_change_test ) { try { BOOST_REQUIRE_EQUAL(asset::from_string("0.0000 CUR"), liquid_balance); // first transfer will finally be performed - chain.control->push_deferred_transactions(true); - chain.produce_blocks(); liquid_balance = get_currency_balance(chain, N(tester)); @@ -1043,8 +985,6 @@ BOOST_AUTO_TEST_CASE( link_delay_link_change_test ) { try { BOOST_REQUIRE_EQUAL(transaction_receipt::executed, trace.status); BOOST_REQUIRE_EQUAL(0, trace.deferred_transaction_requests.size()); - chain.control->push_deferred_transactions(true); - chain.produce_blocks(); liquid_balance = get_currency_balance(chain, N(tester)); @@ -1052,8 +992,6 @@ BOOST_AUTO_TEST_CASE( link_delay_link_change_test ) { try { liquid_balance = get_currency_balance(chain, N(tester2)); BOOST_REQUIRE_EQUAL(asset::from_string("11.0000 CUR"), liquid_balance); - chain.control->push_deferred_transactions(true); - chain.produce_blocks(15); liquid_balance = get_currency_balance(chain, N(tester)); @@ -1061,8 +999,6 @@ BOOST_AUTO_TEST_CASE( link_delay_link_change_test ) { try { liquid_balance = get_currency_balance(chain, N(tester2)); BOOST_REQUIRE_EQUAL(asset::from_string("11.0000 CUR"), liquid_balance); - chain.control->push_deferred_transactions(true); - chain.produce_blocks(); liquid_balance = get_currency_balance(chain, N(tester)); @@ -1071,8 +1007,6 @@ BOOST_AUTO_TEST_CASE( link_delay_link_change_test ) { try { BOOST_REQUIRE_EQUAL(asset::from_string("11.0000 CUR"), liquid_balance); // second transfer finally is performed - chain.control->push_deferred_transactions(true); - chain.produce_blocks(); liquid_balance = get_currency_balance(chain, N(tester)); @@ -1198,8 +1132,6 @@ BOOST_AUTO_TEST_CASE( link_delay_link_change_heirarchy_test ) { try { liquid_balance = get_currency_balance(chain, N(tester2)); BOOST_REQUIRE_EQUAL(asset::from_string("0.0000 CUR"), liquid_balance); - chain.control->push_deferred_transactions(true); - chain.produce_blocks(16); liquid_balance = get_currency_balance(chain, N(tester)); @@ -1226,8 +1158,6 @@ BOOST_AUTO_TEST_CASE( link_delay_link_change_heirarchy_test ) { try { liquid_balance = get_currency_balance(chain, N(tester2)); BOOST_REQUIRE_EQUAL(asset::from_string("0.0000 CUR"), liquid_balance); - chain.control->push_deferred_transactions(true); - chain.produce_blocks(); liquid_balance = get_currency_balance(chain, N(tester)); @@ -1236,8 +1166,6 @@ BOOST_AUTO_TEST_CASE( link_delay_link_change_heirarchy_test ) { try { BOOST_REQUIRE_EQUAL(asset::from_string("0.0000 CUR"), liquid_balance); // first transfer will finally be performed - chain.control->push_deferred_transactions(true); - chain.produce_blocks(); liquid_balance = get_currency_balance(chain, N(tester)); @@ -1255,8 +1183,6 @@ BOOST_AUTO_TEST_CASE( link_delay_link_change_heirarchy_test ) { try { BOOST_REQUIRE_EQUAL(transaction_receipt::executed, trace.status); BOOST_REQUIRE_EQUAL(0, trace.deferred_transaction_requests.size()); - chain.control->push_deferred_transactions(true); - chain.produce_blocks(); liquid_balance = get_currency_balance(chain, N(tester)); @@ -1264,8 +1190,6 @@ BOOST_AUTO_TEST_CASE( link_delay_link_change_heirarchy_test ) { try { liquid_balance = get_currency_balance(chain, N(tester2)); BOOST_REQUIRE_EQUAL(asset::from_string("11.0000 CUR"), liquid_balance); - chain.control->push_deferred_transactions(true); - chain.produce_blocks(15); liquid_balance = get_currency_balance(chain, N(tester)); @@ -1273,8 +1197,6 @@ BOOST_AUTO_TEST_CASE( link_delay_link_change_heirarchy_test ) { try { liquid_balance = get_currency_balance(chain, N(tester2)); BOOST_REQUIRE_EQUAL(asset::from_string("11.0000 CUR"), liquid_balance); - chain.control->push_deferred_transactions(true); - chain.produce_blocks(); liquid_balance = get_currency_balance(chain, N(tester)); @@ -1283,8 +1205,6 @@ BOOST_AUTO_TEST_CASE( link_delay_link_change_heirarchy_test ) { try { BOOST_REQUIRE_EQUAL(asset::from_string("11.0000 CUR"), liquid_balance); // second transfer finally is performed - chain.control->push_deferred_transactions(true); - chain.produce_blocks(); liquid_balance = get_currency_balance(chain, N(tester)); @@ -1400,8 +1320,6 @@ BOOST_AUTO_TEST_CASE( mindelay_test ) { try { liquid_balance = get_currency_balance(chain, N(tester2)); BOOST_REQUIRE_EQUAL(asset::from_string("1.0000 CUR"), liquid_balance); - chain.control->push_deferred_transactions(true); - chain.produce_blocks(); liquid_balance = get_currency_balance(chain, N(tester)); @@ -1409,8 +1327,6 @@ BOOST_AUTO_TEST_CASE( mindelay_test ) { try { liquid_balance = get_currency_balance(chain, N(tester2)); BOOST_REQUIRE_EQUAL(asset::from_string("1.0000 CUR"), liquid_balance); - chain.control->push_deferred_transactions(true); - chain.produce_blocks(18); liquid_balance = get_currency_balance(chain, N(tester)); @@ -1418,8 +1334,6 @@ BOOST_AUTO_TEST_CASE( mindelay_test ) { try { liquid_balance = get_currency_balance(chain, N(tester2)); BOOST_REQUIRE_EQUAL(asset::from_string("1.0000 CUR"), liquid_balance); - chain.control->push_deferred_transactions(true); - chain.produce_blocks(); liquid_balance = get_currency_balance(chain, N(tester)); @@ -1427,8 +1341,6 @@ BOOST_AUTO_TEST_CASE( mindelay_test ) { try { liquid_balance = get_currency_balance(chain, N(tester2)); BOOST_REQUIRE_EQUAL(asset::from_string("1.0000 CUR"), liquid_balance); - chain.control->push_deferred_transactions(true); - chain.produce_blocks(); liquid_balance = get_currency_balance(chain, N(tester)); @@ -1543,8 +1455,6 @@ BOOST_AUTO_TEST_CASE( canceldelay_test ) { try { liquid_balance = get_currency_balance(chain, N(tester2)); BOOST_REQUIRE_EQUAL(asset::from_string("0.0000 CUR"), liquid_balance); - chain.control->push_deferred_transactions(true); - chain.produce_blocks(16); liquid_balance = get_currency_balance(chain, N(tester)); @@ -1582,9 +1492,7 @@ BOOST_AUTO_TEST_CASE( canceldelay_test ) { try { BOOST_REQUIRE_EQUAL(transaction_receipt::executed, trace.status); BOOST_REQUIRE_EQUAL(1, trace.deferred_transaction_requests.size()); const auto sender_id_canceled = trace.deferred_transaction_requests[0].get().sender_id; - BOOST_REQUIRE_EQUAL(sender_id_to_cancel, sender_id_canceled); - - chain.control->push_deferred_transactions(true); + BOOST_REQUIRE_EQUAL(std::string(uint128(sender_id_to_cancel)), std::string(uint128(sender_id_canceled))); chain.produce_blocks(); @@ -1594,8 +1502,6 @@ BOOST_AUTO_TEST_CASE( canceldelay_test ) { try { BOOST_REQUIRE_EQUAL(asset::from_string("0.0000 CUR"), liquid_balance); // first transfer will finally be performed - chain.control->push_deferred_transactions(true); - chain.produce_blocks(); liquid_balance = get_currency_balance(chain, N(tester)); @@ -1613,8 +1519,6 @@ BOOST_AUTO_TEST_CASE( canceldelay_test ) { try { BOOST_REQUIRE_EQUAL(transaction_receipt::executed, trace.status); BOOST_REQUIRE_EQUAL(0, trace.deferred_transaction_requests.size()); - chain.control->push_deferred_transactions(true); - chain.produce_blocks(); liquid_balance = get_currency_balance(chain, N(tester)); @@ -1622,8 +1526,6 @@ BOOST_AUTO_TEST_CASE( canceldelay_test ) { try { liquid_balance = get_currency_balance(chain, N(tester2)); BOOST_REQUIRE_EQUAL(asset::from_string("10.0000 CUR"), liquid_balance); - chain.control->push_deferred_transactions(true); - chain.produce_blocks(15); liquid_balance = get_currency_balance(chain, N(tester)); @@ -1631,8 +1533,6 @@ BOOST_AUTO_TEST_CASE( canceldelay_test ) { try { liquid_balance = get_currency_balance(chain, N(tester2)); BOOST_REQUIRE_EQUAL(asset::from_string("10.0000 CUR"), liquid_balance); - chain.control->push_deferred_transactions(true); - chain.produce_blocks(); liquid_balance = get_currency_balance(chain, N(tester)); @@ -1641,8 +1541,6 @@ BOOST_AUTO_TEST_CASE( canceldelay_test ) { try { BOOST_REQUIRE_EQUAL(asset::from_string("10.0000 CUR"), liquid_balance); // second transfer finally is performed - chain.control->push_deferred_transactions(true); - chain.produce_blocks(); liquid_balance = get_currency_balance(chain, N(tester)); diff --git a/tests/wasm_tests/currency_tests.cpp b/tests/wasm_tests/currency_tests.cpp index 6757ee24300e4a0bba45aea6c3d279395135c963..cb7d25a6098798b123d1317e07ef240f78ef9928 100644 --- a/tests/wasm_tests/currency_tests.cpp +++ b/tests/wasm_tests/currency_tests.cpp @@ -402,13 +402,12 @@ BOOST_FIXTURE_TEST_CASE( test_proxy, currency_tester ) try { } while(control->head_block_time() < expected_delivery) { - control->push_deferred_transactions(true); produce_block(); BOOST_REQUIRE_EQUAL(get_balance( N(proxy)), asset::from_string("5.0000 CUR")); BOOST_REQUIRE_EQUAL(get_balance( N(alice)), asset::from_string("0.0000 CUR")); } - control->push_deferred_transactions(true); + produce_block(); BOOST_REQUIRE_EQUAL(get_balance( N(proxy)), asset::from_string("0.0000 CUR")); BOOST_REQUIRE_EQUAL(get_balance( N(alice)), asset::from_string("5.0000 CUR")); @@ -459,7 +458,6 @@ BOOST_FIXTURE_TEST_CASE( test_deferred_failure, currency_tester ) try { auto deferred_id = trace.deferred_transaction_requests.back().get().id(); while(control->head_block_time() < expected_delivery) { - control->push_deferred_transactions(true); produce_block(); BOOST_REQUIRE_EQUAL(get_balance( N(proxy)), asset::from_string("5.0000 CUR")); BOOST_REQUIRE_EQUAL(get_balance( N(bob)), asset::from_string("0.0000 CUR")); @@ -468,7 +466,6 @@ BOOST_FIXTURE_TEST_CASE( test_deferred_failure, currency_tester ) try { } fc::time_point expected_redelivery(fc::seconds(control->head_block_time().sec_since_epoch()) + fc::seconds(10)); - control->push_deferred_transactions(true); produce_block(); BOOST_REQUIRE_EQUAL(chain_has_transaction(deferred_id), true); BOOST_REQUIRE_EQUAL(get_transaction_receipt(deferred_id).status, transaction_receipt::soft_fail); @@ -494,19 +491,18 @@ BOOST_FIXTURE_TEST_CASE( test_deferred_failure, currency_tester ) try { } while(control->head_block_time() < expected_redelivery) { - control->push_deferred_transactions(true); produce_block(); BOOST_REQUIRE_EQUAL(get_balance( N(proxy)), asset::from_string("5.0000 CUR")); BOOST_REQUIRE_EQUAL(get_balance( N(bob)), asset::from_string("0.0000 CUR")); BOOST_REQUIRE_EQUAL(get_balance( N(bob)), asset::from_string("0.0000 CUR")); } - control->push_deferred_transactions(true); + produce_block(); BOOST_REQUIRE_EQUAL(get_balance( N(proxy)), asset::from_string("0.0000 CUR")); BOOST_REQUIRE_EQUAL(get_balance( N(alice)), asset::from_string("0.0000 CUR")); BOOST_REQUIRE_EQUAL(get_balance( N(bob)), asset::from_string("5.0000 CUR")); - control->push_deferred_transactions(true); + produce_block(); BOOST_REQUIRE_EQUAL(get_balance( N(proxy)), asset::from_string("0.0000 CUR")); BOOST_REQUIRE_EQUAL(get_balance( N(alice)), asset::from_string("5.0000 CUR")); diff --git a/tests/wasm_tests/eosio.system_tests.cpp b/tests/wasm_tests/eosio.system_tests.cpp index f15590fae8e5be2e37249347e41e583f3b2fb174..0284dafc4e56daab922e5176ec0a481981171560 100644 --- a/tests/wasm_tests/eosio.system_tests.cpp +++ b/tests/wasm_tests/eosio.system_tests.cpp @@ -207,17 +207,16 @@ BOOST_FIXTURE_TEST_CASE( stake_unstake, eosio_system_tester ) try { BOOST_REQUIRE_EQUAL( asset::from_string("0.0000 EOS").amount, total["storage_stake"].as_uint64()); BOOST_REQUIRE_EQUAL( 0, total["storage_bytes"].as_uint64()); REQUIRE_MATCHING_OBJECT( voter( "alice", "0.00 EOS" ), get_voter_info( "alice" ) ); - control->push_deferred_transactions(true); + produce_blocks(1); BOOST_REQUIRE_EQUAL( asset::from_string("200.0000 EOS"), get_balance( "alice" ) ); //after 2 days balance should not be available yet produce_block( fc::hours(3*24-1) ); - control->push_deferred_transactions(true); + produce_blocks(1); BOOST_REQUIRE_EQUAL( asset::from_string("200.0000 EOS"), get_balance( "alice" ) ); - //after 3 days funds should be released produce_block( fc::hours(1) ); - control->push_deferred_transactions(true); + produce_blocks(1); BOOST_REQUIRE_EQUAL( asset::from_string("1000.0000 EOS"), get_balance( "alice" ) ); } FC_LOG_AND_RETHROW() @@ -502,10 +501,10 @@ BOOST_FIXTURE_TEST_CASE( adding_stake_partial_unstake, eosio_system_tester ) try //combined amount should be available only in 3 days produce_block( fc::days(2) ); - control->push_deferred_transactions(true); + produce_blocks(1); BOOST_REQUIRE_EQUAL( asset::from_string("430.0000 EOS"), get_balance( "alice" ) ); produce_block( fc::days(1) ); - control->push_deferred_transactions(true); + produce_blocks(1); BOOST_REQUIRE_EQUAL( asset::from_string("790.0000 EOS"), get_balance( "alice" ) ); } FC_LOG_AND_RETHROW() @@ -661,7 +660,7 @@ BOOST_FIXTURE_TEST_CASE( vote_for_producer, eosio_system_tester ) try { BOOST_REQUIRE_EQUAL( string(key.begin(), key.end()), to_string(prod["packed_key"]) ); //carol should receive funds in 3 days produce_block( fc::days(3) ); - control->push_deferred_transactions(true); + produce_block(); BOOST_REQUIRE_EQUAL( asset::from_string("3000.0000 EOS"), get_balance( "carol" ) ); } FC_LOG_AND_RETHROW()