From 69f482d1fbf903a4aed6d48ffa1d60f371bda149 Mon Sep 17 00:00:00 2001 From: Drew Stone Date: Tue, 10 Dec 2024 12:42:08 -0500 Subject: [PATCH] chore: fixes --- blueprint-test-utils/src/lib.rs | 1 + blueprint-test-utils/src/tangle/transactions.rs | 8 -------- blueprint-test-utils/src/test_ext.rs | 15 --------------- blueprints/incredible-squaring/tests/call_id.rs | 4 ++-- 4 files changed, 3 insertions(+), 25 deletions(-) diff --git a/blueprint-test-utils/src/lib.rs b/blueprint-test-utils/src/lib.rs index d4008b07..6437f6d9 100644 --- a/blueprint-test-utils/src/lib.rs +++ b/blueprint-test-utils/src/lib.rs @@ -267,6 +267,7 @@ fn inject_tangle_key>(keystore_path: P, name: &str) -> color_eyre let suri = format!("//{name}"); let sr = sp_core::sr25519::Pair::from_string(&suri, None).expect("Should be valid SR keypair"); + let sr_seed = &sr.as_ref().secret.to_bytes(); let ed = sp_core::ed25519::Pair::from_string(&suri, None).expect("Should be valid ED keypair"); diff --git a/blueprint-test-utils/src/tangle/transactions.rs b/blueprint-test-utils/src/tangle/transactions.rs index 6415c022..76a710c1 100644 --- a/blueprint-test-utils/src/tangle/transactions.rs +++ b/blueprint-test-utils/src/tangle/transactions.rs @@ -184,14 +184,6 @@ pub async fn request_service( PaymentAsset::from(Asset::Custom(0)), value, ); - let balance_call = api::storage().balances().account(user.account_id()); - let balance = client - .storage() - .at_latest() - .await? - .fetch_or_default(&balance_call) - .await?; - println!("XXX | Balance: {:?}", balance); let res = client .tx() .sign_and_submit_then_watch_default(&call, user) diff --git a/blueprint-test-utils/src/test_ext.rs b/blueprint-test-utils/src/test_ext.rs index daf4e76b..1ff17b65 100644 --- a/blueprint-test-utils/src/test_ext.rs +++ b/blueprint-test-utils/src/test_ext.rs @@ -166,21 +166,6 @@ pub async fn new_test_ext_blueprint_manager< opts.signer = Some(handle.sr25519_id().clone().into_inner()); } - // Give the accounts balances - let client = get_client(&opts.ws_rpc_url, &opts.http_rpc_url) - .await - .expect("Failed to create an account-based localhost client"); - - let alice = get_from_seed::("Alice"); - let transfer_call = api::tx() - .balances() - .transfer_allow_death(tg_addr.into(), 1_000_000_000_000_000_000_000_000); - let res = client - .tx() - .sign_and_submit_then_watch_default(&transfer_call, alice) - .await - .expect("Failed to transfer funds to Alice"); - handles.push(handle); } diff --git a/blueprints/incredible-squaring/tests/call_id.rs b/blueprints/incredible-squaring/tests/call_id.rs index 74d641ee..f32b0338 100644 --- a/blueprints/incredible-squaring/tests/call_id.rs +++ b/blueprints/incredible-squaring/tests/call_id.rs @@ -1,6 +1,7 @@ use std::sync::atomic::AtomicU64; use std::sync::atomic::Ordering; +use blueprint_test_utils::tangle::NodeConfig; pub use blueprint_test_utils::{ get_blueprint_base_dir, read_cargo_toml_file, run_test_blueprint_manager, setup_log, submit_job, tangle, wait_for_completion_of_tangle_job, Args, Job, Opts, @@ -18,11 +19,10 @@ async fn call_id_valid() { const N: usize = 1; const JOB_ID: usize = 1; - new_test_ext_blueprint_manager::( String::new(), run_test_blueprint_manager, - false, + NodeConfig::new(false), ) .await .execute_with_async(|client, handles, blueprint, _| async move {