-
Notifications
You must be signed in to change notification settings - Fork 24
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
Test: Types - ConsensusData #344
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I review this after we conclude on value check
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM just answer my questions and I'll approve
// CapellaBlindedBlockValidation tests a valid consensus data with capella blinded block | ||
func CapellaBlindedBlockValidation() *SpecTest { | ||
panic("implement") | ||
func CapellaBlindedBlockValidation() *ConsensusDataTest { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In Deneb PR we should maybe add tests if they are not there?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, we will
|
||
// ContributionsEncoding tests encoding and decoding contributions | ||
func ContributionsEncoding() *SpecTest { | ||
panic("implement") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this deleted?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's already inside encoding.go
(duplicate)
return &ConsensusDataTest{ | ||
Name: "invalid sync committee", | ||
ConsensusData: cd, | ||
ExpectedError: "could not unmarshal ssz: expected buffer of length 32 receiced 1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there is a typo in the error.. it is from our code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will check
return &ConsensusDataTest{ | ||
Name: "invalid sync committee contribution", | ||
ConsensusData: *cd, | ||
ExpectedError: "could not unmarshal ssz: four", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you know what "four" means here?
it comes from ssz lib
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems to be like an error code or something, that's pretty funny, from the fastssz lib:
if offset > endOffset {
return fmt.Errorf("four")
}
if endOffset > size {
return fmt.Errorf("five")
}
|
||
// ProposerJustifications tests a valid consensus data with proposer justifications | ||
func ProposerJustifications() *SpecTest { | ||
panic("implement") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this deleted?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplicate (same as proposer_valid test)
// SyncCommitteeContributionNoJustifications tests an invalid consensus data with no sync committee contribution pre-consensus justifications | ||
func SyncCommitteeContributionNoJustifications() *ConsensusDataTest { | ||
|
||
// To-do: add error when pre-consensus justification check is added. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this a test todo or we missing this check in general?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when we bring back pre-consensus justification it shouldn't be empty
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@MatheusFranco99
I approve but still answer my questions please 🙏
Implement tests for
ConsensusData
.Tests:
Note: some files were deleted because they had duplicated test specifications.