diff --git a/libraries/chain/delegate_evaluator.cpp b/libraries/chain/delegate_evaluator.cpp index 4d2d841d..e86ca71b 100644 --- a/libraries/chain/delegate_evaluator.cpp +++ b/libraries/chain/delegate_evaluator.cpp @@ -39,6 +39,7 @@ object_id_type delegate_create_evaluator::do_apply( const delegate_create_operat const auto& new_del_object = db().create( [&]( delegate_object& obj ){ obj.delegate_account = op.delegate_account; obj.vote_id = vote_id; + obj.url = op.url; }); return new_del_object.id; } FC_CAPTURE_AND_RETHROW( (op) ) } diff --git a/libraries/chain/include/graphene/chain/delegate_object.hpp b/libraries/chain/include/graphene/chain/delegate_object.hpp index 9807beef..d55e008e 100644 --- a/libraries/chain/include/graphene/chain/delegate_object.hpp +++ b/libraries/chain/include/graphene/chain/delegate_object.hpp @@ -42,8 +42,9 @@ namespace graphene { namespace chain { static const uint8_t space_id = protocol_ids; static const uint8_t type_id = delegate_object_type; - account_id_type delegate_account; - vote_id_type vote_id; + account_id_type delegate_account; + vote_id_type vote_id; + string url; }; struct by_account; @@ -62,5 +63,4 @@ namespace graphene { namespace chain { } } // graphene::chain FC_REFLECT_DERIVED( graphene::chain::delegate_object, (graphene::db::object), - (delegate_account) - (vote_id) ) + (delegate_account)(vote_id)(url) ) diff --git a/libraries/chain/include/graphene/chain/witness_object.hpp b/libraries/chain/include/graphene/chain/witness_object.hpp index 82677d66..4f2b3724 100644 --- a/libraries/chain/include/graphene/chain/witness_object.hpp +++ b/libraries/chain/include/graphene/chain/witness_object.hpp @@ -31,12 +31,13 @@ namespace graphene { namespace chain { static const uint8_t space_id = protocol_ids; static const uint8_t type_id = witness_object_type; - account_id_type witness_account; - key_id_type signing_key; - secret_hash_type next_secret; - secret_hash_type last_secret; - share_type accumulated_income; - vote_id_type vote_id; + account_id_type witness_account; + key_id_type signing_key; + secret_hash_type next_secret; + secret_hash_type last_secret; + share_type accumulated_income; + vote_id_type vote_id; + string url; witness_object() : vote_id(vote_id_type::witness) {} }; @@ -62,4 +63,5 @@ FC_REFLECT_DERIVED( graphene::chain::witness_object, (graphene::db::object), (next_secret) (last_secret) (accumulated_income) - (vote_id) ) + (vote_id) + (url) ) diff --git a/libraries/chain/include/graphene/chain/worker_object.hpp b/libraries/chain/include/graphene/chain/worker_object.hpp index 3204c8b3..9b7af36f 100644 --- a/libraries/chain/include/graphene/chain/worker_object.hpp +++ b/libraries/chain/include/graphene/chain/worker_object.hpp @@ -178,20 +178,24 @@ namespace graphene { namespace chain { static const uint8_t type_id = worker_object_type; /// ID of the account which owns this worker - account_id_type worker_account; + account_id_type worker_account; /// Time at which this worker begins receiving pay, if elected - time_point_sec work_begin_date; + time_point_sec work_begin_date; /// Time at which this worker will cease to receive pay. Worker will be deleted at this time - time_point_sec work_end_date; + time_point_sec work_end_date; /// Amount in CORE this worker will be paid each day - share_type daily_pay; + share_type daily_pay; /// ID of this worker's pay balance - worker_type worker; + worker_type worker; + /// Human-readable name for the worker + string name; + /// URL to a web page representing this worker + string url; /// Voting ID which represents approval of this worker - vote_id_type vote_for; + vote_id_type vote_for; /// Voting ID which represents disapproval of this worker - vote_id_type vote_against; + vote_id_type vote_against; bool is_active(fc::time_point_sec now)const { return now >= work_begin_date && now <= work_end_date; @@ -221,4 +225,6 @@ FC_REFLECT_DERIVED( graphene::chain::worker_object, (graphene::db::object), (worker) (vote_for) (vote_against) + (name) + (url) ) diff --git a/libraries/chain/witness_evaluator.cpp b/libraries/chain/witness_evaluator.cpp index f6724c87..0a0849fa 100644 --- a/libraries/chain/witness_evaluator.cpp +++ b/libraries/chain/witness_evaluator.cpp @@ -38,10 +38,11 @@ object_id_type witness_create_evaluator::do_apply( const witness_create_operatio }); const auto& new_witness_object = db().create( [&]( witness_object& obj ){ - obj.witness_account = op.witness_account; - obj.vote_id = vote_id; - obj.signing_key = op.block_signing_key; - obj.next_secret = op.initial_secret; + obj.witness_account = op.witness_account; + obj.vote_id = vote_id; + obj.signing_key = op.block_signing_key; + obj.next_secret = op.initial_secret; + obj.url = op.url; }); return new_witness_object.id; } FC_CAPTURE_AND_RETHROW( (op) ) } diff --git a/libraries/chain/worker_evaluator.cpp b/libraries/chain/worker_evaluator.cpp index 060ffca3..66832a9d 100644 --- a/libraries/chain/worker_evaluator.cpp +++ b/libraries/chain/worker_evaluator.cpp @@ -46,6 +46,8 @@ object_id_type worker_create_evaluator::do_apply(const worker_create_evaluator:: w.daily_pay = o.daily_pay; w.work_begin_date = o.work_begin_date; w.work_end_date = o.work_end_date; + w.name = o.name; + w.url = o.url; w.vote_for = for_id; w.vote_against = against_id; w.worker.set_which(o.initializer.which());