Skip to content

Commit

Permalink
continued
Browse files Browse the repository at this point in the history
  • Loading branch information
harrysolovay committed Nov 5, 2024
1 parent 02b9a3e commit 9096834
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 10 deletions.
1 change: 1 addition & 0 deletions src/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ impl ResponseComparisonContext {
let body_bytes = maybe_body_bytes.clone().unwrap_or_default();
let (a, b) =
tokio::try_join!(self.mina_mesh_req(subpath, body_bytes.clone()), self.legacy_req(subpath, body_bytes))?;
println!("Here: {subpath}");
assert_eq!(a, b);
Ok(())
}
Expand Down
9 changes: 5 additions & 4 deletions tests/compare/account_balance.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
use erased_serde::Serialize as ErasedSerialize;
use mina_mesh::models::{AccountBalanceRequest, AccountIdentifier, NetworkIdentifier, PartialBlockIdentifier};

pub fn requests() -> Vec<Box<dyn ErasedSerialize>> {
vec![
use super::CompareGroup;

pub fn account_balance<'a>() -> CompareGroup<'a> {
("/account/balance", vec![
Box::new(AccountBalanceRequest {
account_identifier: Box::new(AccountIdentifier::new(
"B62qmo4nfFemr9hFtvz8F5h4JFSCxikVNsUJmZcfXQ9SGJ4abEC1RtH".to_string(),
Expand All @@ -25,5 +26,5 @@ pub fn requests() -> Vec<Box<dyn ErasedSerialize>> {
sub_network_identifier: None,
}),
}),
]
])
}
9 changes: 5 additions & 4 deletions tests/compare/block.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
use erased_serde::Serialize as ErasedSerialize;
use mina_mesh::models::{BlockRequest, NetworkIdentifier, PartialBlockIdentifier};

pub fn requests() -> Vec<Box<dyn ErasedSerialize>> {
vec![
use super::CompareGroup;

pub fn block<'a>() -> CompareGroup<'a> {
("/block", vec![
Box::new(BlockRequest {
network_identifier: Box::new(NetworkIdentifier::new("mina".to_string(), "debug".to_string())),
block_identifier: Box::new(PartialBlockIdentifier::new()),
Expand All @@ -11,5 +12,5 @@ pub fn requests() -> Vec<Box<dyn ErasedSerialize>> {
network_identifier: Box::new(NetworkIdentifier::new("mina".to_string(), "debug".to_string())),
block_identifier: Box::new(PartialBlockIdentifier { index: Some(52676), hash: None }),
}),
]
])
}
4 changes: 2 additions & 2 deletions tests/compare/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ use erased_serde::Serialize as ErasedSerialize;
mod account_balance;
mod block;

type CompareGroup<'a> = (&'a str, Vec<Box<dyn ErasedSerialize>>);
pub type CompareGroup<'a> = (&'a str, Vec<Box<dyn ErasedSerialize>>);

pub fn groups<'a>() -> Vec<CompareGroup<'a>> {
vec![("/account/balance", account_balance::requests()), ("/block", block::requests())]
vec![account_balance::account_balance(), block::block()]
}

0 comments on commit 9096834

Please sign in to comment.