-
Notifications
You must be signed in to change notification settings - Fork 65
apollo_l1_provider: add test for each type of L1 event we filter on #10595
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
Conversation
ced54e6 to
c8ac80b
Compare
6306f96 to
a25602c
Compare
c8ac80b to
c242676
Compare
a25602c to
aa4b181
Compare
c242676 to
56deace
Compare
ShahakShama
left a comment
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.
@ShahakShama reviewed 8 of 8 files at r1, all commit messages.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @guy-starkware)
crates/apollo_l1_provider/tests/flow_test_event_filters.rs line 41 at r1 (raw file):
const FAKE_HASH: &str = "0x1234567890123456789012345678901234567890123456789012345678901234"; // Each function signature is hashed using keccak257 to get the selector.
257? not 256?
crates/apollo_l1_provider/tests/flow_test_event_filters.rs line 44 at r1 (raw file):
// For example, LogMessageToL2(address,uint256,uint256,uint256[],uint256,uint256) // becomes "db80dd488acf86d17c747445b0eabb5d57c541d3bd7b6b87af987858e5066b2b". fn filter_to_hash(filter: &str) -> String {
I personally like putting tests at the top of the file and util functions at the bottom, but I leave it up to you
crates/apollo_l1_provider/tests/flow_test_event_filters.rs line 143 at r1 (raw file):
#[tokio::test] async fn all_event_types_must_be_filtered_and_parsed() {
What about the other test? Where an event that shouldn't be parsed is generated and we make sure we don't parse it?
I'm ok with doing it in a different PR
crates/apollo_l1_provider/tests/flow_test_event_filters.rs line 143 at r1 (raw file):
#[tokio::test] async fn all_event_types_must_be_filtered_and_parsed() {
Consider splitting this test to a test for each event
aa4b181 to
59d2d3c
Compare
56deace to
a9af227
Compare
guy-starkware
left a comment
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.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @ShahakShama)
crates/apollo_l1_provider/tests/flow_test_event_filters.rs line 41 at r1 (raw file):
Previously, ShahakShama wrote…
257? not 256?
Oops!
crates/apollo_l1_provider/tests/flow_test_event_filters.rs line 44 at r1 (raw file):
Previously, ShahakShama wrote…
I personally like putting tests at the top of the file and util functions at the bottom, but I leave it up to you
I agree in this case it is better.
crates/apollo_l1_provider/tests/flow_test_event_filters.rs line 143 at r1 (raw file):
Previously, ShahakShama wrote…
What about the other test? Where an event that shouldn't be parsed is generated and we make sure we don't parse it?
I'm ok with doing it in a different PR
I will look into it. I'm not sure if we have another event like that in the contract... In any case, different PR.
crates/apollo_l1_provider/tests/flow_test_event_filters.rs line 143 at r1 (raw file):
Previously, ShahakShama wrote…
Consider splitting this test to a test for each event
I will consider it :)
a9af227 to
83fc919
Compare
guy-starkware
left a comment
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.
Reviewable status: 7 of 8 files reviewed, 4 unresolved discussions (waiting on @ShahakShama)
crates/apollo_l1_provider/tests/flow_test_event_filters.rs line 143 at r1 (raw file):
Previously, guy-starkware wrote…
I will consider it :)
Having considered it, it will cause us to skip a very important step: checking that every item in event_identifiers_to_track() is represented in our parsing code. If we do a separate test for each, we'd have to remember to manually add any new log types.
83fc919 to
7fe085f
Compare
59d2d3c to
7be8f82
Compare
guy-starkware
left a comment
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.
Reviewable status: 7 of 8 files reviewed, 4 unresolved discussions (waiting on @ShahakShama)
crates/apollo_l1_provider/tests/flow_test_event_filters.rs line 143 at r1 (raw file):
Previously, guy-starkware wrote…
I will look into it. I'm not sure if we have another event like that in the contract... In any case, different PR.
So I'm going to add a test that LogMessageToL1 does not get filtered. It will be on the top of the PR stack.
7be8f82 to
b36b631
Compare
d6d06ae to
c60c9cd
Compare
b36b631 to
3fe86e2
Compare
3fe86e2 to
f6794de
Compare
c60c9cd to
877a4c9
Compare
877a4c9 to
961e73b
Compare
f6794de to
18cd126
Compare
guy-starkware
left a comment
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.
@guy-starkware reviewed 2 of 10 files at r4, 8 of 8 files at r6, all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @guy-starkware)

No description provided.