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

Move all Web3 usage to libs/evm-protocol #10504

Merged
merged 20 commits into from
Jan 9, 2025
Merged

Move all Web3 usage to libs/evm-protocol #10504

merged 20 commits into from
Jan 9, 2025

Conversation

timolegros
Copy link
Collaborator

@timolegros timolegros commented Jan 8, 2025

Link to Issue

Closes: #7504

Description of Changes

Moved all 'Web3' imports to libs/evm-protocols. This will facilitate mocking + transitioning to Viem.

Test Plan

Deployment Plan

Other Considerations

@timolegros timolegros marked this pull request as ready for review January 8, 2025 20:55
Copy link
Contributor

@Rotorsoft Rotorsoft left a comment

Choose a reason for hiding this comment

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

nice!

  • just a few comments about moving more protocol services that don't ref the models to the other lib for more encapsulation
  • the getBlock util will have conflicts with my referrals PR, let's coordinate the merges

@timolegros
Copy link
Collaborator Author

timolegros commented Jan 8, 2025

@Rotorsoft libs/evm-protocols is client compatible. Cannot import libs/core or libs/model hence why the above files exist as they do. libs/evm-protocols is purely a light abstraction over Web3 interactions. It's not intended as a platform-only "service" lib.

Though if that's what we prefer I'm fine with creating 1 client accessible web3 lib and one that's not...

@Rotorsoft
Copy link
Contributor

@Rotorsoft libs/evm-protocols is client compatible. Cannot import libs/core or libs/model hence why the above files exist as they do. libs/evm-protocols is purely a light abstraction over Web3 interactions. It's not intended as a platform-only "service" lib.

Though if that's what we prefer I'm fine with creating 1 client accessible web3 lib and one that's not...

That's fine, but there are probably a couple of files that are only importing the Error type from libs/core... those can be probably moved and use JS Error instead?

@timolegros
Copy link
Collaborator Author

@Rotorsoft libs/evm-protocols is client compatible. Cannot import libs/core or libs/model hence why the above files exist as they do. libs/evm-protocols is purely a light abstraction over Web3 interactions. It's not intended as a platform-only "service" lib.
Though if that's what we prefer I'm fine with creating 1 client accessible web3 lib and one that's not...

That's fine, but there are probably a couple of files that are only importing the Error type from libs/core... those can be probably moved and use JS Error instead?

@Rotorsoft, I was only able to remove the contestHelpers file. We also can't just convert the error types because AppError vs ServerError thrown from routes have different effects (rollbar reporting + status codes).

@timolegros timolegros merged commit ff56899 into master Jan 9, 2025
10 checks passed
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.

🪣 Create web3 domain service libs
3 participants