Skip to content

Refactor NodeID #767

@gdbelvin

Description

@gdbelvin

NodeID has many different output formats and conversion functions which are scattered throughout the code. It would be great if we could isolate all the formats and conversions to a single API with tests that enforce consistency between the various formats. The idea is that node.ID could be a consistent, easy-to-read package with minimal dependences for all bit and path manipulation purposes.

Proposal:

  • new node package to contain node.ID.
    • Should the package be named nodeid?
  • Make ID's members private if possible to enforce new API use.
  • Use node.ID in place of big.Int
  • Shorten NewNodeIDFrom* functions to NewFrom
  • Use ID in place of Prefix and Suffix since all three use the format "Path + depth"

Other suggestions?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions