diff --git a/crates/env/Cargo.toml b/crates/env/Cargo.toml index 68fb266c36d..290decf5871 100644 --- a/crates/env/Cargo.toml +++ b/crates/env/Cargo.toml @@ -50,25 +50,25 @@ secp256k1 = { version = "0.24", features = ["recovery", "global-context"], optio rand = { version = "0.8", default-features = false, features = ["alloc"], optional = true } scale-info = { version = "2", default-features = false, features = ["derive"], optional = true } -contract-metadata = "2.0.0-alpha.2" -impl-serde = { version = "0.3.1", default-features = false } -jsonrpsee = { version = "0.14.0", features = ["ws-client"] } -pallet-contracts-primitives = "6.0.0" -serde = { version = "1.0.137", default-features = false, features = ["derive"] } -serde_json = "1.0.81" -tokio = { version = "1.18.2", features = ["rt-multi-thread"] } -log = "0.4" -env_logger = "0.8" -subxt = "0.24.0" +contract-metadata = { version = "2.0.0-alpha.2", optional = true } +impl-serde = { version = "0.3.1", default-features = false, optional = true } +jsonrpsee = { version = "0.14.0", features = ["ws-client"], optional = true } +pallet-contracts-primitives = { version = "6.0.0", optional = true } +serde = { version = "1.0.137", default-features = false, features = ["derive"], optional = true } +serde_json = { version = "1.0.81", optional = true } +tokio = { version = "1.18.2", features = ["rt-multi-thread"], optional = true } +log = { version = "0.4", optional = true } +env_logger = { version = "0.8", optional = true } +subxt = { version = "0.24.0", optional = true } # Substrate -sp-rpc = "6.0.0" -sp-core = "6.0.0" -sp-keyring = "6.0.0" -sp-runtime = "6.0.0" +sp-rpc = { version = "6.0.0", optional = true } +sp-core = { version = "6.0.0", optional = true } +sp-keyring = { version = "6.0.0", optional = true } +sp-runtime = { version = "6.0.0", optional = true } -# TODO(#xxx) `smart-bench_macro` needs to be forked. -smart-bench-macro = { git = "https://github.com/paritytech/smart-bench", branch = "cmichi-ink-e2e-test-mvp", package = "smart-bench-macro"} +# TODO(#1421) `smart-bench_macro` needs to be forked. +smart-bench-macro = { git = "https://github.com/paritytech/smart-bench", branch = "cmichi-ink-e2e-test-mvp", package = "smart-bench-macro", optional = true} [features] default = ["std"] @@ -89,6 +89,22 @@ std = [ "sha2", "sha3", "blake2", + # E2E testing environment + "contract-metadata", + "impl-serde", + "jsonrpsee", + "pallet-contracts-primitives", + "serde", + "serde_json", + "tokio", + "log", + "env_logger", + "subxt", + "sp-rpc", + "sp-core", + "sp-keyring", + "sp-runtime", + "smart-bench-macro", ] # Enable contract debug messages via `debug_print!` and `debug_println!`. ink-debug = [] diff --git a/crates/env/src/engine/e2e/client.rs b/crates/env/src/engine/e2e/client.rs index 2e50701c4fa..64994589d0a 100644 --- a/crates/env/src/engine/e2e/client.rs +++ b/crates/env/src/engine/e2e/client.rs @@ -509,7 +509,7 @@ where /// Returns true if the `substrate-contracts-node` log under /// `/tmp/contracts-node.log` contains `msg`. - /// TODO(#xxx) Matches on any log entry currently, even if done + /// TODO(#1423) Matches on any log entry currently, even if done /// by a different test. pub fn node_log_contains(&self, msg: &str) -> bool { let output = std::process::Command::new("grep") diff --git a/crates/env/src/engine/e2e/mod.rs b/crates/env/src/engine/e2e/mod.rs index 4f862cb8756..214ddc61ef1 100644 --- a/crates/env/src/engine/e2e/mod.rs +++ b/crates/env/src/engine/e2e/mod.rs @@ -23,7 +23,7 @@ pub use client::{ Error, }; pub use default_accounts::*; -// TODO(#xxx) `smart-bench_macro` needs to be forked. +// TODO(#1421) `smart-bench_macro` needs to be forked. use pallet_contracts_primitives::{ ContractExecResult, ContractInstantiateResult, @@ -80,7 +80,7 @@ pub type PolkadotConfig = subxt::config::WithExtrinsicParams< pub type Signer = PairSigner; /// Trait for contract constructors. -// TODO(#xxx) Merge this with `InkMessage` to be just `InkSelector`. Requires forking `smart-bench-macro`. +// TODO(#1421) Merge this with `InkMessage` to be just `InkSelector`. Requires forking `smart-bench-macro`. pub trait InkConstructor: scale::Encode { /// An ink! selector consists of four bytes. const SELECTOR: [u8; 4]; diff --git a/crates/env/src/engine/e2e/xts.rs b/crates/env/src/engine/e2e/xts.rs index 17e4b9e288b..e6d634c23ff 100644 --- a/crates/env/src/engine/e2e/xts.rs +++ b/crates/env/src/engine/e2e/xts.rs @@ -47,7 +47,7 @@ use subxt::{ /// The gas limit for contract instantiate and call dry runs. const DRY_RUN_GAS_LIMIT: u64 = 500_000_000_000; -// TODO(#xxx) Should be fetched automatically. +// TODO(#1422) Should be fetched automatically. #[subxt::subxt(runtime_metadata_path = "metadata/contracts-node.scale")] pub(super) mod api {} @@ -302,13 +302,15 @@ where ) .unvalidated(); - self - .client + self.client .tx() .sign_and_submit_then_watch_default(&call, signer) .await .map(|tx_progress| { - log_info(&format!("signed and submitted call with extrinsic hash {:?}", tx_progress.extrinsic_hash())); + log_info(&format!( + "signed and submitted call with extrinsic hash {:?}", + tx_progress.extrinsic_hash() + )); tx_progress }) .unwrap_or_else(|err| { @@ -317,22 +319,15 @@ where err ); }) - // TODO(#xxx) It should be configurable to use `.wait_for_finalized_success` instead. .wait_for_in_block() .await .unwrap_or_else(|err| { - panic!( - "error on call `wait_for_in_block`: {:?}", - err - ); + panic!("error on call `wait_for_in_block`: {:?}", err); }) .fetch_events() .await .unwrap_or_else(|err| { - panic!( - "error on call `fetch_events`: {:?}", - err - ); + panic!("error on call `fetch_events`: {:?}", err); }) } } diff --git a/crates/ink/codegen/src/generator/ink_e2e_test.rs b/crates/ink/codegen/src/generator/ink_e2e_test.rs index 897946d0fee..4c49c8b7442 100644 --- a/crates/ink/codegen/src/generator/ink_e2e_test.rs +++ b/crates/ink/codegen/src/generator/ink_e2e_test.rs @@ -161,7 +161,7 @@ impl GenerateCode for InkE2ETest<'_> { }); log_info("extracting metadata"); - // TODO(#xxx) `smart-bench_macro` needs to be forked. + // TODO(#1421) `smart-bench_macro` needs to be forked. ink::env::e2e::smart_bench_macro::contract!(#path); log_info("creating new client");