I am a new learner of C++ , and try to leaning BTS code
but there are so many questions. BM ,can you answer the question
there are many operations of BTS , but all operations use same function
return sign_transaction( tx, broadcast );
to finish sign.
signed_transaction set_desired_witness_and_committee_member_count(string account_to_modify,
uint16_t desired_number_of_witnesses,
uint16_t desired_number_of_committee_members,
bool broadcast /* = false */)
{ try {
account_object account_object_to_modify = get_account(account_to_modify);
if (account_object_to_modify.options.num_witness == desired_number_of_witnesses &&
account_object_to_modify.options.num_committee == desired_number_of_committee_members)
FC_THROW("Account ${account} is already voting for ${witnesses} witnesses and ${committee_members} committee_members",
("account", account_to_modify)("witnesses", desired_number_of_witnesses)("committee_members",desired_number_of_witnesses));
account_object_to_modify.options.num_witness = desired_number_of_witnesses;
account_object_to_modify.options.num_committee = desired_number_of_committee_members;
account_update_operation account_update_op;
account_update_op.account = account_object_to_modify.id;
account_update_op.new_options = account_object_to_modify.options;
signed_transaction tx;
tx.operations.push_back( account_update_op );
set_operation_fees( tx, _remote_db->get_global_properties().parameters.current_fees);
tx.validate();
return sign_transaction( tx, broadcast );
} FC_CAPTURE_AND_RETHROW( (account_to_modify)(desired_number_of_witnesses)(desired_number_of_committee_members)(broadcast) ) }
signed_transaction set_voting_proxy(string account_to_modify,
optional<string> voting_account,
bool broadcast /* = false */)
{ try {
account_object account_object_to_modify = get_account(account_to_modify);
if (voting_account)
{
account_id_type new_voting_account_id = get_account_id(*voting_account);
if (account_object_to_modify.options.voting_account == new_voting_account_id)
FC_THROW("Voting proxy for ${account} is already set to ${voter}", ("account", account_to_modify)("voter", *voting_account));
account_object_to_modify.options.voting_account = new_voting_account_id;
}
else
{
if (account_object_to_modify.options.voting_account == GRAPHENE_PROXY_TO_SELF_ACCOUNT)
FC_THROW("Account ${account} is already voting for itself", ("account", account_to_modify));
account_object_to_modify.options.voting_account = GRAPHENE_PROXY_TO_SELF_ACCOUNT;
}
account_update_operation account_update_op;
account_update_op.account = account_object_to_modify.id;
account_update_op.new_options = account_object_to_modify.options;
signed_transaction tx;
tx.operations.push_back( account_update_op );
set_operation_fees( tx, _remote_db->get_global_properties().parameters.current_fees);
tx.validate();
return sign_transaction( tx, broadcast );
} FC_CAPTURE_AND_RETHROW( (account_to_modify)(voting_account)(broadcast) ) }
though tx.operations is different . but how to finish this operation, I cannot find the specific code
BM ,can you answer the question ,