Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Utils library for KAGOME and Libp2p #1813

Closed
kamilsa opened this issue Sep 26, 2023 · 1 comment
Closed

Utils library for KAGOME and Libp2p #1813

kamilsa opened this issue Sep 26, 2023 · 1 comment

Comments

@kamilsa
Copy link
Contributor

kamilsa commented Sep 26, 2023

During internal team discussion it was decided that we need to create a separate library for common utils that are used among KAGOME, Libp2p and possible scale-codec libraries. In future we may easily extend this library, to more easily use it in our projects

Such library can include the following components:

Upgraded outcome::result

It is recognized by the team, that the way current outcome::result is used limits the ability to properly identify the source of error. Currently, it stores std::error_code inside, while internal error type could be extended to keep information such as:

  • Textual explanation of happened error
  • Location of initial error: FILE, LINE params
  • Context in which error happened such as input params of function that was invoked
  • etc...

Optional refence

Currently we manually define std::optional<std::reference_wrapper> in many places in the code. It makes sense to define an optional_reference type that would replace std::optional<std::reference_wrapper>

Buffer, BufferView, Blob

Hex utils

Literals

Literals from common/literals testutil/literals

@turuslan
Copy link
Contributor

turuslan commented May 22, 2024

@kamilsa kamilsa closed this as completed Jul 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants