Some improvements for the state package testing#10316
Some improvements for the state package testing#10316prylabs-bulldozer[bot] merged 8 commits intoOffchainLabs:developfrom
Conversation
|
|
||
| type getStateWithLatestBlockHeader func(*ethpb.BeaconBlockHeader) (state.BeaconState, error) | ||
|
|
||
| func VerifyBeaconState_LatestBlockHeader( |
There was a problem hiding this comment.
Is there a particular reason snake case is preferred over camel case? Local IDE (Goland) complained about this
There was a problem hiding this comment.
I am just copying what is the name of the original test: TestBeaconState_LatestBlockHeader
There was a problem hiding this comment.
Then I think camel case is preferred since this is no longer an executable test rather than a test only helper function
|
@terencechain please, check new commit |
rkapka
left a comment
There was a problem hiding this comment.
Please also add state-native/v2/references_test.go and state-native/v3/references_test.go
|
@rkapka done |
|
Thanks! Let's wait for @terencechain's approval before merging |
|
|
|
Hey @leolara , I just checked daaa2f9 and I'm pretty sure what @terencechain meant was to change |
|
@rkapka VerifyBeaconState_LatestBlockHeader or VerifyBeaconStateLatestBlockHeader cannot be private, it is called by the tests of the different state versions. For example: Please let me know if you want the underscore in the name of the public |
|
Thanks for explaining. This looks good to me. |
What type of PR is this?
Refactor
What does this PR do? Why is it needed?
Avoids some code repetition in the state package testing
Which issues(s) does this PR fix?
Related #10047
Other notes for review