authority_tests.cpp: Insert additional balance checks
This commit is contained in:
parent
1fb1e80a2e
commit
f29ca98b9e
1 changed files with 7 additions and 2 deletions
|
|
@ -468,6 +468,7 @@ BOOST_FIXTURE_TEST_CASE( fired_delegates, database_fixture )
|
||||||
BOOST_CHECK(pid(db).is_authorized_to_execute(&db));
|
BOOST_CHECK(pid(db).is_authorized_to_execute(&db));
|
||||||
|
|
||||||
nathan = &get_account("nathan");
|
nathan = &get_account("nathan");
|
||||||
|
// no money yet
|
||||||
BOOST_CHECK_EQUAL(get_balance(*nathan, asset_id_type()(db)), 5000);
|
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 );
|
PUSH_TX( db, trx, ~0 );
|
||||||
trx.operations.clear();
|
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.
|
//Time passes... the set of active delegates gets updated.
|
||||||
generate_blocks(maintenance_time);
|
generate_blocks(maintenance_time);
|
||||||
//The proposal is no longer authorized, because the active delegates got changed.
|
//The proposal is no longer authorized, because the active delegates got changed.
|
||||||
BOOST_CHECK(!pid(db).is_authorized_to_execute(&db));
|
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.
|
//Time passes... the proposal has now expired.
|
||||||
generate_blocks(pid(db).expiration_time);
|
generate_blocks(pid(db).expiration_time);
|
||||||
BOOST_CHECK(db.find(pid) == nullptr);
|
BOOST_CHECK(db.find(pid) == nullptr);
|
||||||
|
|
||||||
//Nathan didn't get any more money because the proposal was rejected.
|
//Nathan never got any more money because the proposal was rejected.
|
||||||
nathan = &get_account("nathan");
|
|
||||||
BOOST_CHECK_EQUAL(get_balance(*nathan, asset_id_type()(db)), 5000);
|
BOOST_CHECK_EQUAL(get_balance(*nathan, asset_id_type()(db)), 5000);
|
||||||
} FC_LOG_AND_RETHROW() }
|
} FC_LOG_AND_RETHROW() }
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue