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

Migrate account:register to anvil #243

Merged
merged 13 commits into from
May 22, 2024

Conversation

shazarre
Copy link
Contributor

@shazarre shazarre commented May 16, 2024

Description

This PR introduces a way to test against an anvil instance instead of currently used ganache. As a proof of concept "account:register" CLI command is migrated to use it.

Other changes

Mostly test util changes.

Tested

Ran tests locally.

Related issues

Backwards compatibility

Backwards compatible.

Documentation

None.


PR-Codex overview

This PR introduces testing with a local Anvil instance using testWithAnvil. It also adds Anvil setup in tests and updates dependencies.

Detailed summary

  • Added testWithAnvil for local Anvil testing
  • Updated dependencies including @viem/anvil
  • Modified test setup to include Anvil start and stop
  • Updated test utilities for local testing with Web3 nodes

The following files were skipped due to too many changes: yarn.lock, packages/dev-utils/src/anvil-state.json

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

TODO

  • Add instructions to install foundry for running the tests locally

Copy link

changeset-bot bot commented May 16, 2024

🦋 Changeset detected

Latest commit: a2b474b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@celo/dev-utils Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

socket-security bot commented May 20, 2024

New dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/@viem/anvil@0.0.9 network Transitive: environment +9 495 kB jmoxey
npm/follow-redirects@1.15.6 network 0 29.4 kB rubenverborgh
npm/get-port@6.1.2 None 0 11.1 kB sindresorhus
npm/http-proxy@1.18.1 network 0 232 kB jcrugzz
npm/requires-port@1.0.0 None 0 8.56 kB 3rdeden

View full report↗︎

Copy link

codecov bot commented May 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 67.34%. Comparing base (6314e2e) to head (a2b474b).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #243      +/-   ##
==========================================
- Coverage   71.70%   67.34%   -4.37%     
==========================================
  Files         199      125      -74     
  Lines        8275     5905    -2370     
  Branches     1253      957     -296     
==========================================
- Hits         5934     3977    -1957     
+ Misses       2264     1880     -384     
+ Partials       77       48      -29     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@shazarre shazarre force-pushed the shazarre/migrate_account_register_to_anvil branch from 58860ca to 8a6faa8 Compare May 20, 2024 14:37
@aaronmgdr
Copy link
Member

🔥☄️

@shazarre shazarre marked this pull request as ready for review May 20, 2024 16:13
@shazarre shazarre requested a review from a team as a code owner May 20, 2024 16:13
@@ -0,0 +1,5 @@
---
'@celo/dev-utils': patch
Copy link
Member

Choose a reason for hiding this comment

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

Nit: Should this be a minor? Seems like a new feature, rather than a bug fix.

MINOR version when you add functionality in a backward compatible manner
PATCH version when you make backward compatible bug fixes

Source: https://semver.org/

@shazarre shazarre self-assigned this May 21, 2024
Copy link
Contributor

@nicolasbrugneaux nicolasbrugneaux left a comment

Choose a reason for hiding this comment

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

:shipit:

@@ -61,7 +61,7 @@ Use `yarn docs` to populate `packages/docs` with generated documentation. Genera

### Testing

We use both ganache and anvil for testing. You'll need foundry installed on your machine.
We use both ganache and anvil for testing. You'll need [foundry](https://book.getfoundry.sh/getting-started/installation) installed on your machine.
Copy link
Contributor

Choose a reason for hiding this comment

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

🚀

@shazarre shazarre enabled auto-merge (squash) May 22, 2024 10:51
@shazarre shazarre merged commit 305e278 into master May 22, 2024
22 of 33 checks passed
@shazarre shazarre deleted the shazarre/migrate_account_register_to_anvil branch May 22, 2024 10:59
@github-actions github-actions bot mentioned this pull request May 22, 2024
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.

Migrate "src/commands/account/register.test.ts" to anvil
4 participants