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

CCIP-3713 Filtering by the 3rd word in USDC Reader #221

Merged
merged 6 commits into from
Oct 9, 2024

Conversation

mateusz-sekara
Copy link
Contributor

No description provided.

@mateusz-sekara mateusz-sekara changed the title Filtering by the 3rd word using ChainReader CCIP-3713 Filtering by the 3rd word using ChainReader Oct 9, 2024
@mateusz-sekara mateusz-sekara marked this pull request as ready for review October 9, 2024 11:50
@mateusz-sekara mateusz-sekara requested a review from a team as a code owner October 9, 2024 11:50
@mateusz-sekara mateusz-sekara changed the title CCIP-3713 Filtering by the 3rd word using ChainReader CCIP-3713 Filtering by the 3rd word in USDC Reader Oct 9, 2024
pkg/reader/usdc_reader.go Outdated Show resolved Hide resolved
for _, id := range eventIDs {
eventFilter = append(
eventFilter,
query.Comparator(consts.EventFilterCCIPMessageSent,
Copy link
Collaborator

@ilija42 ilija42 Oct 9, 2024

Choose a reason for hiding this comment

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

Name for value filter primitive shouldn't be mixed up with the key name. I would prefer if the comparator was called something like MessageValue. You are essentially filtering for values contained within the EventFilterCCIPMessageSent entity

Copy link
Contributor Author

@mateusz-sekara mateusz-sekara Oct 9, 2024

Choose a reason for hiding this comment

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

I don't follow. Is it about the name of the const (consts.EventFilterCCIPMessageSent) or its value? What do you suggest instead?

Name for value filter primitive shouldn't be mixed up with the key name.

I think it's different, isn't it?
Query key is consts.EventNameCCTPMessageSent, but comparator is consts.EventFilterCCIPMessageSent, am I missing sth?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Sry I misread that multiple times while looking at the code. Still, wouldn't constants like this: consts.CCIPMessageSentValue and for the event itself consts.CCIPMessageSent make more sense?

Copy link
Contributor Author

@mateusz-sekara mateusz-sekara Oct 9, 2024

Choose a reason for hiding this comment

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

Trying to follow existing patters in naming, so I've renamed to

consts.CCTPMessageSentValue // for the comparator
consts.EventNameCCTPMessageSent // kept existing for the event

Copy link
Collaborator

Choose a reason for hiding this comment

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

sgtm

Copy link

github-actions bot commented Oct 9, 2024

Metric usdc-reader-improvements main
Coverage 73.8% 73.8%

Copy link
Contributor

@winder winder left a comment

Choose a reason for hiding this comment

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

neat

@mateusz-sekara mateusz-sekara merged commit 4290917 into main Oct 9, 2024
4 checks passed
@mateusz-sekara mateusz-sekara deleted the usdc-reader-improvements branch October 9, 2024 13:43
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.

3 participants