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

Rework and extend endian-specific conversion API #107

Merged
merged 14 commits into from
Aug 20, 2019
Merged

Rework and extend endian-specific conversion API #107

merged 14 commits into from
Aug 20, 2019

Conversation

chfast
Copy link
Owner

@chfast chfast commented Aug 17, 2019

Closes #105.

This reworks and extends mostly the intx::be API for converting to/from bytes in big-endian order.

The usage is shown in https://github.com/ethereum/evmone/pull/131/files.

After prototyping the usage of new API, I propose further changes:

  • Rename uint<N> to load<uint<N>>. In the end it is more consistent so see be::load<uint256>(...) instead of be::uint<256> and would allow to support other types like be::load<int256>.
  • Rename uint_unsafe() to unsafe_load() or unsafe::load(). The later would allow hiding the "unsafe" mark with using namespace intx::be::unsafe.
  • Rename store_unsafe() to unsafe_store() or unsafe::store().

@codecov-io
Copy link

codecov-io commented Aug 17, 2019

Codecov Report

❗ No coverage uploaded for pull request base (master@9312a4c). Click here to learn what that means.
The diff coverage is 100%.

@@           Coverage Diff            @@
##             master    #107   +/-   ##
========================================
  Coverage          ?   65.1%           
========================================
  Files             ?       8           
  Lines             ?    1410           
  Branches          ?     156           
========================================
  Hits              ?     918           
  Misses            ?     444           
  Partials          ?      48

@axic
Copy link
Collaborator

axic commented Aug 20, 2019

@chfast is this closing #105 ?

@chfast
Copy link
Owner Author

chfast commented Aug 20, 2019

@chfast is this closing #105 ?

Yes.

Copy link
Collaborator

@axic axic left a comment

Choose a reason for hiding this comment

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

I think the API is fine (more readable than before), haven't reviewed the code though.

@chfast chfast merged commit 96afab1 into master Aug 20, 2019
@chfast chfast deleted the be_api2 branch August 20, 2019 13:01
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.

Improve to/from bytes conversions
3 participants