-
Notifications
You must be signed in to change notification settings - Fork 312
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
C++: Support zero literal (0x0_address) #682
base: master
Are you sure you want to change the base?
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #682 +/- ##
==========================================
+ Coverage 93.17% 93.20% +0.03%
==========================================
Files 25 25
Lines 3779 3784 +5
Branches 391 392 +1
==========================================
+ Hits 3521 3527 +6
Misses 147 147
+ Partials 111 110 -1 |
@@ -289,7 +289,8 @@ namespace literals | |||
template <typename T> | |||
constexpr T parse(std::string_view s) noexcept | |||
{ | |||
return from_hex<T>(s).value(); | |||
auto const v = from_hex<T>(s); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The failure case is also used for parsing errors, including odd nibbles.
Need to rethink.
@@ -149,6 +149,12 @@ TEST(cpp, std_hash) | |||
std::fill_n(eb.bytes, sizeof(eb), uint8_t{0xee}); | |||
EXPECT_EQ(std::hash<evmc::bytes32>{}(eb), static_cast<size_t>(0xbb14e5c56b477375)); | |||
|
|||
const auto zero_address = 0x0_address; | |||
EXPECT_EQ(zero_address, evmc::address{}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These can be static_asserts I think.
No description provided.