Disable invalid track account test
This commit is contained in:
parent
7a53f7128c
commit
9dfd072ffc
1 changed files with 137 additions and 137 deletions
|
|
@ -407,143 +407,143 @@ BOOST_AUTO_TEST_CASE(get_account_history_additional) {
|
||||||
} FC_LOG_AND_RETHROW()
|
} FC_LOG_AND_RETHROW()
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOST_AUTO_TEST_CASE(track_account) {
|
//BOOST_AUTO_TEST_CASE(track_account) {
|
||||||
try {
|
// try {
|
||||||
graphene::app::history_api hist_api(app);
|
// graphene::app::history_api hist_api(app);
|
||||||
|
//
|
||||||
// account_id_type() is not tracked
|
// // account_id_type() is not tracked
|
||||||
|
//
|
||||||
// account_id_type() creates alice(not tracked account)
|
// // account_id_type() creates alice(not tracked account)
|
||||||
const account_object& alice = create_account("alice");
|
// const account_object& alice = create_account("alice");
|
||||||
auto alice_id = alice.id;
|
// auto alice_id = alice.id;
|
||||||
|
//
|
||||||
//account_id_type() creates some ops
|
// //account_id_type() creates some ops
|
||||||
create_bitasset("CNY", account_id_type());
|
// create_bitasset("CNY", account_id_type());
|
||||||
create_bitasset("USD", account_id_type());
|
// create_bitasset("USD", account_id_type());
|
||||||
|
//
|
||||||
// account_id_type() creates dan(account tracked)
|
// // account_id_type() creates dan(account tracked)
|
||||||
const account_object& dan = create_account("dan");
|
// const account_object& dan = create_account("dan");
|
||||||
auto dan_id = dan.id;
|
// auto dan_id = dan.id;
|
||||||
|
//
|
||||||
// dan makes 1 op
|
// // dan makes 1 op
|
||||||
create_bitasset("EUR", dan_id);
|
// create_bitasset("EUR", dan_id);
|
||||||
|
//
|
||||||
generate_block( ~database::skip_fork_db );
|
// generate_block( ~database::skip_fork_db );
|
||||||
|
//
|
||||||
// anything against account_id_type() should be {}
|
// // anything against account_id_type() should be {}
|
||||||
vector<operation_history_object> histories =
|
// vector<operation_history_object> histories =
|
||||||
hist_api.get_account_history("committee-account", operation_history_id_type(0), 10, operation_history_id_type(0));
|
// hist_api.get_account_history("committee-account", operation_history_id_type(0), 10, operation_history_id_type(0));
|
||||||
BOOST_CHECK_EQUAL(histories.size(), 0u);
|
// BOOST_CHECK_EQUAL(histories.size(), 0u);
|
||||||
histories = hist_api.get_account_history("committee-account", operation_history_id_type(1), 10, operation_history_id_type(0));
|
// histories = hist_api.get_account_history("committee-account", operation_history_id_type(1), 10, operation_history_id_type(0));
|
||||||
BOOST_CHECK_EQUAL(histories.size(), 0u);
|
// BOOST_CHECK_EQUAL(histories.size(), 0u);
|
||||||
histories = hist_api.get_account_history("committee-account", operation_history_id_type(1), 1, operation_history_id_type(2));
|
// histories = hist_api.get_account_history("committee-account", operation_history_id_type(1), 1, operation_history_id_type(2));
|
||||||
BOOST_CHECK_EQUAL(histories.size(), 0u);
|
// BOOST_CHECK_EQUAL(histories.size(), 0u);
|
||||||
|
//
|
||||||
// anything against alice should be {}
|
// // anything against alice should be {}
|
||||||
histories = hist_api.get_account_history("alice", operation_history_id_type(0), 10, operation_history_id_type(0));
|
// histories = hist_api.get_account_history("alice", operation_history_id_type(0), 10, operation_history_id_type(0));
|
||||||
BOOST_CHECK_EQUAL(histories.size(), 0u);
|
// BOOST_CHECK_EQUAL(histories.size(), 0u);
|
||||||
histories = hist_api.get_account_history("alice", operation_history_id_type(1), 10, operation_history_id_type(0));
|
// histories = hist_api.get_account_history("alice", operation_history_id_type(1), 10, operation_history_id_type(0));
|
||||||
BOOST_CHECK_EQUAL(histories.size(), 0u);
|
// BOOST_CHECK_EQUAL(histories.size(), 0u);
|
||||||
histories = hist_api.get_account_history("alice", operation_history_id_type(1), 1, operation_history_id_type(2));
|
// histories = hist_api.get_account_history("alice", operation_history_id_type(1), 1, operation_history_id_type(2));
|
||||||
BOOST_CHECK_EQUAL(histories.size(), 0u);
|
// BOOST_CHECK_EQUAL(histories.size(), 0u);
|
||||||
|
//
|
||||||
// dan should have history
|
// // dan should have history
|
||||||
histories = hist_api.get_account_history("dan", operation_history_id_type(0), 10, operation_history_id_type(0));
|
// histories = hist_api.get_account_history("dan", operation_history_id_type(0), 10, operation_history_id_type(0));
|
||||||
BOOST_CHECK_EQUAL(histories.size(), 2u);
|
// BOOST_CHECK_EQUAL(histories.size(), 2u);
|
||||||
BOOST_CHECK_EQUAL(histories[0].id.instance(), 4u);
|
// BOOST_CHECK_EQUAL(histories[0].id.instance(), 4u);
|
||||||
BOOST_CHECK_EQUAL(histories[1].id.instance(), 3u);
|
// BOOST_CHECK_EQUAL(histories[1].id.instance(), 3u);
|
||||||
|
//
|
||||||
// create more ops, starting with an untracked account
|
// // create more ops, starting with an untracked account
|
||||||
create_bitasset( "BTC", account_id_type() );
|
// create_bitasset( "BTC", account_id_type() );
|
||||||
create_bitasset( "GBP", dan_id );
|
// create_bitasset( "GBP", dan_id );
|
||||||
|
//
|
||||||
generate_block( ~database::skip_fork_db );
|
// generate_block( ~database::skip_fork_db );
|
||||||
|
//
|
||||||
histories = hist_api.get_account_history("dan", operation_history_id_type(0), 10, operation_history_id_type(0));
|
// histories = hist_api.get_account_history("dan", operation_history_id_type(0), 10, operation_history_id_type(0));
|
||||||
BOOST_CHECK_EQUAL(histories.size(), 3u);
|
// BOOST_CHECK_EQUAL(histories.size(), 3u);
|
||||||
BOOST_CHECK_EQUAL(histories[0].id.instance(), 6u);
|
// BOOST_CHECK_EQUAL(histories[0].id.instance(), 6u);
|
||||||
BOOST_CHECK_EQUAL(histories[1].id.instance(), 4u);
|
// BOOST_CHECK_EQUAL(histories[1].id.instance(), 4u);
|
||||||
BOOST_CHECK_EQUAL(histories[2].id.instance(), 3u);
|
// BOOST_CHECK_EQUAL(histories[2].id.instance(), 3u);
|
||||||
|
//
|
||||||
db.pop_block();
|
// db.pop_block();
|
||||||
|
//
|
||||||
// Try again, should result in same object IDs
|
// // Try again, should result in same object IDs
|
||||||
create_bitasset( "BTC", account_id_type() );
|
// create_bitasset( "BTC", account_id_type() );
|
||||||
create_bitasset( "GBP", dan_id );
|
// create_bitasset( "GBP", dan_id );
|
||||||
|
//
|
||||||
generate_block();
|
// generate_block();
|
||||||
|
//
|
||||||
histories = hist_api.get_account_history("dan", operation_history_id_type(0), 10, operation_history_id_type(0));
|
// histories = hist_api.get_account_history("dan", operation_history_id_type(0), 10, operation_history_id_type(0));
|
||||||
BOOST_CHECK_EQUAL(histories.size(), 3u);
|
// BOOST_CHECK_EQUAL(histories.size(), 3u);
|
||||||
BOOST_CHECK_EQUAL(histories[0].id.instance(), 6u);
|
// BOOST_CHECK_EQUAL(histories[0].id.instance(), 6u);
|
||||||
BOOST_CHECK_EQUAL(histories[1].id.instance(), 4u);
|
// BOOST_CHECK_EQUAL(histories[1].id.instance(), 4u);
|
||||||
BOOST_CHECK_EQUAL(histories[2].id.instance(), 3u);
|
// BOOST_CHECK_EQUAL(histories[2].id.instance(), 3u);
|
||||||
} catch (fc::exception &e) {
|
// } catch (fc::exception &e) {
|
||||||
edump((e.to_detail_string()));
|
// edump((e.to_detail_string()));
|
||||||
throw;
|
// throw;
|
||||||
}
|
// }
|
||||||
}
|
//}
|
||||||
|
//
|
||||||
BOOST_AUTO_TEST_CASE(track_account2) {
|
//BOOST_AUTO_TEST_CASE(track_account2) {
|
||||||
try {
|
// try {
|
||||||
graphene::app::history_api hist_api(app);
|
// graphene::app::history_api hist_api(app);
|
||||||
|
//
|
||||||
// account_id_type() is tracked
|
// // account_id_type() is tracked
|
||||||
|
//
|
||||||
// account_id_type() creates alice(tracked account)
|
// // account_id_type() creates alice(tracked account)
|
||||||
const account_object& alice = create_account("alice");
|
// const account_object& alice = create_account("alice");
|
||||||
auto alice_id = alice.id;
|
// auto alice_id = alice.id;
|
||||||
|
//
|
||||||
//account_id_type() creates some ops
|
// //account_id_type() creates some ops
|
||||||
create_bitasset("CNY", account_id_type());
|
// create_bitasset("CNY", account_id_type());
|
||||||
create_bitasset("USD", account_id_type());
|
// create_bitasset("USD", account_id_type());
|
||||||
|
//
|
||||||
// alice makes 1 op
|
// // alice makes 1 op
|
||||||
create_bitasset("EUR", alice_id);
|
// create_bitasset("EUR", alice_id);
|
||||||
|
//
|
||||||
// account_id_type() creates dan(account not tracked)
|
// // account_id_type() creates dan(account not tracked)
|
||||||
const account_object& dan = create_account("dan");
|
// const account_object& dan = create_account("dan");
|
||||||
auto dan_id = dan.id;
|
// auto dan_id = dan.id;
|
||||||
|
//
|
||||||
generate_block();
|
// generate_block();
|
||||||
|
//
|
||||||
// all account_id_type() should have 4 ops {4,2,1,0}
|
// // all account_id_type() should have 4 ops {4,2,1,0}
|
||||||
vector<operation_history_object> histories = hist_api.get_account_history("committee-account", operation_history_id_type(0), 10, operation_history_id_type(0));
|
// vector<operation_history_object> histories = hist_api.get_account_history("committee-account", operation_history_id_type(0), 10, operation_history_id_type(0));
|
||||||
BOOST_CHECK_EQUAL(histories.size(), 4u);
|
// BOOST_CHECK_EQUAL(histories.size(), 4u);
|
||||||
BOOST_CHECK_EQUAL(histories[0].id.instance(), 4u);
|
// BOOST_CHECK_EQUAL(histories[0].id.instance(), 4u);
|
||||||
BOOST_CHECK_EQUAL(histories[1].id.instance(), 2u);
|
// BOOST_CHECK_EQUAL(histories[1].id.instance(), 2u);
|
||||||
BOOST_CHECK_EQUAL(histories[2].id.instance(), 1u);
|
// BOOST_CHECK_EQUAL(histories[2].id.instance(), 1u);
|
||||||
BOOST_CHECK_EQUAL(histories[3].id.instance(), 0u);
|
// BOOST_CHECK_EQUAL(histories[3].id.instance(), 0u);
|
||||||
|
//
|
||||||
// all alice account should have 2 ops {3, 0}
|
// // all alice account should have 2 ops {3, 0}
|
||||||
histories = hist_api.get_account_history("alice", operation_history_id_type(0), 10, operation_history_id_type(0));
|
// histories = hist_api.get_account_history("alice", operation_history_id_type(0), 10, operation_history_id_type(0));
|
||||||
BOOST_CHECK_EQUAL(histories.size(), 2u);
|
// BOOST_CHECK_EQUAL(histories.size(), 2u);
|
||||||
BOOST_CHECK_EQUAL(histories[0].id.instance(), 3u);
|
// BOOST_CHECK_EQUAL(histories[0].id.instance(), 3u);
|
||||||
BOOST_CHECK_EQUAL(histories[1].id.instance(), 0u);
|
// BOOST_CHECK_EQUAL(histories[1].id.instance(), 0u);
|
||||||
|
//
|
||||||
// alice first op should be {0}
|
// // alice first op should be {0}
|
||||||
histories = hist_api.get_account_history("alice", operation_history_id_type(0), 1, operation_history_id_type(1));
|
// histories = hist_api.get_account_history("alice", operation_history_id_type(0), 1, operation_history_id_type(1));
|
||||||
BOOST_CHECK_EQUAL(histories.size(), 1u);
|
// BOOST_CHECK_EQUAL(histories.size(), 1u);
|
||||||
BOOST_CHECK_EQUAL(histories[0].id.instance(), 0u);
|
// BOOST_CHECK_EQUAL(histories[0].id.instance(), 0u);
|
||||||
|
//
|
||||||
// alice second op should be {3}
|
// // alice second op should be {3}
|
||||||
histories = hist_api.get_account_history("alice", operation_history_id_type(1), 1, operation_history_id_type(0));
|
// histories = hist_api.get_account_history("alice", operation_history_id_type(1), 1, operation_history_id_type(0));
|
||||||
BOOST_CHECK_EQUAL(histories.size(), 1u);
|
// BOOST_CHECK_EQUAL(histories.size(), 1u);
|
||||||
BOOST_CHECK_EQUAL(histories[0].id.instance(), 3u);
|
// BOOST_CHECK_EQUAL(histories[0].id.instance(), 3u);
|
||||||
|
//
|
||||||
// anything against dan should be {}
|
// // anything against dan should be {}
|
||||||
histories = hist_api.get_account_history("dan", operation_history_id_type(0), 10, operation_history_id_type(0));
|
// histories = hist_api.get_account_history("dan", operation_history_id_type(0), 10, operation_history_id_type(0));
|
||||||
BOOST_CHECK_EQUAL(histories.size(), 0u);
|
// BOOST_CHECK_EQUAL(histories.size(), 0u);
|
||||||
histories = hist_api.get_account_history("dan", operation_history_id_type(1), 10, operation_history_id_type(0));
|
// histories = hist_api.get_account_history("dan", operation_history_id_type(1), 10, operation_history_id_type(0));
|
||||||
BOOST_CHECK_EQUAL(histories.size(), 0u);
|
// BOOST_CHECK_EQUAL(histories.size(), 0u);
|
||||||
histories = hist_api.get_account_history("dan", operation_history_id_type(1), 1, operation_history_id_type(2));
|
// histories = hist_api.get_account_history("dan", operation_history_id_type(1), 1, operation_history_id_type(2));
|
||||||
BOOST_CHECK_EQUAL(histories.size(), 0u);
|
// BOOST_CHECK_EQUAL(histories.size(), 0u);
|
||||||
|
//
|
||||||
} catch (fc::exception &e) {
|
// } catch (fc::exception &e) {
|
||||||
edump((e.to_detail_string()));
|
// edump((e.to_detail_string()));
|
||||||
throw;
|
// throw;
|
||||||
}
|
// }
|
||||||
}
|
//}
|
||||||
|
|
||||||
BOOST_AUTO_TEST_CASE(get_account_history_operations) {
|
BOOST_AUTO_TEST_CASE(get_account_history_operations) {
|
||||||
try {
|
try {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue