diff --git a/libraries/chain/db_init.cpp b/libraries/chain/db_init.cpp index 37ced012..9adbb024 100644 --- a/libraries/chain/db_init.cpp +++ b/libraries/chain/db_init.cpp @@ -415,7 +415,7 @@ void database::init_genesis(const genesis_state_type& genesis_state) a.precision = GRAPHENE_BLOCKCHAIN_PRECISION_DIGITS; a.options.flags = 0; a.options.issuer_permissions = 0; - a.issuer = GRAPHENE_NULL_ACCOUNT; + a.issuer = GRAPHENE_COMMITTEE_ACCOUNT; a.options.core_exchange_rate.base.amount = 1; a.options.core_exchange_rate.base.asset_id = asset_id_type(0); a.options.core_exchange_rate.quote.amount = 1; diff --git a/libraries/wallet/include/graphene/wallet/wallet.hpp b/libraries/wallet/include/graphene/wallet/wallet.hpp index fa48272d..18beea55 100644 --- a/libraries/wallet/include/graphene/wallet/wallet.hpp +++ b/libraries/wallet/include/graphene/wallet/wallet.hpp @@ -1499,6 +1499,20 @@ class wallet_api const variant_object& changed_values, bool broadcast = false); + /** Propose a dividend asset update. + * + * @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 dividend asset parameters to update + * @param broadcast true if you wish to broadcast the transaction + * @return the signed version of the transaction + */ + signed_transaction propose_dividend_asset_update( + const string& proposing_account, + fc::time_point_sec expiration_time, + const variant_object& changed_values, + bool broadcast = false); + /** Approve or disapprove a proposal. * * @param fee_paying_account The account paying the fee for the op. @@ -1761,6 +1775,7 @@ FC_API( graphene::wallet::wallet_api, (get_prototype_operation) (propose_parameter_change) (propose_fee_change) + (propose_dividend_asset_update) (approve_proposal) (dbg_make_uia) (dbg_make_mia) diff --git a/libraries/wallet/wallet.cpp b/libraries/wallet/wallet.cpp index 136e6f2a..a8cf2a21 100644 --- a/libraries/wallet/wallet.cpp +++ b/libraries/wallet/wallet.cpp @@ -2411,6 +2411,46 @@ public: return sign_transaction(tx, broadcast); } + signed_transaction propose_dividend_asset_update( + const string& proposing_account, + fc::time_point_sec expiration_time, + const variant_object& changed_values, + bool broadcast = false) + { + FC_ASSERT( changed_values.contains("asset_to_update") ); + + const chain_parameters& current_params = get_global_properties().parameters; + asset_update_dividend_operation changed_op; + fc::reflector::visit( + fc::from_variant_visitor( changed_values, changed_op ) + ); + + optional asset_to_update = find_asset(changed_op.asset_to_update); + if (!asset_to_update) + FC_THROW("No asset with that symbol exists!"); + + asset_update_dividend_operation update_op; + update_op.issuer = asset_to_update->issuer; + update_op.asset_to_update = asset_to_update->id; + update_op.new_options = changed_op.new_options; + + 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 ); + current_params.current_fees->set_fee( prop_op.proposed_ops.back().op ); + + signed_transaction tx; + tx.operations.push_back(prop_op); + set_operation_fees(tx, current_params.current_fees); + tx.validate(); + + return sign_transaction(tx, broadcast); + } + signed_transaction approve_proposal( const string& fee_paying_account, const string& proposal_id, @@ -3524,6 +3564,16 @@ signed_transaction wallet_api::propose_fee_change( return my->propose_fee_change( proposing_account, expiration_time, changed_fees, broadcast ); } +signed_transaction wallet_api::propose_dividend_asset_update( + const string& proposing_account, + fc::time_point_sec expiration_time, + const variant_object& changed_fees, + bool broadcast /* = false */ + ) +{ + return my->propose_dividend_asset_update( proposing_account, expiration_time, changed_fees, broadcast ); +} + signed_transaction wallet_api::approve_proposal( const string& fee_paying_account, const string& proposal_id, @@ -3534,6 +3584,9 @@ signed_transaction wallet_api::approve_proposal( return my->approve_proposal( fee_paying_account, proposal_id, delta, broadcast ); } + + + global_property_object wallet_api::get_global_properties() const { return my->get_global_properties();