Closed itsdevbear closed 2 days ago
The changes primarily involve transitioning various data handling mechanisms to more direct and specific methods. This includes replacing ssz.ByteVectorFromBytes
calls with methods that directly handle structures like common.Bytes32
and common.Bytes20
. New type aliases and methods for handling 20-byte arrays (B20) and 32-byte arrays (B32) were introduced, enhancing the serialization and deserialization processes, especially in the context of SSZ encoding.
File | Change Summary |
---|---|
mod/consensus-types/pkg/types/payload_test.go |
Replaced ssz.ByteVectorFromBytes calls with direct methods for handling Bytes32 , Bytes20 . |
mod/engine-primitives/pkg/engine-primitives/... |
Swapped ssz.ByteVectorFromBytes with common.Bytes20 in withdrawal address tests. |
mod/primitives/pkg/bytes/b20.go |
Introduced B20 type and methods for byte manipulation, including JSON and text marshaling. |
mod/primitives/pkg/bytes/b32.go |
Added methods for SSZType interface to enhance B32 serialization and deserialization. |
mod/primitives/pkg/common/common.go |
Added a new alias Bytes20 for bytes.B20 . |
mod/primitives/pkg/ssz/types/common/bytes20.go |
Introduced Bytes20 type with methods for creation, conversion, serialization, and hashing in SSZ. |
(No sequence diagrams generated as the changes are primarily refactorings and enhancements, not altering the high-level control flow.)
In bytes array, our code anew,
Twenty or thirty-two, they flew.
Methods changed, more direct they be,
Encodings smooth as a summer sea.
Tests revised, our code now sings,
Stronger foundations, better things.
Celebrate the bytes in cheer,
The future of code, crystal clear!
[!TIP]
AI model upgrade
## `gpt-4o` model for reviews and chat is now live OpenAI claims that this model is better at understanding and generating code than the previous models. Please join our [Discord Community](https://discord.com/invite/GsXnASn26c) to provide any feedback or to report any issues.
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 70.45%. Comparing base (
071b95a
) to head (2e49ee6
).
Summary by CodeRabbit
New Features
Bytes20
type with various methods for handling, serialization, and hashing of 20-byte arrays.Refactor
Bytes20
andBytes32
.Enhancements
B32
andB20
types.Consistency