Cleanup balance_object_test a bit

This commit is contained in:
Nathan Hourt 2015-06-30 10:25:46 -04:00
parent 417f869dea
commit 6aae0d8314

View file

@ -949,13 +949,13 @@ BOOST_AUTO_TEST_CASE( balance_object_test )
database db;
fc::temp_directory td;
genesis_state.initial_balances.push_back({generate_private_key("n").get_public_key(), GRAPHENE_SYMBOL, 1});
genesis_state.initial_balances.push_back({generate_private_key("m").get_public_key(), GRAPHENE_SYMBOL, 1});
genesis_state.initial_balances.push_back({generate_private_key("x").get_public_key(), GRAPHENE_SYMBOL, 1});
genesis_state.initial_accounts.emplace_back("n", generate_private_key("n").get_public_key(), false);
db.open(td.path(), genesis_state);
const balance_object& balance = *db.get_index_type<balance_index>().indices().find(balance_id_type());
BOOST_CHECK_EQUAL(balance.balance.amount.value, 1);
BOOST_CHECK_EQUAL(db.get_index_type<balance_index>().indices().find(balance_id_type())->balance.amount.value, 1);
BOOST_CHECK_EQUAL(db.get_index_type<balance_index>().indices().find(balance_id_type(1))->balance.amount.value, 1);
balance_claim_operation op;
op.deposit_to_account = db.get_index_type<account_index>().indices().get<by_name>().find("n")->get_id();
@ -971,7 +971,6 @@ BOOST_AUTO_TEST_CASE( balance_object_test )
trx.operations = {op};
trx.sign(*op.owners.begin(), generate_private_key("n"));
trx.sign(op.deposit_to_account(db).active.get_keys().front(), generate_private_key("n"));
// Fail because I'm claiming the wrong address
db.push_transaction(trx);
// Not using fixture's get_balance() here because it uses fixture's db, not my override