[SON-HIVE Voting] Refactor SON object to support multiple vote_ids #305

Closed
opened 2022-03-03 18:42:00 +00:00 by serkixenos · 8 comments
serkixenos commented 2022-03-03 18:42:00 +00:00 (Migrated from gitlab.com)

The goal is to separate voting for Bitcoin and Hive SONs, so that they can act independently of each others.
All code affected by this change should be refactored, in a way that enables that Bitcoin SON and Hive SON are considered separate entities.

Current:

   class son_object : public abstract_object<son_object>
   {
      public:
         static const uint8_t space_id = protocol_ids;
         static const uint8_t type_id  = son_object_type;

         account_id_type son_account;
         vote_id_type vote_id;
         uint64_t total_votes = 0;
         string url;
         vesting_balance_id_type deposit;
         public_key_type signing_key;
         vesting_balance_id_type pay_vb;
         son_statistics_id_type statistics;
         son_status status = son_status::inactive;
         flat_map<sidechain_type, string> sidechain_public_keys;

         void pay_son_fee(share_type pay, database& db);
         bool has_valid_config()const;
         bool has_valid_config(time_point_sec head_block_time)const;
   };

Wanted:

   class son_object : public abstract_object<son_object>
   {
      public:
         static const uint8_t space_id = protocol_ids;
         static const uint8_t type_id  = son_object_type;

         account_id_type son_account;
         vote_id_type vote_id_bitcoin;
         vote_id_type vote_id_hive;
         uint64_t total_votes = 0;
         string url;
         vesting_balance_id_type deposit;
         public_key_type signing_key;
         vesting_balance_id_type pay_vb;
         son_statistics_id_type statistics;
         son_status status = son_status::inactive;
         flat_map<sidechain_type, string> sidechain_public_keys;

         void pay_son_fee(share_type pay, database& db);
         bool has_valid_config()const;
         bool has_valid_config(time_point_sec head_block_time)const;
   };
The goal is to separate voting for Bitcoin and Hive SONs, so that they can act independently of each others. All code affected by this change should be refactored, in a way that enables that Bitcoin SON and Hive SON are considered separate entities. Current: ``` class son_object : public abstract_object<son_object> { public: static const uint8_t space_id = protocol_ids; static const uint8_t type_id = son_object_type; account_id_type son_account; vote_id_type vote_id; uint64_t total_votes = 0; string url; vesting_balance_id_type deposit; public_key_type signing_key; vesting_balance_id_type pay_vb; son_statistics_id_type statistics; son_status status = son_status::inactive; flat_map<sidechain_type, string> sidechain_public_keys; void pay_son_fee(share_type pay, database& db); bool has_valid_config()const; bool has_valid_config(time_point_sec head_block_time)const; }; ``` Wanted: ``` class son_object : public abstract_object<son_object> { public: static const uint8_t space_id = protocol_ids; static const uint8_t type_id = son_object_type; account_id_type son_account; vote_id_type vote_id_bitcoin; vote_id_type vote_id_hive; uint64_t total_votes = 0; string url; vesting_balance_id_type deposit; public_key_type signing_key; vesting_balance_id_type pay_vb; son_statistics_id_type statistics; son_status status = son_status::inactive; flat_map<sidechain_type, string> sidechain_public_keys; void pay_son_fee(share_type pay, database& db); bool has_valid_config()const; bool has_valid_config(time_point_sec head_block_time)const; }; ```
hbelakon commented 2022-03-08 04:06:25 +00:00 (Migrated from gitlab.com)

assigned to @serkixenos

assigned to @serkixenos
hbelakon commented 2022-03-08 04:08:17 +00:00 (Migrated from gitlab.com)

changed title from Refactor SON object to support multiple vote_ids to {+[SON-HIVE Voting] +}Refactor SON object to support multiple vote_ids

changed title from **Refactor SON object to support multiple vote_ids** to **{+[SON-HIVE Voting] +}Refactor SON object to support multiple vote_ids**
hbelakon commented 2022-03-08 04:08:29 +00:00 (Migrated from gitlab.com)

@serkixenos please estimate

@serkixenos please estimate
serkixenos commented 2022-03-09 03:02:15 +00:00 (Migrated from gitlab.com)

Base your work on feature/son-for-hive-voting branch

https://gitlab.com/PBSA/peerplays/-/tree/feature/son-for-hive-voting

Base your work on feature/son-for-hive-voting branch https://gitlab.com/PBSA/peerplays/-/tree/feature/son-for-hive-voting
serkixenos commented 2022-03-22 02:09:31 +00:00 (Migrated from gitlab.com)
https://gitlab.com/PBSA/peerplays/-/blob/d39f3f309a8dfb2799fca986d9ac05e40ea09f66/libraries/chain/include/graphene/chain/son_object.hpp#L67
serkixenos (Migrated from gitlab.com) closed this issue 2022-03-22 02:09:42 +00:00
serkixenos commented 2022-03-28 14:12:15 +00:00 (Migrated from gitlab.com)

mentioned in issue #155

mentioned in issue #155
hbelakon commented 2022-04-08 13:53:47 +00:00 (Migrated from gitlab.com)

changed epic to &295

changed epic to &295
hbelakon commented 2022-05-04 18:30:21 +00:00 (Migrated from gitlab.com)

changed epic to &532

changed epic to &532
Sign in to join this conversation.
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: Peerplays_Blockchain/peerplays_migrated#305
No description provided.