Skip to content

Commit

Permalink
test(autonomi): compare old and new (debug)
Browse files Browse the repository at this point in the history
  • Loading branch information
b-zee committed Dec 11, 2024
1 parent bb79053 commit 6ad8f35
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions autonomi/tests/put.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 6ad8f35

Please sign in to comment.