diff --git a/crates/e2e/macro/src/codegen.rs b/crates/e2e/macro/src/codegen.rs index 2659e03f225..815ba900d75 100644 --- a/crates/e2e/macro/src/codegen.rs +++ b/crates/e2e/macro/src/codegen.rs @@ -147,8 +147,8 @@ impl InkE2ETest { quote! { #( #attrs )* - #[::ink_e2e::tokio::test] - async #vis fn #fn_name () #ret { + #[test] + #vis fn #fn_name () #ret { use ::ink_e2e::log_info; ::ink_e2e::LOG_PREFIX.with(|log_prefix| { let str = format!("test: {}", stringify!(#fn_name)); @@ -166,16 +166,26 @@ impl InkE2ETest { log_info("creating new client"); - // TODO(#xxx) Make those two generic environments customizable. - let mut client = ::ink_e2e::Client::< - ::ink_e2e::PolkadotConfig, - ink::env::DefaultEnvironment - >::new(&#path, &#ws_url, &#node_log).await; - - let __ret = { - #block + let run = async { + // TODO(#xxx) Make those two generic environments customizable. + let mut client = ::ink_e2e::Client::< + ::ink_e2e::PolkadotConfig, + ink::env::DefaultEnvironment + >::new(&#path, &#ws_url, &#node_log).await; + + let __ret = { + #block + }; + __ret }; - __ret + + { + return ::ink_e2e::tokio::runtime::Builder::new_current_thread() + .enable_all() + .build() + .expect("Failed building the Runtime") + .block_on(run); + } } } } diff --git a/examples/contract-transfer/lib.rs b/examples/contract-transfer/lib.rs index 30ca3280c27..a234a6498d6 100644 --- a/examples/contract-transfer/lib.rs +++ b/examples/contract-transfer/lib.rs @@ -184,7 +184,6 @@ pub mod give_me { mod e2e_tests { type E2EResult = std::result::Result>; - // todo: [AJ] fix compilation error here with tokio reexport: `failed to resolve: use of undeclared crate or module `tokio`` #[ink_e2e::e2e_test] async fn e2e_sending_value_to_give_me_must_fail( mut client: ink_e2e::Client,