Skip to content

Commit

Permalink
add test for invalid voting account
Browse files Browse the repository at this point in the history
  • Loading branch information
jmjatlanta authored and abitmore committed Aug 8, 2018
1 parent 800e58d commit cef14fe
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions tests/tests/voting_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -393,4 +393,28 @@ BOOST_AUTO_TEST_CASE(track_votes_committee_disabled)
} FC_LOG_AND_RETHROW()
}

BOOST_AUTO_TEST_CASE(invalid_voting_account)
{
ACTORS((alice));

account_id_type invalid_account_id;
invalid_account_id.instance = 99999;

graphene::chain::account_update_operation op;
op.account = alice_id;
op.new_options = alice.options;
op.new_options->voting_account = invalid_account_id;
trx.operations.push_back(op);
sign(trx, alice_private_key);
try
{
PUSH_TX(db, trx, ~0);
BOOST_FAIL("Updating an account with an invalid voting account should fail.");
}
catch (fc::exception& ex)
{
// We should end up here
}
}

BOOST_AUTO_TEST_SUITE_END()

0 comments on commit cef14fe

Please sign in to comment.