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

Network Configuration + Legacy Response Comparison Testing #62

Draft
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

harrysolovay
Copy link
Member

@harrysolovay harrysolovay commented Nov 1, 2024

  1. There is now a MinaNetwork enum with two variants, Mainnet and Devnet.
  2. One now accesses the given network's PG pool by supplying the MinaNetwork.
let pool = mina_mesh.pool(network).await?;

Or in the context of a MinaMesh inherent impl:

let self = self.pool(network).await?;

It's important to note, accessing the pool requires mina_mesh be mutable.

impl MinaMesh {
  async fn block_balance(
-   &self,
+   &mut self,
  1. GraphQLClient's send method now accepts the MinaNetwork as an additional argument (note it is in the 0 position).
- self.graphql_client.send(SomeQuery::build(())).await?;
+ self.graphql_client.send(network, SomeQuery::build(())).await?;
  1. We now have a utility for asserting equality of the responses of sending the same requests to both MinaMesh and a specified endpoint (for our use, the Ocaml implementation).
let ctx = ResponseComparisonContext::new(mina_mesh, ENDPOINT.to_string());

ctx.assert_responses_eq("/account/balance", Some(req_json)).await?;

@harrysolovay harrysolovay changed the title LegacyComparisonContext ResponseComparisonContext Nov 1, 2024
@harrysolovay harrysolovay changed the title ResponseComparisonContext Network Configuration + Fixtures Nov 7, 2024
@harrysolovay harrysolovay changed the title Network Configuration + Fixtures Network Configuration + Legacy Response Comparison Testing Nov 7, 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.

1 participant