Skip to content

Rename enum utilities for clarity and refactor#4992

Merged
pwojcikdev merged 3 commits intonanocurrency:developfrom
pwojcikdev:enum-util-rename
Jan 20, 2026
Merged

Rename enum utilities for clarity and refactor#4992
pwojcikdev merged 3 commits intonanocurrency:developfrom
pwojcikdev:enum-util-rename

Conversation

@pwojcikdev
Copy link
Contributor

No description provided.

@gr0vity-dev-bot
Copy link

gr0vity-dev-bot commented Jan 19, 2026

Test Results for Commit cd20846

Pull Request 4992: Results
Overall Status:

Test Case Results

  • 5n4pr_conf_10k_bintree: PASS (Duration: 770s)
  • 5n4pr_conf_10k_change: PASS (Duration: 778s)
  • 5n4pr_conf_change_dependant: PASS (Duration: 789s)
  • 5n4pr_conf_change_independant: PASS (Duration: 796s)
  • 5n4pr_conf_send_dependant: PASS (Duration: 773s)
  • 5n4pr_conf_send_independant: PASS (Duration: 134s)
  • 5n4pr_rocks_10k_bintree: PASS (Duration: 767s)
  • 5n4pr_rocks_10k_change: FAIL (Duration: 923s)
  • Log

Last updated: 2026-01-19 21:54:05 UTC

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors the enum utility functions to improve clarity and code organization. The changes move enum utilities from a nested nano::enum_util namespace directly into the nano namespace with clearer, more descriptive function names.

Changes:

  • Renamed enum utility functions with more descriptive names (nameenum_to_string, valuesenum_values, try_parseenum_try_parse, parseenum_parse, castenum_convert)
  • Replaced runtime validation with compile-time concept enum_convertible_to for type-safe enum conversions
  • Added enum_bitset type alias and improved documentation throughout

Reviewed changes

Copilot reviewed 22 out of 22 changed files in this pull request and generated no comments.

Show a summary per file
File Description
nano/lib/enum_util.hpp Core refactoring: removes nested namespace, renames functions, adds compile-time concept for enum conversion validation, and adds enum_bitset type alias
nano/core_test/enums.cpp Updates all test cases to use new function names
nano/benchmarks/stats.cpp Updates benchmark code to use enum_values
nano/lib/block_type.cpp Updates to use enum_to_string
nano/lib/logging_enums.cpp Updates to use enum_to_string, enum_values, and enum_try_parse
nano/lib/stats_enums.cpp Updates to use enum_to_string
nano/lib/thread_roles.cpp Updates to use enum_to_string
nano/messages/deserialize_message.cpp Updates to use enum_convert and enum_to_string
nano/messages/message_type.cpp Updates to use enum_convert and enum_to_string
nano/node/active_elections.cpp Updates to use enum_convert and enum_to_string
nano/node/block_source.cpp Updates to use enum_convert and enum_to_string
nano/node/bootstrap/bootstrap_service.cpp Updates to use enum_convert
nano/node/election.cpp Updates to use enum_convert and enum_to_string
nano/node/rep_tiers.cpp Updates to use enum_convert
nano/node/transport/message_deserializer.cpp Updates to use enum_convert and enum_to_string
nano/node/transport/tcp_listener.cpp Updates to use enum_to_string
nano/node/transport/tcp_socket.cpp Updates to use enum_to_string
nano/node/transport/traffic_type.cpp Updates to use enum_convert, enum_to_string, and enum_values
nano/node/vote_rebroadcaster.cpp Updates to use enum_convert
nano/node/vote_router.cpp Updates to use enum_convert and enum_to_string
nano/secure/common.cpp Updates to use enum_convert and enum_to_string
nano/store/common.cpp Updates to use enum_to_string

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@pwojcikdev pwojcikdev merged commit 6827411 into nanocurrency:develop Jan 20, 2026
31 of 32 checks passed
@pwojcikdev pwojcikdev deleted the enum-util-rename branch January 20, 2026 10:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants