-
Notifications
You must be signed in to change notification settings - Fork 19
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
starknet monitoring: paginate events #506
Conversation
Quality Gate failedFailed conditions |
chunk, err := c.r.Events(ctx, input) | ||
events = chunk.Events | ||
|
||
// TODO: check events.isLastPage, query more if needed |
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 todo was never implemented, so this PR is doing it (basically)
t.Run("get new transmission event", func(t *testing.T) { | ||
events, err := client.NewTransmissionsFromEventsAt(context.Background(), contractAddress, 123) | ||
require.NoError(t, err) | ||
assert.Len(t, events, 15) |
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.
just assert that we did in fact paginate to get 15 results. if we didn't then we'd only get 10 results
|
||
configSetSelector := starknetutils.GetSelectorFromNameFelt("ConfigSet") | ||
|
||
if eventsReq.EventFilter.Keys[0][0].Equal(configSetSelector) { |
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.
way to distinguish what mocked result to return to the client
https://smartcontract-it.atlassian.net/browse/BCI-3958
monitor was broken because the pagination was never implemented, so for blocks with more than 10 events of the same type, it may be impossible to find the transmission event