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

Init BindGen E2E tests #8651

Merged
merged 3 commits into from
Dec 21, 2023
Merged

Init BindGen E2E tests #8651

merged 3 commits into from
Dec 21, 2023

Conversation

spacesailor24
Copy link
Contributor

@spacesailor24 spacesailor24 commented Dec 17, 2023

Adds E2E tests for:

  • fetchContractData
  • compareInitBytecodeWithOp
    • compareDeployedBytecodeWithOp
  • compareBytecodeWithRpc

Additionally:

  • Refactor etherscan client to use Transaction type from Geth instead of custom type
  • Adds two workflow to Circle CI to run once a day and notify on Slack for failures
    1. Generate bindings for remotely sourced contracts
    2. Run E2E tests

@spacesailor24 spacesailor24 force-pushed the wyatt/predeploys/init-e2e-tests branch from 35afa68 to 3247f18 Compare December 17, 2023 00:23
@spacesailor24 spacesailor24 force-pushed the wyatt/predeploys/init-unit-tests branch from 3d16392 to 72fae62 Compare December 17, 2023 00:28
@spacesailor24 spacesailor24 force-pushed the wyatt/predeploys/init-e2e-tests branch 2 times, most recently from a614407 to db51caf Compare December 17, 2023 00:30
@spacesailor24 spacesailor24 marked this pull request as ready for review December 17, 2023 00:39
@spacesailor24 spacesailor24 requested a review from a team as a code owner December 17, 2023 00:39
@spacesailor24 spacesailor24 requested review from trianglesphere, hamdiallam, mds1 and a team and removed request for a team and trianglesphere December 17, 2023 00:39
@spacesailor24 spacesailor24 force-pushed the wyatt/predeploys/init-e2e-tests branch from db51caf to 9cec8dd Compare December 18, 2023 17:54
@spacesailor24 spacesailor24 force-pushed the wyatt/predeploys/init-unit-tests branch from 72fae62 to 256591b Compare December 18, 2023 23:12
@spacesailor24 spacesailor24 requested a review from a team as a code owner December 18, 2023 23:12
@spacesailor24 spacesailor24 removed the request for review from a team December 18, 2023 23:12
@spacesailor24 spacesailor24 force-pushed the wyatt/predeploys/init-unit-tests branch from 263a01b to 2211006 Compare December 19, 2023 04:41
@spacesailor24 spacesailor24 force-pushed the wyatt/predeploys/init-e2e-tests branch 2 times, most recently from 063842e to 8e45789 Compare December 19, 2023 19:16
@spacesailor24 spacesailor24 force-pushed the wyatt/predeploys/init-unit-tests branch from 2211006 to e20ca02 Compare December 20, 2023 01:32
@spacesailor24 spacesailor24 force-pushed the wyatt/predeploys/init-e2e-tests branch from 8e45789 to 6c8cb2a Compare December 20, 2023 01:32
@spacesailor24 spacesailor24 force-pushed the wyatt/predeploys/init-unit-tests branch from e20ca02 to 787bf32 Compare December 20, 2023 01:34
@spacesailor24 spacesailor24 force-pushed the wyatt/predeploys/init-e2e-tests branch from 6c8cb2a to eb9e216 Compare December 20, 2023 01:34
@spacesailor24 spacesailor24 force-pushed the wyatt/predeploys/init-unit-tests branch from 787bf32 to a52992e Compare December 20, 2023 01:40
@spacesailor24 spacesailor24 force-pushed the wyatt/predeploys/init-e2e-tests branch from eb9e216 to b5421fe Compare December 20, 2023 01:40
@spacesailor24 spacesailor24 requested a review from mds1 December 20, 2023 01:41
@spacesailor24 spacesailor24 force-pushed the wyatt/predeploys/init-unit-tests branch from a52992e to 3abbc79 Compare December 21, 2023 00:25
@spacesailor24 spacesailor24 force-pushed the wyatt/predeploys/init-e2e-tests branch from b5421fe to 2da2fac Compare December 21, 2023 00:25
@spacesailor24 spacesailor24 force-pushed the wyatt/predeploys/init-unit-tests branch from 3abbc79 to 97ca42b Compare December 21, 2023 00:32
@spacesailor24 spacesailor24 force-pushed the wyatt/predeploys/init-e2e-tests branch from 2da2fac to 2217b91 Compare December 21, 2023 00:32
Base automatically changed from wyatt/predeploys/init-unit-tests to develop December 21, 2023 02:33
Copy link
Contributor

coderabbitai bot commented Dec 21, 2023

Walkthrough

Walkthrough

The overall changes involve the introduction of new jobs and workflows in the CircleCI configuration for building and testing remote bindings of the bindgen tool. The Makefile, test files, and Go source code have been updated to support end-to-end testing, fetching contract data, and comparing bytecode across Ethereum and Optimism chains. There's a shift towards a more modular and testable codebase with the refactoring of methods and the renaming of types to better reflect their purposes.

Changes

File Path Change Summary
.circleci/config.yml New CircleCI jobs (bindgen-remote, bindgen-test) and a scheduled workflow (scheduled-bindgen) added for build and test automation.
op-bindings/Makefile Added new Makefile target test-bindgen-e2e for running end-to-end tests.
op-bindings/bindgen/fixtures_test.go, op-bindings/bindgen/remote_handlers_test.go Updated and added test cases for fetching contract data, comparing bytecode, and handling failures. Refactoring for global generator instance and new configureGenerator function.
op-bindings/bindgen/generator_remote.go, op-bindings/bindgen/remote_handlers.go Modified FetchDeploymentTx method to return etherscan.Transaction. Split compareBytecodeWithOp into two methods for initialization and deployed bytecode.
op-bindings/etherscan/client.go Renamed TxInfo struct to Transaction and reordered fields. Updated methods to return and operate on Transaction type.

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on X ?


Tips

Chat with CodeRabbit Bot (@coderabbitai)

  • You can reply to a review comment made by CodeRabbit.
  • You can tag CodeRabbit on specific lines of code or files in the PR by tagging @coderabbitai in a comment.
  • You can tag @coderabbitai in a PR comment and ask one-off questions about the PR and the codebase. Use quoted replies to pass the context for follow-up questions.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json

Copy link

codecov bot commented Dec 21, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (fd3e7e8) 34.57% compared to head (30bfcb2) 34.53%.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #8651      +/-   ##
===========================================
- Coverage    34.57%   34.53%   -0.05%     
===========================================
  Files          167      167              
  Lines         7170     7170              
  Branches      1213     1213              
===========================================
- Hits          2479     2476       -3     
- Misses        4539     4544       +5     
+ Partials       152      150       -2     
Flag Coverage Δ
cannon-go-tests 63.48% <ø> (ø)
chain-mon-tests 27.14% <ø> (ø)
common-ts-tests 26.74% <ø> (ø)
contracts-bedrock-tests 20.10% <ø> (-0.15%) ⬇️
contracts-ts-tests 12.25% <ø> (ø)
core-utils-tests 44.03% <ø> (ø)
sdk-next-tests 42.18% <ø> (ø)
sdk-tests 42.18% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

see 3 files with indirect coverage changes

@mslipper mslipper added this pull request to the merge queue Dec 21, 2023
Merged via the queue into develop with commit e5066e3 Dec 21, 2023
@mslipper mslipper deleted the wyatt/predeploys/init-e2e-tests branch December 21, 2023 05:45
roberto-bayardo pushed a commit to roberto-bayardo/optimism that referenced this pull request Dec 21, 2023
* Init BindGen unit tests

* Init BindGen E2E tests
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.

6 participants