-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Refactor LC handlers Tests #14834
base: develop
Are you sure you want to change the base?
Refactor LC handlers Tests #14834
Conversation
|
||
db := dbtesting.SetupDB(t) | ||
db := dbtesting.SetupDB(t) |
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.
This can be done once before all tests
|
||
db := dbtesting.SetupDB(t) | ||
db := dbtesting.SetupDB(t) |
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.
same here
|
||
db := dbtesting.SetupDB(t) | ||
db := dbtesting.SetupDB(t) |
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.
same here
|
||
updates := make([]interfaces.LightClientUpdate, 2) | ||
db := dbtesting.SetupDB(t) |
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.
same here
EnableLightClient: true, | ||
}) | ||
defer resetFn() | ||
db := dbtesting.SetupDB(t) |
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.
same here
config.MaxRequestLightClientUpdates = 2 | ||
params.OverrideBeaconConfig(config) |
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.
same here
}) | ||
|
||
} | ||
t.Run("start period before altair", func(t *testing.T) { | ||
db := dbtesting.SetupDB(t) |
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.
same here
Root: make([]byte, 32), | ||
})) | ||
t.Run("missing update in the middle", func(t *testing.T) { | ||
db := dbtesting.SetupDB(t) |
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.
same here
signedBlock, err := blocks.NewSignedBeaconBlock(block) | ||
require.NoError(t, err) | ||
t.Run("missing update at the beginning", func(t *testing.T) { | ||
db := dbtesting.SetupDB(t) |
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.
same here
} | ||
|
||
func TestLightClientHandler_GetLightClientOptimisticUpdateAltair(t *testing.T) { | ||
func TestLightClientHandler_GetLightClientFinalityUpdate(t *testing.T) { |
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 only have Altair covered
What type of PR is this?
Other
What does this PR do? Why is it needed?
This PR refactors the light client handlers tests, and bundles them together, to make it easier and cleaner to add more tests.
Which issues(s) does this PR fix?
Part of #12991
Other notes for review
I don't think this PR needs a changelog entry since it's not user-facing and it does not add/remove/change functionality.