diff --git a/testing/integration-tests/proc-macro/src/lib.rs b/testing/integration-tests/proc-macro/src/lib.rs index fef3b95066..edc9a6b7e3 100644 --- a/testing/integration-tests/proc-macro/src/lib.rs +++ b/testing/integration-tests/proc-macro/src/lib.rs @@ -28,21 +28,21 @@ pub fn subxt_test(attr: TokenStream, item: TokenStream) -> TokenStream { let func_vis = &func.vis; let func_sig = &func.sig; let func_block = &func.block; - let func_output = &func.sig.output; - let func_name = &func.sig.ident; - let inner_func_name = format_ident!("{}_inner", func_name); + let mut inner_func_sig = func.sig.clone(); + inner_func_sig.ident = format_ident!("{}_inner", inner_func_sig.ident); + let inner_func_name = &inner_func_sig.ident; let result = quote! { #[tokio::test] #( #func_attrs )* - #func_vis #func_sig #func_output { - async fn #inner_func_name() #func_output + #func_vis #func_sig { + #func_vis #inner_func_sig #func_block tokio::time::timeout(std::time::Duration::from_secs(#timeout_duration), #inner_func_name()) .await - .expect("Test timedout"); + .expect("Test timedout") } }; result.into() diff --git a/testing/integration-tests/src/full_client/blocks/mod.rs b/testing/integration-tests/src/full_client/blocks/mod.rs index 0aa4c4dcc9..b4090a2e00 100644 --- a/testing/integration-tests/src/full_client/blocks/mod.rs +++ b/testing/integration-tests/src/full_client/blocks/mod.rs @@ -2,7 +2,7 @@ // This file is dual-licensed as Apache-2.0 or GPL-3.0. // see LICENSE for license details. -use crate::test_context; +use crate::{subxt_test, test_context}; use codec::{Compact, Encode}; use futures::StreamExt; diff --git a/testing/integration-tests/src/full_client/client/legacy_rpcs.rs b/testing/integration-tests/src/full_client/client/legacy_rpcs.rs index ba9f66f1ab..7a33d9feb2 100644 --- a/testing/integration-tests/src/full_client/client/legacy_rpcs.rs +++ b/testing/integration-tests/src/full_client/client/legacy_rpcs.rs @@ -5,7 +5,7 @@ //! Just sanity checking some of the legacy RPC methods to make //! sure they don't error out and can decode their results OK. -use crate::test_context; +use crate::{subxt_test, test_context}; #[subxt_test(timeout = 800)] async fn chain_get_block_hash() { diff --git a/testing/integration-tests/src/full_client/client/mod.rs b/testing/integration-tests/src/full_client/client/mod.rs index bb5d81dc3a..8a4d66aafc 100644 --- a/testing/integration-tests/src/full_client/client/mod.rs +++ b/testing/integration-tests/src/full_client/client/mod.rs @@ -3,7 +3,7 @@ // see LICENSE for license details. use crate::{ - submit_tx_wait_for_finalized_success, test_context, + submit_tx_wait_for_finalized_success, subxt_test, test_context, utils::{node_runtime, wait_for_blocks}, }; use codec::{Decode, Encode}; diff --git a/testing/integration-tests/src/full_client/client/unstable_rpcs.rs b/testing/integration-tests/src/full_client/client/unstable_rpcs.rs index 9b1a7ae906..5267ce50f0 100644 --- a/testing/integration-tests/src/full_client/client/unstable_rpcs.rs +++ b/testing/integration-tests/src/full_client/client/unstable_rpcs.rs @@ -5,7 +5,7 @@ //! Just sanity checking some of the new RPC methods to try and //! catch differences as the implementations evolve. -use crate::{test_context, utils::node_runtime}; +use crate::{subxt_test, test_context, utils::node_runtime}; use assert_matches::assert_matches; use codec::Encode; use futures::Stream; diff --git a/testing/integration-tests/src/full_client/frame/balances.rs b/testing/integration-tests/src/full_client/frame/balances.rs index 509cb48ffa..d5df7805fb 100644 --- a/testing/integration-tests/src/full_client/frame/balances.rs +++ b/testing/integration-tests/src/full_client/frame/balances.rs @@ -4,7 +4,7 @@ use crate::{ node_runtime::{self, balances, runtime_types, system}, - submit_tx_wait_for_finalized_success, test_context, + submit_tx_wait_for_finalized_success, subxt_test, test_context, }; use codec::Decode; use subxt::{ diff --git a/testing/integration-tests/src/full_client/frame/contracts.rs b/testing/integration-tests/src/full_client/frame/contracts.rs index 68821360ae..8642eaa267 100644 --- a/testing/integration-tests/src/full_client/frame/contracts.rs +++ b/testing/integration-tests/src/full_client/frame/contracts.rs @@ -9,7 +9,8 @@ use crate::{ runtime_types::{pallet_contracts::wasm::Determinism, sp_weights::weight_v2::Weight}, system, }, - submit_tx_wait_for_finalized_success, test_context, TestClient, TestConfig, TestContext, + submit_tx_wait_for_finalized_success, subxt_test, test_context, TestClient, TestConfig, + TestContext, }; use subxt::ext::futures::StreamExt; use subxt::{tx::TxProgress, utils::MultiAddress, Config, Error}; diff --git a/testing/integration-tests/src/full_client/frame/staking.rs b/testing/integration-tests/src/full_client/frame/staking.rs index fd2ea0008f..95a8ddee35 100644 --- a/testing/integration-tests/src/full_client/frame/staking.rs +++ b/testing/integration-tests/src/full_client/frame/staking.rs @@ -11,7 +11,7 @@ use crate::{ }, staking, }, - submit_tx_wait_for_finalized_success, test_context, + submit_tx_wait_for_finalized_success, subxt_test, test_context, }; use assert_matches::assert_matches; use subxt::error::{DispatchError, Error}; diff --git a/testing/integration-tests/src/full_client/frame/sudo.rs b/testing/integration-tests/src/full_client/frame/sudo.rs index 11f332e262..27a9b4e639 100644 --- a/testing/integration-tests/src/full_client/frame/sudo.rs +++ b/testing/integration-tests/src/full_client/frame/sudo.rs @@ -8,7 +8,7 @@ use crate::{ runtime_types::{self, sp_weights::weight_v2::Weight}, sudo, }, - submit_tx_wait_for_finalized_success, test_context, + submit_tx_wait_for_finalized_success, subxt_test, test_context, }; use subxt_signer::sr25519::dev; diff --git a/testing/integration-tests/src/full_client/frame/system.rs b/testing/integration-tests/src/full_client/frame/system.rs index b110d782b7..0876feeb96 100644 --- a/testing/integration-tests/src/full_client/frame/system.rs +++ b/testing/integration-tests/src/full_client/frame/system.rs @@ -4,7 +4,7 @@ use crate::{ node_runtime::{self, system}, - submit_tx_wait_for_finalized_success, test_context, + submit_tx_wait_for_finalized_success, subxt_test, test_context, }; use assert_matches::assert_matches; use subxt_signer::sr25519::dev; diff --git a/testing/integration-tests/src/full_client/frame/timestamp.rs b/testing/integration-tests/src/full_client/frame/timestamp.rs index 44cd06b184..7df9345fab 100644 --- a/testing/integration-tests/src/full_client/frame/timestamp.rs +++ b/testing/integration-tests/src/full_client/frame/timestamp.rs @@ -2,7 +2,7 @@ // This file is dual-licensed as Apache-2.0 or GPL-3.0. // see LICENSE for license details. -use crate::{node_runtime, test_context}; +use crate::{node_runtime, subxt_test, test_context}; #[subxt_test(timeout = 800)] async fn storage_get_current_timestamp() { diff --git a/testing/integration-tests/src/full_client/metadata/validation.rs b/testing/integration-tests/src/full_client/metadata/validation.rs index 215bbaafec..253720a652 100644 --- a/testing/integration-tests/src/full_client/metadata/validation.rs +++ b/testing/integration-tests/src/full_client/metadata/validation.rs @@ -2,7 +2,7 @@ // This file is dual-licensed as Apache-2.0 or GPL-3.0. // see LICENSE for license details. -use crate::{node_runtime, test_context, TestContext}; +use crate::{node_runtime, subxt_test, test_context, TestContext}; use frame_metadata::v15::{ CustomMetadata, ExtrinsicMetadata, OuterEnums, PalletCallMetadata, PalletMetadata, PalletStorageMetadata, RuntimeMetadataV15, StorageEntryMetadata, StorageEntryModifier, diff --git a/testing/integration-tests/src/full_client/runtime_api/mod.rs b/testing/integration-tests/src/full_client/runtime_api/mod.rs index e18df2bcda..9c766aaeda 100644 --- a/testing/integration-tests/src/full_client/runtime_api/mod.rs +++ b/testing/integration-tests/src/full_client/runtime_api/mod.rs @@ -2,7 +2,7 @@ // This file is dual-licensed as Apache-2.0 or GPL-3.0. // see LICENSE for license details. -use crate::{node_runtime, submit_tx_wait_for_finalized_success, test_context}; +use crate::{node_runtime, submit_tx_wait_for_finalized_success, subxt_test, test_context}; use codec::Encode; use subxt::utils::AccountId32; use subxt_signer::sr25519::dev; diff --git a/testing/integration-tests/src/full_client/storage/mod.rs b/testing/integration-tests/src/full_client/storage/mod.rs index 783687a2a1..d52bdd5f2a 100644 --- a/testing/integration-tests/src/full_client/storage/mod.rs +++ b/testing/integration-tests/src/full_client/storage/mod.rs @@ -2,7 +2,7 @@ // This file is dual-licensed as Apache-2.0 or GPL-3.0. // see LICENSE for license details. -use crate::{node_runtime, test_context, utils::wait_for_blocks}; +use crate::{node_runtime, subxt_test, test_context, utils::wait_for_blocks}; #[cfg(fullclient)] use subxt::utils::AccountId32;