Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement BSIP47 account_update_votes_operation #2023

Open
wants to merge 14 commits into
base: hardfork
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add voting_account test
oxarbitrage committed Oct 9, 2019
commit 98060fe5e991196b05630dcacca9e92278776b36
2 changes: 1 addition & 1 deletion libraries/protocol/include/graphene/protocol/account.hpp
Original file line number Diff line number Diff line change
@@ -321,7 +321,7 @@ namespace graphene { namespace protocol {
} } // graphene::protocol

FC_REFLECT( graphene::protocol::additional_account_options,
(committee_voting_account)(witness_voting_account)(worker_voting_account))
(committee_voting_account)(witness_voting_account)(worker_voting_account))
FC_REFLECT(graphene::protocol::account_options, (memo_key)(voting_account)(num_witness)(num_committee)(votes)(extensions))
FC_REFLECT_ENUM( graphene::protocol::account_whitelist_operation::account_listing,
(no_listing)(white_listed)(black_listed)(white_and_black_listed))
17 changes: 16 additions & 1 deletion tests/tests/voting_tests.cpp
Original file line number Diff line number Diff line change
@@ -587,7 +587,7 @@ BOOST_AUTO_TEST_CASE(simple_account_update_votes_operation)
generate_block();
set_expiration( db, trx );

ACTORS((alice));
ACTORS((alice)(bob));
fund(alice);

auto alice_object = get_account("alice");
@@ -673,6 +673,21 @@ BOOST_AUTO_TEST_CASE(simple_account_update_votes_operation)

BOOST_CHECK_EQUAL(alice_object.options.voting_account.instance.value, 5);

// change voting account
{
graphene::chain::account_update_votes_operation op;
op.account = alice_id;
op.voting_account = bob_id;
trx.operations.push_back(op);
sign(trx, alice_private_key);
PUSH_TX(db, trx, ~0);
trx.clear();
}
generate_block();

alice_object = get_account("alice");

BOOST_CHECK_EQUAL(alice_object.options.voting_account.instance.value, bob_id.instance.value);
} FC_LOG_AND_RETHROW()
}