Skip to content
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

Add jsons #357

Merged
merged 9 commits into from
Feb 1, 2024
Merged

Add jsons #357

merged 9 commits into from
Feb 1, 2024

Conversation

GalRogozinski
Copy link
Contributor

Description

Add state comparison jsons for types and signedMessage.
Now any change in the tests is easily detectable.

@@ -66,6 +67,8 @@ func (test *CreateMsgSpecTest) Run(t *testing.T) {
require.Fail(t, "post state not equal", diff)
}
require.EqualValues(t, test.ExpectedRoot, hex.EncodeToString(r[:]))

typescomparable.CompareWithJson(t, test, test.TestName(), reflect.TypeOf(test).String())
Copy link
Contributor

@moshe-blox moshe-blox Feb 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is the point of this if the root is being compared just above? just so we can see the diffs in the console?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the above root test is just a check on the expected root of the created message.
But, the CompareWithJson should show us any difference in the test "content".
@GalRogozinski correct me if I'm wrong

Comment on lines +42 to +45
for _, testF := range spectest.AllTests {
// generate post state comparison
writeJsonStateComparison(testF.TestName(), reflect.TypeOf(testF).String(), testF)
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is the crux of it, right?

if ConsensusData/SSVMessage/SignedMessage roots changed, then we'll see it in the GitHub diff?

@GalRogozinski GalRogozinski merged commit 5533f13 into ssvlabs:fix-deneb Feb 1, 2024
2 checks passed
@GalRogozinski GalRogozinski deleted the add-jsons branch February 1, 2024 12:23
moshe-blox pushed a commit to moshe-blox/ssv-spec that referenced this pull request Feb 1, 2024
* create jsons

* compare with jsons

* generate jsons for qbft signed message

* compare qbft signed message with json state

* fix lint error

* generate jsons for create msg test

* generate jsons for create msg test

* use correct test type

* use correct test name
GalRogozinski added a commit that referenced this pull request Feb 1, 2024
…compatibility (#362)

* Revert "Deneb Support (#324)"

This reverts commit f2d5899.

* Add jsons (#357)

* create jsons

* compare with jsons

* generate jsons for qbft signed message

* compare qbft signed message with json state

* fix lint error

* generate jsons for create msg test

* generate jsons for create msg test

* use correct test type

* use correct test name

* Return deneb with old encoding (#360)

* Revert "Revert "Deneb Support (#324)""

This reverts commit 0a559e2.

* use custom old encodings

* generate-jsons

* Add phase0 version

* Bellatrix -> Capella on a single test

* Generate jsons

* Revert Capella -> Deneb on a single test

---------

Co-authored-by: MatheusFranco99 <48058141+MatheusFranco99@users.noreply.github.com>

---------

Co-authored-by: MatheusFranco99 <48058141+MatheusFranco99@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants