-
Notifications
You must be signed in to change notification settings - Fork 30
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
L2 sync: verify and apply task tests #260
Conversation
ccc2725
to
d590ccb
Compare
826c85c
to
d73d9a3
Compare
/// | ||
/// This function generates an UnverifiedHeader with predefined values, | ||
/// useful for creating consistent test scenarios. | ||
fn create_dummy_unverified_header() -> UnverifiedHeader { |
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.
please include the dummy functions directly in the structure declaration file to enable easy reuse throughout the codebase. For example, the create_dummy_unverified_header function could be modified to take a protocol_version parameter
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 you say structure declaration file, what does it mean? should have these helpers in a different tesl util file?
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.
for example, I would see this function fitting well in the same file as the UnverifiedHeader struct
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 moved it to another file, wdyt?
class_hash: Felt::from_hex_unchecked("0xfedcba0987654321fedcba0987654321fedcba0987654321fedcba0987654321"), | ||
}]; | ||
|
||
let replaced_classes = vec![ReplacedClassItem { |
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 don’t think this case is possible because the contract is not deployed yet. I don’t believe we can use replaced_classes within a single genesis block
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.
here we are doing the functional testing only, hence using dummy values. and I agree this case might not exist in real.
5e87288
to
5bb43a3
Compare
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 good to me. I agree with @jbcaron it would be nice to refactor dummy functions into a separate file. I also left a few minor issues to fix, nothing huge. Ping me once you've done the refactor and I will mark this as approved :)
…nt hash and num function
93dd750
to
71e70ac
Compare
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.
All seems good!
This PR covers the tests for the l2 sync, verify and apply task
Pull Request type
Please add the labels corresponding to the type of changes your PR introduces:
What is the current behavior?
Resolves: #NA
Does this introduce a breaking change?
No