From f29ca98b9e8ed21238335e387dddf17a7f057893 Mon Sep 17 00:00:00 2001 From: theoreticalbts Date: Thu, 18 Jun 2015 11:34:42 -0400 Subject: [PATCH] authority_tests.cpp: Insert additional balance checks --- tests/tests/authority_tests.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/tests/authority_tests.cpp b/tests/tests/authority_tests.cpp index cad13bb7..2df5550f 100644 --- a/tests/tests/authority_tests.cpp +++ b/tests/tests/authority_tests.cpp @@ -468,6 +468,7 @@ BOOST_FIXTURE_TEST_CASE( fired_delegates, database_fixture ) BOOST_CHECK(pid(db).is_authorized_to_execute(&db)); nathan = &get_account("nathan"); + // no money yet BOOST_CHECK_EQUAL(get_balance(*nathan, asset_id_type()(db)), 5000); { @@ -481,17 +482,21 @@ BOOST_FIXTURE_TEST_CASE( fired_delegates, database_fixture ) PUSH_TX( db, trx, ~0 ); trx.operations.clear(); } + // still no money + BOOST_CHECK_EQUAL(get_balance(*nathan, asset_id_type()(db)), 5000); //Time passes... the set of active delegates gets updated. generate_blocks(maintenance_time); //The proposal is no longer authorized, because the active delegates got changed. BOOST_CHECK(!pid(db).is_authorized_to_execute(&db)); + // still no money + BOOST_CHECK_EQUAL(get_balance(*nathan, asset_id_type()(db)), 5000); + //Time passes... the proposal has now expired. generate_blocks(pid(db).expiration_time); BOOST_CHECK(db.find(pid) == nullptr); - //Nathan didn't get any more money because the proposal was rejected. - nathan = &get_account("nathan"); + //Nathan never got any more money because the proposal was rejected. BOOST_CHECK_EQUAL(get_balance(*nathan, asset_id_type()(db)), 5000); } FC_LOG_AND_RETHROW() }