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

L1Messenger Tests #150

Merged

Conversation

neotheprogramist
Copy link
Contributor

No description provided.

Copy link
Collaborator

@StanislavBreadless StanislavBreadless left a comment

Choose a reason for hiding this comment

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

Thank you for adding additional tests for this function. I think there are lot of places where code repetition could be reduced:

  • In lots of places a large const totalL2ToL1PubdataAndStateDiffs = ethers.utils.concat is done, with almost the same values everywhere.
  • Also, const numberOfLogsBytes = ethers.utils.hexZeroPad(ethers.utils.hexlify(numberOfLogs), 4); this part is often repeated.

It is better to move all these methods to a separate functions, where we modify only things that really change between various tests

system-contracts/test/L1Messenger.spec.ts Outdated Show resolved Hide resolved
system-contracts/test/L1Messenger.spec.ts Outdated Show resolved Hide resolved
system-contracts/test/L1Messenger.spec.ts Outdated Show resolved Hide resolved
system-contracts/test/L1Messenger.spec.ts Show resolved Hide resolved
system-contracts/test/L1Messenger.spec.ts Outdated Show resolved Hide resolved
system-contracts/test/L1Messenger.spec.ts Outdated Show resolved Hide resolved
system-contracts/test/L1Messenger.spec.ts Outdated Show resolved Hide resolved
system-contracts/test/L1Messenger.spec.ts Outdated Show resolved Hide resolved
system-contracts/test/L1Messenger.spec.ts Outdated Show resolved Hide resolved
system-contracts/test/L1Messenger.spec.ts Outdated Show resolved Hide resolved
system-contracts/test/L1Messenger.spec.ts Outdated Show resolved Hide resolved
system-contracts/test/L1Messenger.spec.ts Outdated Show resolved Hide resolved
system-contracts/test/L1Messenger.spec.ts Outdated Show resolved Hide resolved
system-contracts/test/L1Messenger.spec.ts Outdated Show resolved Hide resolved
system-contracts/test/L1Messenger.spec.ts Outdated Show resolved Hide resolved
system-contracts/test/L1Messenger.spec.ts Outdated Show resolved Hide resolved
system-contracts/test/L1Messenger.spec.ts Outdated Show resolved Hide resolved
system-contracts/test/L1Messenger.spec.ts Show resolved Hide resolved
system-contracts/test/L1Messenger.spec.ts Outdated Show resolved Hide resolved
system-contracts/test/L1Messenger.spec.ts Outdated Show resolved Hide resolved
system-contracts/test/L1Messenger.spec.ts Outdated Show resolved Hide resolved
system-contracts/test/L1Messenger.spec.ts Outdated Show resolved Hide resolved
system-contracts/test/L1Messenger.spec.ts Outdated Show resolved Hide resolved
Copy link
Collaborator

@StanislavBreadless StanislavBreadless left a comment

Choose a reason for hiding this comment

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

👍 Just a few more polishing and we are done

system-contracts/test/L1Messenger.spec.ts Outdated Show resolved Hide resolved
system-contracts/test/L1Messenger.spec.ts Outdated Show resolved Hide resolved
system-contracts/test/shared/utils.ts Outdated Show resolved Hide resolved
system-contracts/test/shared/utils.ts Show resolved Hide resolved
system-contracts/test/shared/utils.ts Outdated Show resolved Hide resolved
@StanislavBreadless StanislavBreadless merged commit 5f2dc1f into matter-labs:dev Jan 23, 2024
16 checks passed
matzayonc pushed a commit to neotheprogramist/era-contracts that referenced this pull request Mar 1, 2024
Co-authored-by: Uacias <filgum0326@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants