-
-
Notifications
You must be signed in to change notification settings - Fork 804
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
chore[test]: update hexbytes version and tests #3904
Conversation
New and removed dependencies detected. Learn more about Socket for GitHub ↗︎
🚮 Removed packages: pypi/[email protected], pypi/[email protected] |
Codecov ReportAll modified and coverable lines are covered by tests ✅
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## master #3904 +/- ##
==========================================
- Coverage 90.89% 89.14% -1.76%
==========================================
Files 95 95
Lines 14388 14388
Branches 3186 3186
==========================================
- Hits 13078 12826 -252
- Misses 908 1112 +204
- Partials 402 450 +48 ☔ View full report in Codecov by Sentry. |
tests/functional/codegen/calling_convention/test_external_contract_calls.py
Outdated
Show resolved
Hide resolved
tests/functional/codegen/calling_convention/test_external_contract_calls.py
Outdated
Show resolved
Hide resolved
@@ -1,6 +1,10 @@ | |||
from vyper.utils import hex_to_int | |||
|
|||
|
|||
def test_sanity(keccak): |
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.
let's move this to tests/unit
(maybe tests/unit/utils/test_keccak256.py
)
@@ -1,6 +1,10 @@ | |||
from vyper.utils import hex_to_int | |||
|
|||
|
|||
def test_sanity(keccak): | |||
assert keccak(b"").hex() == "c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470" |
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.
add comment - sha3 vs keccak
assert keccak(b"").hex() == "c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470" | |
# ensure keccak is keccak256, not sha3 | |
# https://ethereum.stackexchange.com/a/107985 | |
assert keccak(b"").hex() == "c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470" |
tests/functional/codegen/calling_convention/test_external_contract_calls.py
Show resolved
Hide resolved
@@ -41,7 +41,7 @@ def foo(bar: uint256) -> Bytes[36]: | |||
contract = get_contract(code) | |||
|
|||
# 2fbebd38000000000000000000000000000000000000000000000000000000000000002a | |||
method_id = keccak(text="foo(uint256)").hex()[2:10] # 2fbebd38 | |||
method_id = keccak(b"foo(uint256)").hex()[:8] # 2fbebd38 |
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.
i guess we can use the method_id()
util here to be consistent with the test_variable_assignment
above
update some tests after they were broken by an upstream update. `eth-account` got bumped from 0.11.0 to 0.12.0, which in turn bumped `hexbytes` to 1.2.0. `hexbytes` 1.0.0 had a (long overdue) breaking change, which was to change the `.hex()` method to not prepend "0x". this commit updates our tests accordingly, and does a bit of refactoring in some places to use `bytes` directly instead of `HexBytes` (including that the `keccak` fixture is changed to use vyper.utils.keccak256 instead of the one provided by web3, which returns `HexBytes`). it also cleans up some manual method id calculations with the utility functions. --------- Co-authored-by: Charles Cooper <[email protected]>
What I did
How I did it
How to verify it
Commit message
Description for the changelog
Update hexbytes version
Cute Animal Picture