[SON-HIVE Voting] Refactor all the places we use sidechain_type directly #339

Closed
opened 2022-04-07 09:25:37 +00:00 by vampik · 14 comments
vampik commented 2022-04-07 09:25:37 +00:00 (Migrated from gitlab.com)

There are places in code where we call sidechain_type::bitcoin or sidechain_type::hive directly.

Like this:

flat_map<sidechain_type, vector<std::reference_wrapper<const son_object> > > sons;
sons[sidechain_type::bitcoin] = sort_votable_objects<son_index>(sidechain_type::bitcoin, cp.maximum_son_count());
sons[sidechain_type::hive] = sort_votable_objects<son_index>(sidechain_type::hive, cp.maximum_son_count());

Need to refactor those places to use a more generic way. Like this:

for(const auto& active_sidechain_type : active_sidechain_types)
{
  sons[active_sidechain_type] = sort_votable_objects<son_index>(active_sidechain_type, cp.maximum_son_count());
}
There are places in code where we call `sidechain_type::bitcoin` or `sidechain_type::hive` directly. Like this: ``` flat_map<sidechain_type, vector<std::reference_wrapper<const son_object> > > sons; sons[sidechain_type::bitcoin] = sort_votable_objects<son_index>(sidechain_type::bitcoin, cp.maximum_son_count()); sons[sidechain_type::hive] = sort_votable_objects<son_index>(sidechain_type::hive, cp.maximum_son_count()); ``` Need to refactor those places to use a more generic way. Like this: ``` for(const auto& active_sidechain_type : active_sidechain_types) { sons[active_sidechain_type] = sort_votable_objects<son_index>(active_sidechain_type, cp.maximum_son_count()); } ```
vampik commented 2022-04-07 09:25:37 +00:00 (Migrated from gitlab.com)

assigned to @vampik

assigned to @vampik
vampik commented 2022-04-07 10:42:26 +00:00 (Migrated from gitlab.com)

mentioned in commit ac3e16aca0

mentioned in commit ac3e16aca0cab6d6b533aaa3e1d229aba1a38d77
vampik commented 2022-04-07 10:42:26 +00:00 (Migrated from gitlab.com)

mentioned in commit 626633c9b6

mentioned in commit 626633c9b6263a04b748d0b4a7e316150a081cab
vampik commented 2022-04-08 06:14:42 +00:00 (Migrated from gitlab.com)

mentioned in commit 8f2c1b06b1

mentioned in commit 8f2c1b06b1ff001e617f4970604c856f048440ef
vampik commented 2022-04-08 06:14:42 +00:00 (Migrated from gitlab.com)

mentioned in commit b09c22b224

mentioned in commit b09c22b224bdfd6c62d23d2bcc8b84c0adadf039
vampik commented 2022-04-08 06:14:42 +00:00 (Migrated from gitlab.com)

mentioned in commit 8bb452858c

mentioned in commit 8bb452858c970b4b704c4041c35cc30aacc4fd99
vampik commented 2022-04-08 06:14:42 +00:00 (Migrated from gitlab.com)

mentioned in commit e58b7d6916

mentioned in commit e58b7d6916cf2aec169e46550f66eec44b77f506
hbelakon commented 2022-04-08 14:50:27 +00:00 (Migrated from gitlab.com)

changed epic to &295

changed epic to &295
vampik commented 2022-04-11 07:41:36 +00:00 (Migrated from gitlab.com)

mentioned in commit aa3da2cf62

mentioned in commit aa3da2cf6218408c607032a2cfc9cf391031667c
vampik commented 2022-04-11 08:40:13 +00:00 (Migrated from gitlab.com)

mentioned in merge request !97

mentioned in merge request !97
vampik commented 2022-04-11 09:44:17 +00:00 (Migrated from gitlab.com)

mentioned in commit 508711f764

mentioned in commit 508711f76442e612dd84bb46e825407e2044d8e5
vampik commented 2022-04-12 16:39:05 +00:00 (Migrated from gitlab.com)

mentioned in commit 15381e90ca

mentioned in commit 15381e90ca4afd150f08d6aaf09b94136665264d
serkixenos commented 2022-04-12 16:39:05 +00:00 (Migrated from gitlab.com)

mentioned in commit 86366f4aec

mentioned in commit 86366f4aec27ecbf2bcbb12a07b6cbc3185578fc
serkixenos (Migrated from gitlab.com) closed this issue 2022-04-12 16:39:54 +00:00
hbelakon commented 2022-05-04 17:48:32 +00:00 (Migrated from gitlab.com)

changed epic to &529

changed epic to &529
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#339
No description provided.