From c20fd054433bb61583659e265488b8e68a3917f3 Mon Sep 17 00:00:00 2001 From: Thomas Braun Date: Tue, 26 Nov 2024 13:27:19 -0500 Subject: [PATCH] cleanup: address review --- blueprint-test-utils/src/mpc.rs | 2 +- blueprint-test-utils/src/tangle/mod.rs | 5 +++-- blueprint-test-utils/src/tangle/transactions.rs | 6 +++--- blueprint-test-utils/src/test_ext.rs | 2 +- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/blueprint-test-utils/src/mpc.rs b/blueprint-test-utils/src/mpc.rs index 5a37bc6b..5f95fd34 100644 --- a/blueprint-test-utils/src/mpc.rs +++ b/blueprint-test-utils/src/mpc.rs @@ -12,7 +12,7 @@ macro_rules! mpc_generate_keygen_and_signing_tests { [$($expected_signing_outputs:expr),*], $atomic_keygen_call_id_store:expr, ) => { - $crate::generic_test_blueprint!( + $crate::tangle_blueprint_test_template!( $blueprint_path, $N, |client, handles, blueprint| async move { diff --git a/blueprint-test-utils/src/tangle/mod.rs b/blueprint-test-utils/src/tangle/mod.rs index d9541531..7985bad7 100644 --- a/blueprint-test-utils/src/tangle/mod.rs +++ b/blueprint-test-utils/src/tangle/mod.rs @@ -23,7 +23,8 @@ pub fn run() -> Result { } #[macro_export] -macro_rules! generic_test_blueprint { +/// A template that makes creating domain-specific macros for tangle-based blueprints easier +macro_rules! tangle_blueprint_test_template { ( $blueprint_path:expr, $N:tt, @@ -92,7 +93,7 @@ macro_rules! test_tangle_blueprint { [$($inputs:expr),+], [$($expected_output:expr),+] ) => { - generic_test_blueprint!( + tangle_blueprint_test_template!( $blueprint_path, $N, |client, handles, blueprint| async move { diff --git a/blueprint-test-utils/src/tangle/transactions.rs b/blueprint-test-utils/src/tangle/transactions.rs index ca85d31d..7d2b4eae 100644 --- a/blueprint-test-utils/src/tangle/transactions.rs +++ b/blueprint-test-utils/src/tangle/transactions.rs @@ -27,7 +27,7 @@ pub async fn create_blueprint( Ok(()) } -pub async fn join_delegators( +pub async fn join_operators( client: &TestClient, account_id: &TanglePairSigner, ) -> Result<(), Box> { @@ -206,7 +206,7 @@ pub async fn approve_service( request_id: u64, restaking_percent: u8, ) -> Result<(), Box> { - gadget_sdk::info!("Approving service request ..."); + info!("Approving service request ..."); let call = api::tx() .services() .approve(request_id, Percent(restaking_percent)); @@ -219,7 +219,7 @@ pub async fn approve_service( } pub async fn get_next_request_id(client: &TestClient) -> Result> { - gadget_sdk::info!("Fetching next request ID ..."); + info!("Fetching next request ID ..."); let next_request_id_addr = api::storage().services().next_service_request_id(); let next_request_id = client .storage() diff --git a/blueprint-test-utils/src/test_ext.rs b/blueprint-test-utils/src/test_ext.rs index 62286f88..3ae44daa 100644 --- a/blueprint-test-utils/src/test_ext.rs +++ b/blueprint-test-utils/src/test_ext.rs @@ -170,7 +170,7 @@ pub async fn new_test_ext_blueprint_manager< }, }; - if let Err(err) = transactions::join_delegators(&client, &keypair).await { + if let Err(err) = transactions::join_operators(&client, &keypair).await { let _span = handle.span().enter(); let err_str = format!("{err}");