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

Remove ethers dependency from the utils package #1638

Closed
danielbate opened this issue Jan 12, 2024 · 2 comments
Closed

Remove ethers dependency from the utils package #1638

danielbate opened this issue Jan 12, 2024 · 2 comments
Assignees
Labels
chore Issue is a chore

Comments

@danielbate
Copy link
Contributor

danielbate commented Jan 12, 2024

Since our move to Vitest in #1310, although the API is very close to Jest, there are differences in how Jest approaches mocking. One area is that we can no longer mock dependencies that are used by test setup files. Such as our dependency on ethers to hexlify a test worker ID to retrieve a private key, to access a faucet to be used in tests.

We now see the following error - source:

Error: [vitest] Cannot mock "ethers" because it is already loaded. Did you import it in a setup file?

Since we have introduced our own hexlify function in #1401, we can use this instead. However we will then need to remove the ethers dependency from the utils package. The main awkwardness for this is the BytesLike type that is used across the SDK. However we should look to introduce our own to across the board reduce our dependency on ethers.

We have also pinned our vitest version to counteract this error, so currently we risk being out of date.

@danielbate danielbate added the chore Issue is a chore label Jan 12, 2024
@danielbate danielbate self-assigned this Jan 12, 2024
@nedsalk
Copy link
Contributor

nedsalk commented Jan 12, 2024

@danielbate While you're at it, you can look into removing it totally based on #1592.

@arboleya
Copy link
Member

Completed via #1640

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Issue is a chore
Projects
None yet
Development

No branches or pull requests

3 participants