cli_wallet: Improve propose_parameter_change interface

This commit is contained in:
theoreticalbts 2015-09-28 19:35:07 -04:00
parent 650af1778d
commit 96e8f8dd6d
3 changed files with 10 additions and 3 deletions

View file

@ -7,6 +7,7 @@ namespace graphene { namespace chain {
proposal_create_operation proposal_create_operation::committee_proposal(const chain_parameters& global_params, fc::time_point_sec head_block_time )
{
// TODO move this method to unit tests as it is not useful
proposal_create_operation op;
op.expiration_time = head_block_time + global_params.maximum_proposal_lifetime;
op.review_period_seconds = global_params.committee_proposal_review_period;

View file

@ -1267,12 +1267,14 @@ class wallet_api
* desired.
*
* @param proposing_account The account paying the fee to propose the tx
* @param expiration_time Timestamp specifying when the proposal will either take effect or expire.
* @param changed_values The values to change; all other chain parameters are filled in with default values
* @param broadcast true if you wish to broadcast the transaction
* @return the signed version of the transaction
*/
signed_transaction propose_parameter_change(
const string& proposing_account,
fc::time_point_sec expiration_time,
const variant_object& changed_values,
bool broadcast = false);

View file

@ -1965,6 +1965,7 @@ public:
signed_transaction propose_parameter_change(
const string& proposing_account,
fc::time_point_sec expiration_time,
const variant_object& changed_values,
bool broadcast = false)
{
@ -1979,8 +1980,10 @@ public:
committee_member_update_global_parameters_operation update_op;
update_op.new_parameters = new_params;
proposal_create_operation prop_op = proposal_create_operation::committee_proposal(
current_params, get_dynamic_global_properties().time );
proposal_create_operation prop_op;
prop_op.expiration_time = expiration_time;
prop_op.review_period_seconds = current_params.committee_proposal_review_period;
prop_op.fee_paying_account = get_account(proposing_account).id;
prop_op.proposed_ops.emplace_back( update_op );
@ -2863,11 +2866,12 @@ void wallet_api::flood_network(string prefix, uint32_t number_of_transactions)
signed_transaction wallet_api::propose_parameter_change(
const string& proposing_account,
fc::time_point_sec expiration_time,
const variant_object& changed_values,
bool broadcast /* = false */
)
{
return my->propose_parameter_change( proposing_account, changed_values, broadcast );
return my->propose_parameter_change( proposing_account, expiration_time, changed_values, broadcast );
}
signed_transaction wallet_api::propose_fee_change(