Commit f3b4db4
authored
fix: align HexBytes32 hash with bytes (#258)
## Summary
Align HexBytes32 hashing with bytes to restore the hash/equality
contract for dict/set keys.
## Changes
- Use `bytes.__hash__` in `HexBytes32.__hash__`.
- Assert hash parity with `bytes(hb)` in
`test_hexbytes32_repr_hex_strip_hash`.
## Testing
- `./.venv/bin/python -m pytest`
- Compiled extension loaded:
`evmspec/_new.cpython-313-x86_64-linux-gnu.so`
## Risk and rollback
- Low risk: only hash value changes. Roll back by reverting this commit.1 parent 27deabe commit f3b4db4
2 files changed
+1
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
418 | 418 | | |
419 | 419 | | |
420 | 420 | | |
421 | | - | |
422 | | - | |
423 | | - | |
424 | | - | |
425 | 421 | | |
426 | 422 | | |
427 | 423 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
80 | | - | |
| 80 | + | |
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
| |||
0 commit comments