Open m-Peter opened 3 weeks ago
The changes involve updates to the Block
structure in models/block.go
, specifically altering the FixedHash
field from a pointer to a string to a value of type gethCommon.Hash
. This simplifies hash handling and improves method logic. Corresponding test files were updated to ensure proper validation of block hashes, and an adjustment was made to the expected block size in a JavaScript test file.
Files | Change Summary |
---|---|
models/block.go , models/block_test.go |
Modified Block structure to change FixedHash from *string to gethCommon.Hash ; updated related methods and tests for hash validation. |
tests/web3js/eth_non_interactive_test.js |
Updated expected value for block.size from 3995n to 4028n in a test case. |
sequenceDiagram
participant Block as Block
participant Hash as Hash
participant Test as Test
Block->>Hash: Set FixedHash to gethCommon.Hash
Hash-->>Block: Return hash value
Test->>Block: Validate block hash
Test-->>Test: Assert hash matches expected value
🐰 In the meadow where bunnies play,
A change was made, hip-hip-hooray!
No more pointers, just a hash,
Simplified logic in a flash!
With tests updated, all is bright,
Hopping forward, what a delight! 🌼✨
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Yeah this is nicer, I did have this approach but with a pointer, I should remove the pointer. I think this is good but I wouldn't do it unless we plan a reindex anyway. So we can keep this in draft until then and add a comment in the description DO NOT MERGE UNLESS REINDEX
Description
It is safer/simpler to use the
gethCommon.Hash
type forFixedHash
, instead of a*string
, all we have to do is check thatFixedHash
is not the empty hash. The problem is that this change will require a re-index, so I am not sure if it is worth it. DO NOT MERGE UNLESS REINDEXFor contributor use:
master
branchFiles changed
in the Github PR explorerSummary by CodeRabbit
New Features
Bug Fixes