Added test for serveral proposals with several operations of mixed types.

This commit is contained in:
Apr Team 2018-07-06 16:40:05 +03:00
parent 8094431613
commit 7c47df8a6b

View file

@ -222,8 +222,6 @@ BOOST_AUTO_TEST_CASE( check_fails_for_same_member_create_operations )
{
try
{
ACTORS((alice))
create_proposal(*this, {make_committee_member_create_operation(asset(1000), account_id_type(), "test url")});
auto trx = make_signed_transaction_with_proposed_operation(*this, {make_committee_member_create_operation(asset(1000), account_id_type(), "test url")});
@ -240,8 +238,6 @@ BOOST_AUTO_TEST_CASE( check_passes_for_different_member_create_operations )
{
try
{
ACTORS((alice))
create_proposal(*this, {make_committee_member_create_operation(asset(1000), account_id_type(), "test url")});
auto trx = make_signed_transaction_with_proposed_operation(*this, {make_committee_member_create_operation(asset(1001), account_id_type(), "test url")});
@ -254,4 +250,28 @@ BOOST_AUTO_TEST_CASE( check_passes_for_different_member_create_operations )
}
}
BOOST_AUTO_TEST_CASE( check_failes_for_several_operations_of_mixed_type )
{
try
{
ACTORS((alice))
create_proposal(*this, {make_transfer_operation(account_id_type(), alice_id, asset(500)),
make_committee_member_create_operation(asset(1000), account_id_type(), "test url")});
create_proposal(*this, {make_transfer_operation(account_id_type(), alice_id, asset(501)), //duplicate
make_committee_member_create_operation(asset(1001), account_id_type(), "test url")});
auto trx = make_signed_transaction_with_proposed_operation(*this, {make_transfer_operation(account_id_type(), alice_id, asset(501)), //duplicate
make_committee_member_create_operation(asset(1002), account_id_type(), "test url")});
BOOST_CHECK_THROW(db.check_tansaction_for_duplicated_operations(trx), fc::exception);
}
catch( const fc::exception& e )
{
edump((e.to_detail_string()));
throw;
}
}
BOOST_AUTO_TEST_SUITE_END()