diff --git a/README.md b/README.md index bc39e6d521..1b141401a5 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ BitShares Core `master` | `develop` | `hardfork` | `testnet` | `bitshares-fc` --- | --- | --- | --- | --- [![](https://travis-ci.org/bitshares/bitshares-core.svg?branch=master)](https://travis-ci.org/bitshares/bitshares-core) | [![](https://travis-ci.org/bitshares/bitshares-core.svg?branch=develop)](https://travis-ci.org/bitshares/bitshares-core) | [![](https://travis-ci.org/bitshares/bitshares-core.svg?branch=hardfork)](https://travis-ci.org/bitshares/bitshares-core) | [![](https://travis-ci.org/bitshares/bitshares-core.svg?branch=testnet)](https://travis-ci.org/bitshares/bitshares-core) | [![](https://travis-ci.org/bitshares/bitshares-fc.svg?branch=master)](https://travis-ci.org/bitshares/bitshares-fc) - [![](https://github.com/bitshares/bitshares-core/workflows/Github%20Autobuild/badge.svg?branch=master)](https://github.com/bitshares/bitshares-core/actions?query=branch%3Amaster) | [![](https://github.com/bitshares/bitshares-core/workflows/Github%20Autobuild/badge.svg?branch=develop)](https://github.com/bitshares/bitshares-core/actions?query=branch%3Adevelop) | [![](https://github.com/bitshares/bitshares-core/workflows/Github%20Autobuild/badge.svg?branch=hardfork)](https://github.com/bitshares/bitshares-core/actions?query=branch%3Ahardfork) | [![](https://github.com/bitshares/bitshares-core/workflows/Github%20Autobuild/badge.svg?branch=testnet)](https://github.com/bitshares/bitshares-core/actions?query=branch%3Atestnet) | [https://github.com/bitshares/bitshares-fc/workflows/Github%20Autobuild/badge.svg?branch=master](https://github.com/bitshares/bitshares-fc/actions?query=branch%3Amaster) + [![](https://github.com/bitshares/bitshares-core/workflows/Github%20Autobuild/badge.svg?branch=master)](https://github.com/bitshares/bitshares-core/actions?query=branch%3Amaster) | [![](https://github.com/bitshares/bitshares-core/workflows/Github%20Autobuild/badge.svg?branch=develop)](https://github.com/bitshares/bitshares-core/actions?query=branch%3Adevelop) | [![](https://github.com/bitshares/bitshares-core/workflows/Github%20Autobuild/badge.svg?branch=hardfork)](https://github.com/bitshares/bitshares-core/actions?query=branch%3Ahardfork) | [![](https://github.com/bitshares/bitshares-core/workflows/Github%20Autobuild/badge.svg?branch=testnet)](https://github.com/bitshares/bitshares-core/actions?query=branch%3Atestnet) | [![](https://github.com/bitshares/bitshares-fc/workflows/Github%20Autobuild/badge.svg?branch=master)](https://github.com/bitshares/bitshares-fc/actions?query=branch%3Amaster) * [Getting Started](#getting-started) * [Support](#support) diff --git a/tests/app/main.cpp b/tests/app/main.cpp index 14c1d3c4fd..2cb58156ec 100644 --- a/tests/app/main.cpp +++ b/tests/app/main.cpp @@ -246,9 +246,9 @@ BOOST_AUTO_TEST_CASE( two_node_network ) BOOST_TEST_MESSAGE( "Starting app1 and waiting 500 ms" ); app1.startup(); #ifdef NDEBUG - #define LISTEN_WAIT_TIME (fc::milliseconds(10000)) - #else #define LISTEN_WAIT_TIME (fc::milliseconds(30000)) + #else + #define LISTEN_WAIT_TIME (fc::milliseconds(120000)) #endif fc::wait_for( LISTEN_WAIT_TIME, [&app1] () { const auto status = app1.p2p_node()->network_get_info(); @@ -327,11 +327,13 @@ BOOST_AUTO_TEST_CASE( two_node_network ) app1.p2p_node()->broadcast(graphene::net::trx_message(trx)); #ifdef NDEBUG - #define BROADCAST_WAIT_TIME (fc::milliseconds(5000)) - #else #define BROADCAST_WAIT_TIME (fc::milliseconds(15000)) + #else + #define BROADCAST_WAIT_TIME (fc::milliseconds(60000)) #endif - fc::usleep( BROADCAST_WAIT_TIME ); + fc::wait_for( BROADCAST_WAIT_TIME, [db2] () { + return db2->get_balance( GRAPHENE_NULL_ACCOUNT, asset_id_type() ).amount.value == 1000000; + }); BOOST_CHECK_EQUAL( db1->get_balance( GRAPHENE_NULL_ACCOUNT, asset_id_type() ).amount.value, 1000000 ); BOOST_CHECK_EQUAL( db2->get_balance( GRAPHENE_NULL_ACCOUNT, asset_id_type() ).amount.value, 1000000 ); @@ -345,16 +347,25 @@ BOOST_AUTO_TEST_CASE( two_node_network ) committee_key, database::skip_nothing); + BOOST_CHECK_EQUAL( db1->head_block_num(), 0u ); + BOOST_CHECK_EQUAL( db2->head_block_num(), 1u ); + BOOST_CHECK_EQUAL( block_1.block_num(), 1u ); + BOOST_TEST_MESSAGE( "Broadcasting block" ); app2.p2p_node()->broadcast(graphene::net::block_message( block_1 )); - fc::usleep( BROADCAST_WAIT_TIME ); + fc::wait_for( BROADCAST_WAIT_TIME, [db1] () { + return db1->head_block_num() == 1; + }); BOOST_TEST_MESSAGE( "Verifying nodes are still connected" ); BOOST_CHECK_EQUAL(app1.p2p_node()->get_connection_count(), 1u); BOOST_CHECK_EQUAL(app1.chain_database()->head_block_num(), 1u); BOOST_TEST_MESSAGE( "Checking GRAPHENE_NULL_ACCOUNT has balance" ); + BOOST_CHECK_EQUAL( db1->get_balance( GRAPHENE_NULL_ACCOUNT, asset_id_type() ).amount.value, 1000000 ); + BOOST_CHECK_EQUAL( db2->get_balance( GRAPHENE_NULL_ACCOUNT, asset_id_type() ).amount.value, 1000000 ); + } catch( fc::exception& e ) { edump((e.to_detail_string())); throw;