diff --git a/.vscode/launch.json b/.vscode/launch.json deleted file mode 100644 index 884d3ca..0000000 --- a/.vscode/launch.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "version": "0.2.0", - "configurations": [ - { - "type": "lldb", - "request": "launch", - "name": "Debug Cargo tests", - "cargo": { - "args": ["test", "--no-run", "--lib"] - }, - "args": ["--nocapture"], - "cwd": "${workspaceFolder}", - "env": { - "RUST_LOG": "debug" - }, - "envFile": "${workspaceFolder}/.env", - "console": "integratedTerminal" - } - ] -} diff --git a/tests/block.rs b/tests/block.rs index 67eac9f..2d309e4 100644 --- a/tests/block.rs +++ b/tests/block.rs @@ -38,8 +38,11 @@ fn specified_identifiers() -> &'static [PartialBlockIdentifier; 3] { #[tokio::test] async fn unspecified() -> Result<()> { - let mina_mesh = MinaMeshConfig::from_env().to_mina_mesh().await?; - let result = mina_mesh.block_metadata(&PartialBlockIdentifier { hash: None, index: None }).await; - assert!(result.is_ok()); + let response = MinaMeshConfig::from_env() + .to_mina_mesh() + .await? + .block_metadata(&PartialBlockIdentifier { hash: None, index: None }) + .await; + assert!(response.is_ok()); Ok(()) } diff --git a/tests/network_list.rs b/tests/network_list.rs index 324b87c..fac082d 100644 --- a/tests/network_list.rs +++ b/tests/network_list.rs @@ -4,15 +4,7 @@ use mina_mesh::MinaMeshConfig; #[tokio::test] async fn mainnet_test() -> Result<()> { - // Create a MinaMesh instance using the default configuration - let mina_mesh = MinaMeshConfig::from_env().to_mina_mesh().await?; - - // Call the network_list function - let result = mina_mesh.network_list().await?; - - assert!(!result.network_identifiers.is_empty()); - - let network_identifier = &result.network_identifiers[0]; - assert_debug_snapshot!(network_identifier); + let response = MinaMeshConfig::from_env().to_mina_mesh().await?.network_list().await?; + assert_debug_snapshot!(&response.network_identifiers); Ok(()) } diff --git a/tests/snapshots/network_list__mainnet_test.snap b/tests/snapshots/network_list__mainnet_test.snap index c73de61..2807195 100644 --- a/tests/snapshots/network_list__mainnet_test.snap +++ b/tests/snapshots/network_list__mainnet_test.snap @@ -1,9 +1,11 @@ --- source: tests/network_list.rs -expression: network_identifier +expression: "&response.network_identifiers" --- -NetworkIdentifier { - blockchain: "mina", - network: "mainnet", - sub_network_identifier: None, -} +[ + NetworkIdentifier { + blockchain: "mina", + network: "mainnet", + sub_network_identifier: None, + }, +]