diff --git a/autonomi/tests/put.rs b/autonomi/tests/put.rs index ca4a808c7e..c434c1c545 100644 --- a/autonomi/tests/put.rs +++ b/autonomi/tests/put.rs @@ -9,11 +9,27 @@ use ant_logging::LogBuilder; use autonomi::{client::ClientConfig, Client}; use eyre::Result; -use test_utils::{evm::get_funded_wallet, gen_random_data}; +use test_utils::{evm::get_funded_wallet, gen_random_data, peers_from_env}; #[tokio::test] -async fn put() -> Result<()> { - let _log_appender_guard = LogBuilder::init_single_threaded_tokio_test("put", false); +async fn put_1() -> Result<()> { + let _log_appender_guard = LogBuilder::init_single_threaded_tokio_test("put_1", false); + + let client = Client::connect(&peers_from_env()?).await?; + let wallet = get_funded_wallet(); + let data = gen_random_data(1024 * 1024 * 10); + + let addr = client.data_put_public(data.clone(), wallet.into()).await?; + + let data_fetched = client.data_get_public(addr).await?; + assert_eq!(data, data_fetched, "data fetched should match data put"); + + Ok(()) +} + +#[tokio::test] +async fn put_2() -> Result<()> { + let _log_appender_guard = LogBuilder::init_single_threaded_tokio_test("put_2", false); let client = Client::init_with_config(ClientConfig { local: true,