-
Notifications
You must be signed in to change notification settings - Fork 1
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
create utilities for writing unit tests with a Mock Provider (no rpc eth node required) #42
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think of continuing to provide 'smoke' test coverage from the anvil integration test, while implementing the blanket api coverage in both mock and unit form?
xps-gateway/src/lib.rs
Outdated
|
||
use crate::types::GatewayContext; | ||
|
||
pub async fn create_mock_context() -> (GatewayContext<Provider<MockProvider>>, MockProvider) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is really cool. Thanks for leading the way on this!
yup! I think think the coverage we get from integration tests is super valuable, but having the ability to test smaller units of code w/o worrying about the network is v. nice for quick testing I'm still experimenting with this a bit, because it requires pushing a bunch of requirements that the |
Going to put this on hold while I work on #20. Right now, you can push responses to the mock provider, but I don't think it's very useful, because all the responses have to be carefully curated to match the contract you're calling. In the interest of time and not rewriting the results of contract calls, I want to finish #20 and maybe revist later it would be nice if we could find a library that can call a solidity contract w/ a mock state, without a node -- not sure if this exists i.e it would be worth thinking through a design on this that is more flexible |
No description provided.