diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 71e9abfe2fe..37c0a4b9474 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -363,7 +363,11 @@ examples-test: - *start-substrate-contracts-node - for example in examples/*/; do if [ "$example" = "examples/upgradeable-contracts/" ]; then continue; fi; - cargo test --verbose --manifest-path ${example}/Cargo.toml; + if grep -q "e2e-tests = \[\]" "${example}/Cargo.toml"; then + cargo test --verbose --manifest-path ${example}/Cargo.toml --features e2e-tests; + else + cargo test --verbose --manifest-path ${example}/Cargo.toml; + fi; done - for contract in ${DELEGATOR_SUBCONTRACTS}; do cargo test --verbose --manifest-path ./examples/delegator/${contract}/Cargo.toml; diff --git a/crates/e2e/Cargo.toml b/crates/e2e/Cargo.toml index 1c38469fe7c..0addfc68acc 100644 --- a/crates/e2e/Cargo.toml +++ b/crates/e2e/Cargo.toml @@ -21,7 +21,7 @@ ink_env = { version = "4.0.0-alpha.3", path = "../env" } contract-metadata = { version = "2.0.0-alpha.4" } impl-serde = { version = "0.3.1", default-features = false } jsonrpsee = { version = "0.16.0", features = ["ws-client"] } -pallet-contracts-primitives = { version = "6.0.0" } +pallet-contracts-primitives = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33", package = "pallet-contracts-primitives" } serde = { version = "1.0.137", default-features = false, features = ["derive"] } serde_json = { version = "1.0.81" } tokio = { version = "1.18.2", features = ["rt-multi-thread"] } @@ -29,13 +29,14 @@ log = { version = "0.4" } env_logger = { version = "0.9" } scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive", "full"] } # TODO we need to use `subxt` `master` until the next release 0.25 is published. -subxt = { git = "https://github.com/paritytech/subxt" } +subxt = { git = "https://github.com/paritytech/subxt", branch = "polkadot-v0.9.33", package = "subxt" } # Substrate -sp-rpc = { version = "6.0.0" } -sp-core = { version = "6.0.0" } -sp-keyring = { version = "6.0.0" } -sp-runtime = { version = "6.0.0" } +sp-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33", package = "sp-rpc" } +sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33", package = "sp-core" } +sp-keyring = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33", package = "sp-keyring" } +sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33", package = "sp-runtime" } +sp-weights = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33", package = "sp-weights" } # 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-cross-contract", package = "smart-bench-macro" } diff --git a/crates/e2e/metadata/contracts-node.scale b/crates/e2e/metadata/contracts-node.scale index 144d35f9370..69ffcbe54b7 100644 Binary files a/crates/e2e/metadata/contracts-node.scale and b/crates/e2e/metadata/contracts-node.scale differ diff --git a/crates/e2e/src/xts.rs b/crates/e2e/src/xts.rs index 11f00f8a6aa..0c1c46d6c42 100644 --- a/crates/e2e/src/xts.rs +++ b/crates/e2e/src/xts.rs @@ -21,10 +21,7 @@ use super::{ Signer, Verify, }; -use ink_env::{ - Environment, - Gas, -}; +use ink_env::Environment; use core::marker::PhantomData; use jsonrpsee::{ @@ -40,15 +37,13 @@ use sp_core::{ Bytes, H256, }; +use sp_weights::Weight; use subxt::{ blocks::ExtrinsicEvents, tx::ExtrinsicParams, OnlineClient, }; -/// The gas limit for contract instantiate and call dry runs. -const DRY_RUN_GAS_LIMIT: u64 = 500_000_000_000; - // TODO(#1422) Should be fetched automatically. #[subxt::subxt( crate = "crate::subxt", @@ -61,8 +56,7 @@ pub(super) mod api {} pub struct InstantiateWithCode { #[codec(compact)] value: B, - #[codec(compact)] - gas_limit: Gas, + gas_limit: Weight, storage_deposit_limit: Option, code: Vec, data: Vec, @@ -75,8 +69,7 @@ pub struct Call { dest: sp_runtime::MultiAddress, #[codec(compact)] value: B, - #[codec(compact)] - gas_limit: Gas, + gas_limit: Weight, storage_deposit_limit: Option, data: Vec, } @@ -94,7 +87,7 @@ pub struct UploadCode { struct RpcInstantiateRequest { origin: C::AccountId, value: E::Balance, - gas_limit: Gas, + gas_limit: Option, storage_deposit_limit: Option, code: Code, data: Vec, @@ -122,7 +115,7 @@ struct RpcCallRequest { origin: C::AccountId, dest: C::AccountId, value: E::Balance, - gas_limit: Gas, + gas_limit: Option, storage_deposit_limit: Option, input_data: Vec, } @@ -194,7 +187,7 @@ where let call_request = RpcInstantiateRequest:: { origin: signer.account_id().clone(), value, - gas_limit: DRY_RUN_GAS_LIMIT, + gas_limit: None, storage_deposit_limit, code, data, @@ -222,7 +215,7 @@ where pub async fn instantiate_with_code( &self, value: E::Balance, - gas_limit: Gas, + gas_limit: Weight, storage_deposit_limit: Option, code: Vec, data: Vec, @@ -361,7 +354,7 @@ where origin, dest: contract, value, - gas_limit: DRY_RUN_GAS_LIMIT, + gas_limit: None, storage_deposit_limit, input_data, }; @@ -386,7 +379,7 @@ where &self, contract: sp_runtime::MultiAddress, value: E::Balance, - gas_limit: Gas, + gas_limit: Weight, storage_deposit_limit: Option, data: Vec, signer: &Signer,