From 909683440691d3cce2f3ca2f2c4baed284fd50a5 Mon Sep 17 00:00:00 2001 From: Harry Solovay Date: Tue, 5 Nov 2024 17:46:42 -0500 Subject: [PATCH] continued --- src/test.rs | 1 + tests/compare/account_balance.rs | 9 +++++---- tests/compare/block.rs | 9 +++++---- tests/compare/mod.rs | 4 ++-- 4 files changed, 13 insertions(+), 10 deletions(-) diff --git a/src/test.rs b/src/test.rs index 0701799..3297dd5 100644 --- a/src/test.rs +++ b/src/test.rs @@ -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(()) } diff --git a/tests/compare/account_balance.rs b/tests/compare/account_balance.rs index 12b29e5..05c1d9b 100644 --- a/tests/compare/account_balance.rs +++ b/tests/compare/account_balance.rs @@ -1,8 +1,9 @@ -use erased_serde::Serialize as ErasedSerialize; use mina_mesh::models::{AccountBalanceRequest, AccountIdentifier, NetworkIdentifier, PartialBlockIdentifier}; -pub fn requests() -> Vec> { - 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(), @@ -25,5 +26,5 @@ pub fn requests() -> Vec> { sub_network_identifier: None, }), }), - ] + ]) } diff --git a/tests/compare/block.rs b/tests/compare/block.rs index bb04c04..3d76e22 100644 --- a/tests/compare/block.rs +++ b/tests/compare/block.rs @@ -1,8 +1,9 @@ -use erased_serde::Serialize as ErasedSerialize; use mina_mesh::models::{BlockRequest, NetworkIdentifier, PartialBlockIdentifier}; -pub fn requests() -> Vec> { - 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()), @@ -11,5 +12,5 @@ pub fn requests() -> Vec> { network_identifier: Box::new(NetworkIdentifier::new("mina".to_string(), "debug".to_string())), block_identifier: Box::new(PartialBlockIdentifier { index: Some(52676), hash: None }), }), - ] + ]) } diff --git a/tests/compare/mod.rs b/tests/compare/mod.rs index cf274fe..bacd322 100644 --- a/tests/compare/mod.rs +++ b/tests/compare/mod.rs @@ -3,8 +3,8 @@ use erased_serde::Serialize as ErasedSerialize; mod account_balance; mod block; -type CompareGroup<'a> = (&'a str, Vec>); +pub type CompareGroup<'a> = (&'a str, Vec>); pub fn groups<'a>() -> Vec> { - vec![("/account/balance", account_balance::requests()), ("/block", block::requests())] + vec![account_balance::account_balance(), block::block()] }