diff --git a/Cargo.lock b/Cargo.lock index 89be38703..24df6fc34 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1330,7 +1330,7 @@ dependencies = [ "libc", "option-ext", "redox_users 0.5.2", - "windows-sys 0.61.2", + "windows-sys 0.59.0", ] [[package]] @@ -1532,7 +1532,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" dependencies = [ "libc", - "windows-sys 0.61.2", + "windows-sys 0.52.0", ] [[package]] @@ -1851,6 +1851,7 @@ dependencies = [ "serde", "serde_json", "tempfile", + "test-log", "testresult", "tokio", "tokio-tungstenite 0.27.0", @@ -2761,7 +2762,7 @@ checksum = "3640c1c38b8e4e43584d8df18be5fc6b0aa314ce6ebf51b53313d4306cca8e46" dependencies = [ "hermit-abi", "libc", - "windows-sys 0.61.2", + "windows-sys 0.52.0", ] [[package]] @@ -3262,7 +3263,7 @@ version = "0.50.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7957b9740744892f114936ab4a57b3f487491bbeafaf8083688b16841a4240e5" dependencies = [ - "windows-sys 0.61.2", + "windows-sys 0.59.0", ] [[package]] @@ -4387,7 +4388,7 @@ dependencies = [ "errno", "libc", "linux-raw-sys", - "windows-sys 0.61.2", + "windows-sys 0.52.0", ] [[package]] @@ -5243,7 +5244,7 @@ dependencies = [ "getrandom 0.3.4", "once_cell", "rustix", - "windows-sys 0.61.2", + "windows-sys 0.52.0", ] [[package]] @@ -6530,7 +6531,7 @@ version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" dependencies = [ - "windows-sys 0.61.2", + "windows-sys 0.48.0", ] [[package]] diff --git a/apps/freenet-ping/Cargo.lock b/apps/freenet-ping/Cargo.lock index 55321d0bd..111d89888 100644 --- a/apps/freenet-ping/Cargo.lock +++ b/apps/freenet-ping/Cargo.lock @@ -1146,6 +1146,27 @@ dependencies = [ "syn 2.0.106", ] +[[package]] +name = "env_filter" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bf3c259d255ca70051b30e2e95b5446cdb8949ac4cd22c0d7fd634d89f568e2" +dependencies = [ + "log", +] + +[[package]] +name = "env_logger" +version = "0.11.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13c863f0904021b108aa8b2f55046443e6b1ebde8fd4a15c399893aae4fa069f" +dependencies = [ + "anstream", + "anstyle", + "env_filter", + "log", +] + [[package]] name = "equivalent" version = "1.0.2" @@ -1368,6 +1389,7 @@ dependencies = [ "serde", "serde_json", "tempfile", + "test-log", "testresult", "tokio", "tokio-tungstenite 0.27.0", @@ -3907,6 +3929,28 @@ dependencies = [ "windows-sys 0.60.2", ] +[[package]] +name = "test-log" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e33b98a582ea0be1168eba097538ee8dd4bbe0f2b01b22ac92ea30054e5be7b" +dependencies = [ + "env_logger", + "test-log-macros", + "tracing-subscriber", +] + +[[package]] +name = "test-log-macros" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "451b374529930d7601b1eef8d32bc79ae870b6079b069401709c2a8bf9e75f36" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.106", +] + [[package]] name = "testresult" version = "0.4.1" diff --git a/apps/freenet-ping/app/Cargo.toml b/apps/freenet-ping/app/Cargo.toml index ef83d63ae..362d66c35 100644 --- a/apps/freenet-ping/app/Cargo.toml +++ b/apps/freenet-ping/app/Cargo.toml @@ -25,6 +25,7 @@ humantime = "2.2.0" [dev-dependencies] freenet = { path = "../../../crates/core" } +test-log = "0.2" testresult = { workspace = true } [lib] diff --git a/apps/freenet-ping/app/tests/run_app.rs b/apps/freenet-ping/app/tests/run_app.rs index b1cd6480d..598c203a7 100644 --- a/apps/freenet-ping/app/tests/run_app.rs +++ b/apps/freenet-ping/app/tests/run_app.rs @@ -17,7 +17,7 @@ use rand::SeedableRng; use testresult::TestResult; use tokio::{select, time::sleep, time::timeout}; use tokio_tungstenite::connect_async; -use tracing::{level_filters::LevelFilter, span, Instrument, Level}; +use tracing::{span, Instrument, Level}; use common::{ base_node_test_config, base_node_test_config_with_rng, gw_config_from_path, @@ -171,10 +171,8 @@ async fn collect_node_diagnostics( Ok(()) } -#[tokio::test(flavor = "multi_thread")] +#[test_log::test(tokio::test(flavor = "multi_thread"))] async fn test_node_diagnostics_query() -> TestResult { - freenet::config::set_logger(Some(LevelFilter::DEBUG), None); - // Setup network sockets for the gateway and client node let network_socket_gw = TcpListener::bind("127.0.0.1:0")?; let ws_api_port_socket_gw = TcpListener::bind("127.0.0.1:0")?; @@ -463,10 +461,8 @@ async fn test_node_diagnostics_query() -> TestResult { } #[ignore = "this test currently fails and we are workign on fixing it"] -#[tokio::test(flavor = "multi_thread")] +#[test_log::test(tokio::test(flavor = "multi_thread"))] async fn test_ping_multi_node() -> TestResult { - freenet::config::set_logger(Some(LevelFilter::DEBUG), None); - // Setup network sockets for the gateway let network_socket_gw = TcpListener::bind("127.0.0.1:0")?; @@ -1092,10 +1088,8 @@ async fn test_ping_multi_node() -> TestResult { } #[ignore = "this test currently fails and we are workign on fixing it"] -#[tokio::test(flavor = "multi_thread")] +#[test_log::test(tokio::test(flavor = "multi_thread"))] async fn test_ping_application_loop() -> TestResult { - freenet::config::set_logger(Some(LevelFilter::DEBUG), None); - // Setup network sockets for the gateway let network_socket_gw = TcpListener::bind("127.0.0.1:0")?; @@ -1519,7 +1513,7 @@ async fn test_ping_application_loop() -> TestResult { Ok(()) } -#[tokio::test(flavor = "multi_thread")] +#[test_log::test(tokio::test(flavor = "multi_thread"))] #[ignore = "Test has never worked - gateway nodes fail on startup with channel closed errors"] async fn test_ping_partially_connected_network() -> TestResult { /* @@ -1551,8 +1545,6 @@ async fn test_ping_partially_connected_network() -> TestResult { const NUM_REGULAR_NODES: usize = 7; const CONNECTIVITY_RATIO: f64 = 0.5; // Controls connectivity between regular nodes - // Configure logging - freenet::config::set_logger(Some(LevelFilter::DEBUG), None); tracing::info!( "Starting test with {} gateways and {} regular nodes (connectivity ratio: {})", NUM_GATEWAYS, diff --git a/apps/freenet-ping/app/tests/run_app_blocked_peers.rs b/apps/freenet-ping/app/tests/run_app_blocked_peers.rs index f8c1d5452..ee01031a1 100644 --- a/apps/freenet-ping/app/tests/run_app_blocked_peers.rs +++ b/apps/freenet-ping/app/tests/run_app_blocked_peers.rs @@ -48,7 +48,7 @@ use common::{ base_node_test_config, get_all_ping_states, gw_config_from_path, ping_states_equal, APP_TAG, PACKAGE_DIR, PATH_TO_CONTRACT, }; -use freenet::{config::set_logger, local_node::NodeConfig, server::serve_gateway}; +use freenet::{local_node::NodeConfig, server::serve_gateway}; use freenet_ping_app::ping_client::{ wait_for_get_response, wait_for_put_response, wait_for_subscribe_response, }; @@ -61,7 +61,7 @@ use futures::FutureExt; use testresult::TestResult; use tokio::{select, time::sleep}; use tokio_tungstenite::connect_async; -use tracing::{level_filters::LevelFilter, span, Instrument, Level}; +use tracing::{span, Instrument, Level}; /// Configuration for blocked peers test variants #[derive(Debug, Clone)] @@ -98,7 +98,6 @@ async fn run_blocked_peers_test(config: BlockedPeersConfig) -> TestResult { "debug,freenet::operations::subscribe=trace,freenet::contract=trace", ); } - set_logger(Some(LevelFilter::DEBUG), None); tracing::info!("Starting {} blocked peers test...", config.test_name); @@ -782,7 +781,7 @@ async fn run_blocked_peers_test(config: BlockedPeersConfig) -> TestResult { } /// Standard blocked peers test (baseline) -#[tokio::test(flavor = "multi_thread")] +#[test_log::test(tokio::test(flavor = "multi_thread"))] #[ignore] async fn test_ping_blocked_peers() -> TestResult { run_blocked_peers_test(BlockedPeersConfig { @@ -802,7 +801,7 @@ async fn test_ping_blocked_peers() -> TestResult { } /// Simple blocked peers test -#[tokio::test(flavor = "multi_thread")] +#[test_log::test(tokio::test(flavor = "multi_thread"))] #[ignore] async fn test_ping_blocked_peers_simple() -> TestResult { run_blocked_peers_test(BlockedPeersConfig { @@ -825,7 +824,7 @@ async fn test_ping_blocked_peers_simple() -> TestResult { // as they only varied in non-functional aspects like timeouts and logging /// Solution/reference implementation for blocked peers -#[tokio::test(flavor = "multi_thread")] +#[test_log::test(tokio::test(flavor = "multi_thread"))] #[ignore = "fix me"] async fn test_ping_blocked_peers_solution() -> TestResult { run_blocked_peers_test(BlockedPeersConfig { diff --git a/apps/freenet-ping/app/tests/run_app_partially_connected_network.rs b/apps/freenet-ping/app/tests/run_app_partially_connected_network.rs index a7e59d32f..25e146d03 100644 --- a/apps/freenet-ping/app/tests/run_app_partially_connected_network.rs +++ b/apps/freenet-ping/app/tests/run_app_partially_connected_network.rs @@ -28,14 +28,13 @@ use futures::FutureExt; use testresult::TestResult; use tokio::{select, time::timeout}; use tokio_tungstenite::connect_async; -use tracing::{level_filters::LevelFilter, span, Instrument, Level}; +use tracing::{span, Instrument, Level}; use common::{base_node_test_config, gw_config_from_path, APP_TAG, PACKAGE_DIR, PATH_TO_CONTRACT}; -#[tokio::test(flavor = "multi_thread")] +#[test_log::test(tokio::test(flavor = "multi_thread"))] #[ignore = "Test has never worked - nodes fail on startup with channel closed errors"] async fn test_ping_partially_connected_network() -> TestResult { - freenet::config::set_logger(Some(LevelFilter::DEBUG), None); /* * This test verifies how subscription propagation works in a partially connected network. * @@ -68,8 +67,6 @@ async fn test_ping_partially_connected_network() -> TestResult { const NUM_REGULAR_NODES: usize = 7; const CONNECTIVITY_RATIO: f64 = 0.3; // Controls connectivity between regular nodes - // Configure logging - freenet::config::set_logger(Some(LevelFilter::DEBUG), None); println!( "Starting test with {NUM_GATEWAYS} gateways and {NUM_REGULAR_NODES} regular nodes (connectivity ratio: {CONNECTIVITY_RATIO})" ); diff --git a/apps/freenet-ping/app/tests/test_50_node_operations.rs b/apps/freenet-ping/app/tests/test_50_node_operations.rs index 6d17d502c..8fc2e8ce3 100644 --- a/apps/freenet-ping/app/tests/test_50_node_operations.rs +++ b/apps/freenet-ping/app/tests/test_50_node_operations.rs @@ -20,7 +20,6 @@ use std::{net::TcpListener, path::PathBuf, time::Duration}; use testresult::TestResult; use tokio::{select, time::timeout}; use tokio_tungstenite::connect_async; -use tracing::level_filters::LevelFilter; use common::{base_node_test_config, gw_config_from_path, APP_TAG, PACKAGE_DIR, PATH_TO_CONTRACT}; @@ -28,11 +27,9 @@ const NUM_GATEWAYS: usize = 3; // Multiple gateways to distribute load const NUM_REGULAR_NODES: usize = 47; // 3 + 47 = 50 total const CONNECTIVITY_RATIO: f64 = 0.1; // 10% connectivity to reduce network load -#[tokio::test(flavor = "multi_thread")] +#[test_log::test(tokio::test(flavor = "multi_thread"))] #[ignore = "large scale test - run manually"] async fn test_50_node_operations() -> TestResult { - freenet::config::set_logger(Some(LevelFilter::INFO), None); - println!("šŸš€ Starting 50-node operations test"); println!(" Gateway nodes: {NUM_GATEWAYS}"); println!(" Regular nodes: {NUM_REGULAR_NODES}"); diff --git a/apps/freenet-ping/app/tests/test_connection_timing.rs b/apps/freenet-ping/app/tests/test_connection_timing.rs index d8ea9d66e..793e392bd 100644 --- a/apps/freenet-ping/app/tests/test_connection_timing.rs +++ b/apps/freenet-ping/app/tests/test_connection_timing.rs @@ -12,18 +12,12 @@ use futures::FutureExt; use testresult::TestResult; use tokio::{select, time::timeout}; use tokio_tungstenite::connect_async; -use tracing::{level_filters::LevelFilter, span, Instrument, Level}; +use tracing::{span, Instrument, Level}; use common::{base_node_test_config, gw_config_from_path}; -#[tokio::test(flavor = "multi_thread")] +#[test_log::test(tokio::test(flavor = "multi_thread"))] async fn test_connection_timing() -> TestResult { - // Minimal logging to reduce noise - freenet::config::set_logger( - Some(LevelFilter::WARN), - Some("freenet::transport=info,freenet_core::transport=info".to_string()), - ); - println!("šŸ”§ Testing connection timing with 2 nodes"); // Setup only 2 nodes to minimize complexity diff --git a/apps/freenet-ping/app/tests/test_small_network_get_issue.rs b/apps/freenet-ping/app/tests/test_small_network_get_issue.rs index 64b153534..f01887fb2 100644 --- a/apps/freenet-ping/app/tests/test_small_network_get_issue.rs +++ b/apps/freenet-ping/app/tests/test_small_network_get_issue.rs @@ -1,5 +1,3 @@ -/// Test to reproduce the get operation failure in small, poorly connected networks -/// This simulates the real network conditions where contracts can't be retrieved mod common; use std::{net::TcpListener, path::PathBuf, time::Duration}; @@ -15,29 +13,14 @@ use futures::FutureExt; use testresult::TestResult; use tokio::{select, time::timeout}; use tokio_tungstenite::connect_async; -use tracing::{level_filters::LevelFilter, span, Instrument, Level}; +use tracing::{span, Instrument, Level}; use common::{base_node_test_config, gw_config_from_path, APP_TAG, PACKAGE_DIR, PATH_TO_CONTRACT}; -#[tokio::test(flavor = "multi_thread")] -#[ignore = "Test has reliability issues in CI - PUT operations timeout and gateway crashes"] +#[test_log::test(tokio::test(flavor = "multi_thread"))] async fn test_small_network_get_failure() -> TestResult { - freenet::config::set_logger(Some(LevelFilter::DEBUG), None); - - /* - * This test simulates the real network issue where: - * 1. A small number of peers (matching production) - * 2. Poor connectivity between peers - * 3. Gateway publishes a contract (central topology position) - * 4. Node2 tries to GET the contract through the gateway - * - * Without backtracking, the GET would fail. - * With backtracking, it should succeed. - */ - - // Small network like production const NUM_GATEWAYS: usize = 1; - const NUM_NODES: usize = 3; // Total 4 peers like in production + const NUM_NODES: usize = 3; println!("šŸ”§ Testing get operation in small, poorly connected network"); println!( @@ -45,15 +28,10 @@ async fn test_small_network_get_failure() -> TestResult { NUM_GATEWAYS + NUM_NODES ); - // Setup network sockets for the gateway let network_socket_gw = TcpListener::bind("127.0.0.1:0")?; let ws_api_port_socket_gw = TcpListener::bind("127.0.0.1:0")?; - - // Setup API sockets for nodes let ws_api_port_socket_node1 = TcpListener::bind("127.0.0.1:0")?; let ws_api_port_socket_node2 = TcpListener::bind("127.0.0.1:0")?; - - // Configure gateway node let (config_gw, preset_cfg_gw) = base_node_test_config( true, vec![], @@ -70,7 +48,6 @@ async fn test_small_network_get_failure() -> TestResult { let serialized_gateway = serde_json::to_string(&config_info)?; let _ws_api_port_gw = config_gw.ws_api.ws_api_port.unwrap(); - // Configure Node 1 (connects to gateway) let (config_node1, preset_cfg_node1) = base_node_test_config( false, vec![serialized_gateway.clone()], @@ -83,7 +60,6 @@ async fn test_small_network_get_failure() -> TestResult { .await?; let ws_api_port_node1 = config_node1.ws_api.ws_api_port.unwrap(); - // Configure Node 2 (connects to gateway) let (config_node2, preset_cfg_node2) = base_node_test_config( false, vec![serialized_gateway], @@ -96,7 +72,6 @@ async fn test_small_network_get_failure() -> TestResult { .await?; let ws_api_port_node2 = config_node2.ws_api.ws_api_port.unwrap(); - // Free the sockets std::mem::drop(network_socket_gw); std::mem::drop(ws_api_port_socket_gw); std::mem::drop(ws_api_port_socket_node1); @@ -109,11 +84,9 @@ async fn test_small_network_get_failure() -> TestResult { println!(); println!("Note: Nodes are only connected through the gateway"); - // Start all nodes let gateway_future = async { let config = config_gw.build().await?; let mut node_config = NodeConfig::new(config.clone()).await?; - // Set reasonable connection limits for small test network node_config.min_number_of_connections(2); node_config.max_number_of_connections(10); let node = node_config @@ -127,7 +100,6 @@ async fn test_small_network_get_failure() -> TestResult { let node1_future = async { let config = config_node1.build().await?; let mut node_config = NodeConfig::new(config.clone()).await?; - // Set reasonable connection limits for small test network node_config.min_number_of_connections(2); node_config.max_number_of_connections(10); let node = node_config @@ -141,7 +113,6 @@ async fn test_small_network_get_failure() -> TestResult { let node2_future = async { let config = config_node2.build().await?; let mut node_config = NodeConfig::new(config.clone()).await?; - // Set reasonable connection limits for small test network node_config.min_number_of_connections(2); node_config.max_number_of_connections(10); let node = node_config @@ -152,8 +123,7 @@ async fn test_small_network_get_failure() -> TestResult { .instrument(span!(Level::INFO, "node2")) .boxed_local(); - let test = timeout(Duration::from_secs(120), async { - // Wait for nodes to start up + let test = timeout(Duration::from_secs(180), async { println!("Waiting for nodes to start up..."); tokio::time::sleep(Duration::from_secs(15)).await; println!("āœ“ Nodes should be up and have basic connectivity"); @@ -165,13 +135,11 @@ async fn test_small_network_get_failure() -> TestResult { // Proper fix: Make connection acquisition more aggressive during startup, // or make the maintenance interval configurable for tests. - // Connect to gateway first let uri_gw = format!("ws://127.0.0.1:{_ws_api_port_gw}/v1/contract/command?encodingProtocol=native"); let (stream_gw, _) = connect_async(&uri_gw).await?; let mut client_gw = WebApi::start(stream_gw); - // Connect to nodes let uri_node1 = format!( "ws://127.0.0.1:{ws_api_port_node1}/v1/contract/command?encodingProtocol=native" ); @@ -184,11 +152,9 @@ async fn test_small_network_get_failure() -> TestResult { let (stream_node2, _) = connect_async(&uri_node2).await?; let mut client_node2 = WebApi::start(stream_node2); - // Load the ping contract let path_to_code = PathBuf::from(PACKAGE_DIR).join(PATH_TO_CONTRACT); println!("Loading contract code from {}", path_to_code.display()); - // Create ping contract options let ping_options = PingContractOptions { frequency: Duration::from_secs(2), ttl: Duration::from_secs(60), @@ -200,7 +166,6 @@ async fn test_small_network_get_failure() -> TestResult { let container = common::load_contract(&path_to_code, params)?; let contract_key = container.key(); - // Node1 publishes the contract (more typical scenario) println!("šŸ“¤ Node1 publishing ping contract..."); let ping = Ping::default(); @@ -216,9 +181,8 @@ async fn test_small_network_get_failure() -> TestResult { })) .await?; - // Wait for put response println!("Waiting for put response..."); - match timeout(Duration::from_secs(30), client_node1.recv()).await { + match timeout(Duration::from_secs(90), client_node1.recv()).await { Ok(Ok(HostResponse::ContractResponse(ContractResponse::PutResponse { key }))) if key == contract_key => { @@ -233,18 +197,19 @@ async fn test_small_network_get_failure() -> TestResult { return Err(anyhow!("Failed to get put response - error: {}", e)); } Err(_) => { - println!("Timeout waiting for put response"); - // Continue anyway - maybe the contract is already there + println!("āš ļø Timeout waiting for put response after 90s"); + println!(" This may indicate issues with:"); + println!(" - Network connectivity in small network topology"); + println!(" - PUT operation propagation delays"); + println!(" - Gateway stability under timeout conditions"); + return Err(anyhow!("PUT operation timed out after 90 seconds")); } } - // Give time for any propagation tokio::time::sleep(Duration::from_secs(5)).await; - // Debug: Check if contract is cached on each node println!("šŸ” Checking which nodes have the contract cached..."); - // Try GET from Gateway client_gw .send(ClientRequest::ContractOp(ContractRequest::Get { key: contract_key, @@ -262,7 +227,6 @@ async fn test_small_network_get_failure() -> TestResult { } } - // First, let's do a second GET from Gateway to see if it's faster println!("šŸ” Testing second GET from Gateway (should be fast if WASM is the issue)..."); let gw_get2_start = std::time::Instant::now(); client_gw @@ -285,7 +249,6 @@ async fn test_small_network_get_failure() -> TestResult { } } - // Now Node2 tries to GET the contract let get_start = std::time::Instant::now(); println!("šŸ“„ Node2 attempting to GET the contract..."); println!(" Contract key: {contract_key}"); @@ -302,7 +265,6 @@ async fn test_small_network_get_failure() -> TestResult { get_start.elapsed().as_millis() ); - // Wait for get response with longer timeout let start = std::time::Instant::now(); match timeout(Duration::from_secs(45), client_node2.recv()).await { Ok(Ok(HostResponse::ContractResponse(response))) => { @@ -339,7 +301,6 @@ async fn test_small_network_get_failure() -> TestResult { } } - // Test second GET after connections are established println!("\nšŸ” Testing second GET from Node2 after connections are established..."); tokio::time::sleep(Duration::from_secs(5)).await; @@ -351,7 +312,6 @@ async fn test_small_network_get_failure() -> TestResult { subscribe: false, })) .await?; - println!(" Second GET request sent"); match timeout(Duration::from_secs(10), client_node2.recv()).await { Ok(Ok(HostResponse::ContractResponse(ContractResponse::GetResponse { @@ -385,7 +345,6 @@ async fn test_small_network_get_failure() -> TestResult { }) .instrument(span!(Level::INFO, "test_small_network_get_failure")); - // Wait for test completion or node failures select! { r = gateway_future => { match r { @@ -410,7 +369,6 @@ async fn test_small_network_get_failure() -> TestResult { Err(e) => return Err(anyhow!("Test timed out: {}", e).into()), Ok(Ok(_)) => { println!("Test completed successfully!"); - // Give nodes time to process remaining operations before shutdown tokio::time::sleep(Duration::from_secs(3)).await; }, Ok(Err(e)) => return Err(anyhow!("Test failed: {}", e).into()), @@ -418,7 +376,6 @@ async fn test_small_network_get_failure() -> TestResult { } } - // Clean up drop(preset_cfg_gw); drop(preset_cfg_node1); drop(preset_cfg_node2); diff --git a/apps/freenet-ping/contracts/ping/Cargo.toml b/apps/freenet-ping/contracts/ping/Cargo.toml index 15d1ce7fe..2729101a0 100644 --- a/apps/freenet-ping/contracts/ping/Cargo.toml +++ b/apps/freenet-ping/contracts/ping/Cargo.toml @@ -8,7 +8,7 @@ crate-type = ["cdylib"] [dependencies] freenet-stdlib = { workspace = true } -freenet-ping-types = { path = "../../types", default-features = false } +freenet-ping-types = { path = "../../types", default-features = false, features = ["contract"] } serde_json = "1" [features] diff --git a/apps/freenet-ping/types/Cargo.toml b/apps/freenet-ping/types/Cargo.toml index 41ae26ff4..949a4da89 100644 --- a/apps/freenet-ping/types/Cargo.toml +++ b/apps/freenet-ping/types/Cargo.toml @@ -10,6 +10,7 @@ crate-type = ["cdylib", "rlib"] default = ["std"] std = ["chrono/default"] clap = ["dep:clap"] +contract = ["freenet-stdlib/contract"] [dependencies] humantime = "2"