From db9252ae553b3c94ecb5395d18bf42816c7f4b3e Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Tue, 25 Jul 2023 10:32:32 +0100 Subject: [PATCH 01/13] WIP start using subxt-signer crate --- crates/e2e/Cargo.toml | 3 +- crates/e2e/src/client.rs | 37 +++++++------- crates/e2e/src/default_accounts.rs | 50 ------------------- crates/e2e/src/lib.rs | 15 ++---- crates/e2e/src/xts.rs | 18 +++---- integration-tests/e2e-call-runtime/Cargo.toml | 2 +- 6 files changed, 35 insertions(+), 90 deletions(-) delete mode 100644 crates/e2e/src/default_accounts.rs diff --git a/crates/e2e/Cargo.toml b/crates/e2e/Cargo.toml index 7997b09505..b35ec91d8f 100644 --- a/crates/e2e/Cargo.toml +++ b/crates/e2e/Cargo.toml @@ -29,7 +29,8 @@ tokio = { version = "1.18.2", features = ["rt-multi-thread"] } tracing = "0.1.37" tracing-subscriber = { version = "0.3.17", features = ["env-filter"] } scale = { package = "parity-scale-codec", version = "3.4", default-features = false, features = ["derive"] } -subxt = "0.29.0" +subxt = "0.30.0" +subxt-signer = { version = "0.30.0", features = ["sr25519"] } # Substrate pallet-contracts-primitives = "24.0.0" diff --git a/crates/e2e/src/client.rs b/crates/e2e/src/client.rs index 7d4c56f3af..801b8c6f91 100644 --- a/crates/e2e/src/client.rs +++ b/crates/e2e/src/client.rs @@ -27,7 +27,6 @@ use super::{ sr25519, ContractInstantiateResult, ContractsApi, - Signer, }; use crate::contract_results::{ CallDryRunResult, @@ -64,8 +63,8 @@ use subxt::{ Value, ValueDef, }, - tx::PairSigner, }; +use subxt_signer::sr25519::Keypair; pub type Error = crate::error::Error< ::AccountId, @@ -139,17 +138,18 @@ where /// number of times. pub async fn create_and_fund_account( &self, - origin: &Signer, + origin: &Keypair, amount: E::Balance, - ) -> Signer + ) -> Keypair where E::Balance: Clone, C::AccountId: Clone + core::fmt::Display + Debug, - C::AccountId: From, + C::AccountId: From<[u8; 32]>, { - let (pair, _, _) = ::generate_with_phrase(None); - let pair_signer = PairSigner::::new(pair); - let account_id = pair_signer.account_id().to_owned(); + let (_, phrase, _) = ::generate_with_phrase(None); + let phrase = subxt_signer::bip39::Mnemonic::parse(phrase).expect("valid phrase expected"); + let keypair = subxt_signer::sr25519::Keypair::from_phrase(&phrase, None).expect("valid phrase expected"); + let account_id = keypair.public_key().0.into(); self.api .try_transfer_balance(origin, account_id.clone(), amount) @@ -169,7 +169,7 @@ where account_id, )); - pair_signer + keypair } /// This function extracts the metadata of the contract at the file path @@ -183,7 +183,7 @@ where pub async fn instantiate( &mut self, contract_name: &str, - signer: &Signer, + signer: &Keypair, constructor: CreateBuilderPartial, value: E::Balance, storage_deposit_limit: Option, @@ -209,7 +209,7 @@ where pub async fn instantiate_dry_run( &mut self, contract_name: &str, - signer: &Signer, + signer: &Keypair, constructor: CreateBuilderPartial, value: E::Balance, storage_deposit_limit: Option, @@ -256,7 +256,7 @@ where /// Executes an `instantiate_with_code` call and captures the resulting events. async fn exec_instantiate( &mut self, - signer: &Signer, + signer: &Keypair, code: Vec, constructor: CreateBuilderPartial, value: E::Balance, @@ -368,7 +368,7 @@ where pub async fn upload( &mut self, contract_name: &str, - signer: &Signer, + signer: &Keypair, storage_deposit_limit: Option, ) -> Result>, Error> { let code = self.load_code(contract_name); @@ -382,7 +382,7 @@ where /// Executes an `upload` call and captures the resulting events. pub async fn exec_upload( &mut self, - signer: &Signer, + signer: &Keypair, code: Vec, storage_deposit_limit: Option, ) -> Result>, Error> { @@ -453,7 +453,7 @@ where /// contains all events that are associated with this transaction. pub async fn call( &mut self, - signer: &Signer, + signer: &Keypair, message: &CallBuilderFinal, value: E::Balance, storage_deposit_limit: Option, @@ -519,7 +519,7 @@ where /// contains all events that are associated with this transaction. pub async fn runtime_call<'a>( &mut self, - signer: &Signer, + signer: &Keypair, pallet_name: &'a str, call_name: &'a str, call_data: Vec, @@ -554,7 +554,7 @@ where /// invoked message. pub async fn call_dry_run( &mut self, - signer: &Signer, + signer: &Keypair, message: &CallBuilderFinal, value: E::Balance, storage_deposit_limit: Option, @@ -562,6 +562,7 @@ where where Args: scale::Encode, RetType: scale::Decode, + C::AccountId: From<[u8; 32]>, CallBuilderFinal: Clone, { let dest = message.clone().params().callee().clone(); @@ -570,7 +571,7 @@ where let exec_result = self .api .call_dry_run( - Signer::account_id(signer).clone(), + signer.public_key().0.into(), dest, exec_input, value, diff --git a/crates/e2e/src/default_accounts.rs b/crates/e2e/src/default_accounts.rs deleted file mode 100644 index fe8349d887..0000000000 --- a/crates/e2e/src/default_accounts.rs +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright 2018-2022 Parity Technologies (UK) Ltd. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//! Default accounts provided by [`sp_keyring::sr25519::Keyring`]. - -use super::{ - AccountKeyring, - PairSigner, -}; -use sp_core::sr25519; - -#[rustfmt::skip] -macro_rules! default_account { - ($fn_name:ident $keyring_fn_name:ident) => { - #[doc = concat!( - "Returns the default [`sp_keyring::sr25519::Keyring`] for `//", - stringify!($keyring_fn_name), - "`." - )] - pub fn $fn_name() -> PairSigner - where - C: subxt::Config, - C::Signature: From, - C::AccountId: From - { - PairSigner::new(AccountKeyring::$keyring_fn_name.pair()) - } - }; -} - -// The following accounts are pre-defined in [`sp-keyring::sr25519`]. -default_account!(alice Alice); -default_account!(bob Bob); -default_account!(charlie Charlie); -default_account!(dave Dave); -default_account!(eve Eve); -default_account!(ferdie Ferdie); -default_account!(one One); -default_account!(two Two); diff --git a/crates/e2e/src/lib.rs b/crates/e2e/src/lib.rs index 8da67d3724..39a6978af7 100644 --- a/crates/e2e/src/lib.rs +++ b/crates/e2e/src/lib.rs @@ -22,7 +22,6 @@ mod builders; mod client; mod contract_results; -mod default_accounts; mod error; pub mod events; mod node_proc; @@ -39,7 +38,6 @@ pub use contract_results::{ InstantiationResult, UploadResult, }; -pub use default_accounts::*; pub use ink_e2e_macro::test; pub use node_proc::{ TestNodeProcess, @@ -47,9 +45,10 @@ pub use node_proc::{ }; pub use sp_core::H256; pub use sp_keyring::AccountKeyring; -pub use subxt::{ - self, - tx::PairSigner, +pub use subxt; +pub use subxt_signer::sr25519::{ + dev, + Keypair }; pub use tokio; pub use tracing_subscriber; @@ -67,12 +66,6 @@ use xts::ContractsApi; pub use subxt::PolkadotConfig; -/// Signer that is used throughout the E2E testing. -/// -/// The E2E testing can only be used with nodes that support `sr25519` -/// cryptography. -pub type Signer = PairSigner; - /// We use this to only initialize `env_logger` once. pub static INIT: Once = Once::new(); diff --git a/crates/e2e/src/xts.rs b/crates/e2e/src/xts.rs index 49e9245dbd..09fa30cd3f 100644 --- a/crates/e2e/src/xts.rs +++ b/crates/e2e/src/xts.rs @@ -17,7 +17,7 @@ use super::{ sr25519, ContractExecResult, ContractInstantiateResult, - Signer, + Keypair, }; use ink_env::Environment; @@ -231,7 +231,7 @@ where /// invalid (e.g. out of date nonce) pub async fn try_transfer_balance( &self, - origin: &Signer, + origin: &Keypair, dest: C::AccountId, value: E::Balance, ) -> Result<(), subxt::Error> { @@ -266,7 +266,7 @@ where code: Vec, data: Vec, salt: Vec, - signer: &Signer, + signer: &Keypair, ) -> ContractInstantiateResult { let code = Code::Upload(code); let call_request = RpcInstantiateRequest:: { @@ -297,7 +297,7 @@ where pub async fn submit_extrinsic( &self, call: &Call, - signer: &Signer, + signer: &Keypair, ) -> ExtrinsicEvents where Call: subxt::tx::TxPayload, @@ -341,7 +341,7 @@ where code: Vec, data: Vec, salt: Vec, - signer: &Signer, + signer: &Keypair, ) -> ExtrinsicEvents { let call = subxt::tx::Payload::new( "Contracts", @@ -363,7 +363,7 @@ where /// Dry runs the upload of the given `code`. pub async fn upload_dry_run( &self, - signer: &Signer, + signer: &Keypair, code: Vec, storage_deposit_limit: Option, ) -> CodeUploadResult { @@ -393,7 +393,7 @@ where /// contains all events that are associated with this transaction. pub async fn upload( &self, - signer: &Signer, + signer: &Keypair, code: Vec, storage_deposit_limit: Option, ) -> ExtrinsicEvents { @@ -453,7 +453,7 @@ where gas_limit: Weight, storage_deposit_limit: Option, data: Vec, - signer: &Signer, + signer: &Keypair, ) -> ExtrinsicEvents { let call = subxt::tx::Payload::new( "Contracts", @@ -479,7 +479,7 @@ where /// contains all events that are associated with this transaction. pub async fn runtime_call<'a>( &self, - signer: &Signer, + signer: &Keypair, pallet_name: &'a str, call_name: &'a str, call_data: Vec, diff --git a/integration-tests/e2e-call-runtime/Cargo.toml b/integration-tests/e2e-call-runtime/Cargo.toml index 51647de56d..d10e649b74 100644 --- a/integration-tests/e2e-call-runtime/Cargo.toml +++ b/integration-tests/e2e-call-runtime/Cargo.toml @@ -13,7 +13,7 @@ scale-info = { version = "2.6", default-features = false, features = ["derive"], [dev-dependencies] ink_e2e = { path = "../../crates/e2e" } -subxt = { version = "0.29.0", default-features = false } +subxt = { version = "0.30.0", default-features = false } [lib] path = "lib.rs" From c725c684bbe2fb17b03ab5f25dc6250d44ad4980 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Tue, 25 Jul 2023 11:15:05 +0100 Subject: [PATCH 02/13] WIP updating subxt signing --- crates/e2e/Cargo.toml | 2 +- crates/e2e/src/client.rs | 33 +++++++++++++++------------------ crates/e2e/src/lib.rs | 4 ++-- crates/e2e/src/xts.rs | 6 +++--- 4 files changed, 21 insertions(+), 24 deletions(-) diff --git a/crates/e2e/Cargo.toml b/crates/e2e/Cargo.toml index b35ec91d8f..f7dae1f227 100644 --- a/crates/e2e/Cargo.toml +++ b/crates/e2e/Cargo.toml @@ -30,7 +30,7 @@ tracing = "0.1.37" tracing-subscriber = { version = "0.3.17", features = ["env-filter"] } scale = { package = "parity-scale-codec", version = "3.4", default-features = false, features = ["derive"] } subxt = "0.30.0" -subxt-signer = { version = "0.30.0", features = ["sr25519"] } +subxt-signer = { version = "0.30.0", features = ["subxt", "sr25519"] } # Substrate pallet-contracts-primitives = "24.0.0" diff --git a/crates/e2e/src/client.rs b/crates/e2e/src/client.rs index 801b8c6f91..2e08009920 100644 --- a/crates/e2e/src/client.rs +++ b/crates/e2e/src/client.rs @@ -27,6 +27,7 @@ use super::{ sr25519, ContractInstantiateResult, ContractsApi, + Keypair, }; use crate::contract_results::{ CallDryRunResult, @@ -45,7 +46,6 @@ use ink_env::{ }, Environment, }; -use sp_core::Pair; #[cfg(feature = "std")] use std::{ collections::BTreeMap, @@ -63,8 +63,8 @@ use subxt::{ Value, ValueDef, }, + tx::Signer, }; -use subxt_signer::sr25519::Keypair; pub type Error = crate::error::Error< ::AccountId, @@ -97,12 +97,11 @@ where impl Client where C: subxt::Config, - C::AccountId: From - + scale::Codec - + serde::de::DeserializeOwned - + Debug, + C::AccountId: + From + scale::Codec + serde::de::DeserializeOwned + Debug, + C::Address: From, C::Signature: From, - >::OtherParams: Default, + >::OtherParams: Default, E: Environment, E::AccountId: Debug, @@ -144,12 +143,14 @@ where where E::Balance: Clone, C::AccountId: Clone + core::fmt::Display + Debug, - C::AccountId: From<[u8; 32]>, { - let (_, phrase, _) = ::generate_with_phrase(None); - let phrase = subxt_signer::bip39::Mnemonic::parse(phrase).expect("valid phrase expected"); - let keypair = subxt_signer::sr25519::Keypair::from_phrase(&phrase, None).expect("valid phrase expected"); - let account_id = keypair.public_key().0.into(); + let (_, phrase, _) = + ::generate_with_phrase(None); + let phrase = + subxt_signer::bip39::Mnemonic::parse(phrase).expect("valid phrase expected"); + let keypair = Keypair::from_phrase(&phrase, None).expect("valid phrase expected"); + let account_id = >::account_id(&keypair); + let origin_account_id = origin.public_key().to_account_id(); self.api .try_transfer_balance(origin, account_id.clone(), amount) @@ -157,16 +158,13 @@ where .unwrap_or_else(|err| { panic!( "transfer from {} to {} failed with {:?}", - origin.account_id(), - account_id, - err + origin_account_id, account_id, err ) }); log_info(&format!( "transfer from {} to {} succeeded", - origin.account_id(), - account_id, + origin_account_id, account_id, )); keypair @@ -562,7 +560,6 @@ where where Args: scale::Encode, RetType: scale::Decode, - C::AccountId: From<[u8; 32]>, CallBuilderFinal: Clone, { let dest = message.clone().params().callee().clone(); diff --git a/crates/e2e/src/lib.rs b/crates/e2e/src/lib.rs index 39a6978af7..4c4b01f959 100644 --- a/crates/e2e/src/lib.rs +++ b/crates/e2e/src/lib.rs @@ -47,8 +47,9 @@ pub use sp_core::H256; pub use sp_keyring::AccountKeyring; pub use subxt; pub use subxt_signer::sr25519::{ + self, dev, - Keypair + Keypair, }; pub use tokio; pub use tracing_subscriber; @@ -57,7 +58,6 @@ use pallet_contracts_primitives::{ ContractExecResult, ContractInstantiateResult, }; -use sp_core::sr25519; use std::{ cell::RefCell, sync::Once, diff --git a/crates/e2e/src/xts.rs b/crates/e2e/src/xts.rs index 09fa30cd3f..9b598436b6 100644 --- a/crates/e2e/src/xts.rs +++ b/crates/e2e/src/xts.rs @@ -209,10 +209,10 @@ pub struct ContractsApi { impl ContractsApi where C: subxt::Config, - C::AccountId: serde::de::DeserializeOwned, - C::AccountId: scale::Codec, + C::AccountId: From + serde::de::DeserializeOwned + scale::Codec, + C::Address: From, C::Signature: From, - >::OtherParams: Default, + >::OtherParams: Default, E: Environment, E::Balance: scale::HasCompact + serde::Serialize, From 8467a6643bffb902758bd3b85e506ca2a8c5ea54 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Tue, 25 Jul 2023 12:25:39 +0100 Subject: [PATCH 03/13] Fix signer errors --- crates/e2e/src/client.rs | 2 +- crates/e2e/src/xts.rs | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/crates/e2e/src/client.rs b/crates/e2e/src/client.rs index 2e08009920..caac116024 100644 --- a/crates/e2e/src/client.rs +++ b/crates/e2e/src/client.rs @@ -568,7 +568,7 @@ where let exec_result = self .api .call_dry_run( - signer.public_key().0.into(), + Signer::::account_id(signer), dest, exec_input, value, diff --git a/crates/e2e/src/xts.rs b/crates/e2e/src/xts.rs index 9b598436b6..afa2bb8fd8 100644 --- a/crates/e2e/src/xts.rs +++ b/crates/e2e/src/xts.rs @@ -32,6 +32,7 @@ use subxt::{ config::ExtrinsicParams, ext::scale_encode, rpc_params, + tx::Signer, utils::MultiAddress, OnlineClient, }; @@ -270,7 +271,7 @@ where ) -> ContractInstantiateResult { let code = Code::Upload(code); let call_request = RpcInstantiateRequest:: { - origin: subxt::tx::Signer::account_id(signer).clone(), + origin: Signer::::account_id(signer), value, gas_limit: None, storage_deposit_limit, @@ -368,7 +369,7 @@ where storage_deposit_limit: Option, ) -> CodeUploadResult { let call_request = RpcCodeUploadRequest:: { - origin: subxt::tx::Signer::account_id(signer).clone(), + origin: Signer::::account_id(signer).clone(), code, storage_deposit_limit, determinism: Determinism::Enforced, From ca7daedcaa5d03617205ac35f972c6431a58e722 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Tue, 25 Jul 2023 12:30:29 +0100 Subject: [PATCH 04/13] Expose dev accounts --- crates/e2e/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/e2e/src/lib.rs b/crates/e2e/src/lib.rs index 4c4b01f959..2bf46f4d06 100644 --- a/crates/e2e/src/lib.rs +++ b/crates/e2e/src/lib.rs @@ -48,7 +48,7 @@ pub use sp_keyring::AccountKeyring; pub use subxt; pub use subxt_signer::sr25519::{ self, - dev, + dev::*, Keypair, }; pub use tokio; From 627eedc7412eeca2b8806388d770e781f59b76a1 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Tue, 25 Jul 2023 12:33:04 +0100 Subject: [PATCH 05/13] Use workspace deps --- Cargo.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 31f74cf961..a0046a36b5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -64,7 +64,8 @@ serde_json = { version = "1.0.81" } sha2 = { version = "0.10" } sha3 = { version = "0.10" } static_assertions = { version = "1.1" } -subxt = { version = "0.29.0" } +subxt = { version = "0.30.0" } +subxt-signer = { version = "0.30.0" } syn = { version = "2" } synstructure = { version = "0.13.0" } tokio = { version = "1.18.2" } From 7368ffa78d2533fc532c0e7ca2c62c857bfdfdc1 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Wed, 26 Jul 2023 13:42:52 +0100 Subject: [PATCH 06/13] Default build args --- crates/e2e/macro/src/codegen.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/crates/e2e/macro/src/codegen.rs b/crates/e2e/macro/src/codegen.rs index fb81939c4c..6cf9c16899 100644 --- a/crates/e2e/macro/src/codegen.rs +++ b/crates/e2e/macro/src/codegen.rs @@ -293,6 +293,7 @@ fn build_contract(path_to_cargo_toml: &str) -> String { output_type: OutputType::HumanReadable, skip_wasm_validation: false, target: Target::Wasm, + ..ExecuteArgs::default() }; match contract_build::execute(args) { From 64ba4ce206eb2e9af02065108bdd5eeb81c81dde Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Wed, 26 Jul 2023 13:45:28 +0100 Subject: [PATCH 07/13] Use latest CI image for stable Rust --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 985fcf1f35..9f72b9743c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -26,7 +26,7 @@ variables: GIT_DEPTH: 100 CARGO_INCREMENTAL: 0 CARGO_TARGET_DIR: "/ci-cache/${CI_PROJECT_NAME}/targets/${CI_COMMIT_REF_NAME}/${CI_JOB_NAME}" - CI_IMAGE: "paritytech/ci-unified:bullseye-1.69.0-2023-03-21" + CI_IMAGE: "paritytech/ci-unified:latest" PURELY_STD_CRATES: "ink/codegen metadata engine e2e e2e/macro ink/ir" ALSO_WASM_CRATES: "env storage storage/traits allocator prelude primitives ink ink/macro" ALL_CRATES: "${PURELY_STD_CRATES} ${ALSO_WASM_CRATES}" From fce97f4eca6d26f8e98683d595e68877d92fbe5f Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Wed, 26 Jul 2023 13:54:14 +0100 Subject: [PATCH 08/13] Clippy --- crates/e2e/src/xts.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/e2e/src/xts.rs b/crates/e2e/src/xts.rs index afa2bb8fd8..1aeee3907f 100644 --- a/crates/e2e/src/xts.rs +++ b/crates/e2e/src/xts.rs @@ -369,7 +369,7 @@ where storage_deposit_limit: Option, ) -> CodeUploadResult { let call_request = RpcCodeUploadRequest:: { - origin: Signer::::account_id(signer).clone(), + origin: Signer::::account_id(signer), code, storage_deposit_limit, determinism: Determinism::Enforced, From 47ddfe032edbe9339e60aa03057e243b1f268692 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Wed, 26 Jul 2023 13:55:40 +0100 Subject: [PATCH 09/13] Latest subxt --- Cargo.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index da4532e590..66c5a1cd3d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -64,8 +64,8 @@ serde_json = { version = "1.0.81" } sha2 = { version = "0.10" } sha3 = { version = "0.10" } static_assertions = { version = "1.1" } -subxt = { version = "0.30.0" } -subxt-signer = { version = "0.30.0" } +subxt = { version = "0.30.1" } +subxt-signer = { version = "0.30.1" } syn = { version = "2" } synstructure = { version = "0.13.0" } tokio = { version = "1.18.2" } From ee43602b64d2f1454486d626766a92ad47fd1905 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Wed, 26 Jul 2023 15:22:41 +0100 Subject: [PATCH 10/13] Fix UI tests --- .../contract/fail/constructor-input-non-codec.stderr | 6 ++++++ .../constructor-return-result-non-codec-error.stderr | 9 +++++++++ .../fail/impl-block-using-env-no-marker.stderr | 2 +- .../impl-block-using-static-env-no-marker.stderr | 2 +- .../ui/contract/fail/message-input-non-codec.stderr | 8 +++++++- .../contract/fail/message-returns-non-codec.stderr | 6 ++++++ .../ui/trait_def/fail/message_input_non_codec.stderr | 12 ++++++++---- .../trait_def/fail/message_output_non_codec.stderr | 7 ++++--- 8 files changed, 42 insertions(+), 10 deletions(-) diff --git a/crates/ink/tests/ui/contract/fail/constructor-input-non-codec.stderr b/crates/ink/tests/ui/contract/fail/constructor-input-non-codec.stderr index 84471d5f79..2218f22a1c 100644 --- a/crates/ink/tests/ui/contract/fail/constructor-input-non-codec.stderr +++ b/crates/ink/tests/ui/contract/fail/constructor-input-non-codec.stderr @@ -12,6 +12,9 @@ error[E0277]: the trait bound `NonCodecType: WrapperTypeDecode` is not satisfied note: required by a bound in `DispatchInput` --> src/codegen/dispatch/type_check.rs | + | pub struct DispatchInput(T) + | ------------- required by a bound in this struct + | where | T: scale::Decode + 'static; | ^^^^^^^^^^^^^ required by this bound in `DispatchInput` @@ -50,5 +53,8 @@ error[E0277]: the trait bound `NonCodecType: WrapperTypeEncode` is not satisfied note: required by a bound in `ExecutionInput::>::push_arg` --> $WORKSPACE/crates/env/src/call/execution_input.rs | + | pub fn push_arg( + | -------- required by a bound in this associated function +... | T: scale::Encode, | ^^^^^^^^^^^^^ required by this bound in `ExecutionInput::>::push_arg` diff --git a/crates/ink/tests/ui/contract/fail/constructor-return-result-non-codec-error.stderr b/crates/ink/tests/ui/contract/fail/constructor-return-result-non-codec-error.stderr index 0fcf8ce9f4..0907502d5a 100644 --- a/crates/ink/tests/ui/contract/fail/constructor-return-result-non-codec-error.stderr +++ b/crates/ink/tests/ui/contract/fail/constructor-return-result-non-codec-error.stderr @@ -8,6 +8,9 @@ error[E0277]: the trait bound `Result, LangError>: note: required by a bound in `return_value` --> $WORKSPACE/crates/env/src/api.rs | + | pub fn return_value(return_flags: ReturnFlags, return_value: &R) -> ! + | ------------ required by a bound in this function + | where | R: scale::Encode, | ^^^^^^^^^^^^^ required by this bound in `return_value` @@ -26,6 +29,9 @@ error[E0277]: the trait bound `contract::Error: WrapperTypeDecode` is not satisf note: required by a bound in `CreateBuilder::>>::returns` --> $WORKSPACE/crates/env/src/call/create_builder.rs | + | pub fn returns( + | ------- required by a bound in this associated function +... | R: ConstructorReturnType, | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `CreateBuilder::>>::returns` @@ -51,5 +57,8 @@ error[E0277]: the trait bound `contract::Error: TypeInfo` is not satisfied note: required by a bound in `TypeSpec::with_name_str` --> $WORKSPACE/crates/metadata/src/specs.rs | + | pub fn with_name_str(display_name: &'static str) -> Self + | ------------- required by a bound in this associated function + | where | T: TypeInfo + 'static, | ^^^^^^^^ required by this bound in `TypeSpec::with_name_str` diff --git a/crates/ink/tests/ui/contract/fail/impl-block-using-env-no-marker.stderr b/crates/ink/tests/ui/contract/fail/impl-block-using-env-no-marker.stderr index 33dee25041..cc74017436 100644 --- a/crates/ink/tests/ui/contract/fail/impl-block-using-env-no-marker.stderr +++ b/crates/ink/tests/ui/contract/fail/impl-block-using-env-no-marker.stderr @@ -7,5 +7,5 @@ error[E0599]: no method named `env` found for reference `&Contract` in the curre = help: items from traits can only be used if the trait is in scope help: the following trait is implemented but not in scope; perhaps add a `use` for it: | -1 | use ink::codegen::Env; +1 + use ink::codegen::Env; | diff --git a/crates/ink/tests/ui/contract/fail/impl-block-using-static-env-no-marker.stderr b/crates/ink/tests/ui/contract/fail/impl-block-using-static-env-no-marker.stderr index 24dfe00bc5..3ac2382e77 100644 --- a/crates/ink/tests/ui/contract/fail/impl-block-using-static-env-no-marker.stderr +++ b/crates/ink/tests/ui/contract/fail/impl-block-using-static-env-no-marker.stderr @@ -10,5 +10,5 @@ error[E0599]: no function or associated item named `env` found for struct `Contr = help: items from traits can only be used if the trait is in scope help: the following trait is implemented but not in scope; perhaps add a `use` for it: | -1 | use ink::codegen::StaticEnv; +1 + use ink::codegen::StaticEnv; | diff --git a/crates/ink/tests/ui/contract/fail/message-input-non-codec.stderr b/crates/ink/tests/ui/contract/fail/message-input-non-codec.stderr index 29c65d9615..3e407002f5 100644 --- a/crates/ink/tests/ui/contract/fail/message-input-non-codec.stderr +++ b/crates/ink/tests/ui/contract/fail/message-input-non-codec.stderr @@ -12,6 +12,9 @@ error[E0277]: the trait bound `NonCodecType: WrapperTypeDecode` is not satisfied note: required by a bound in `DispatchInput` --> src/codegen/dispatch/type_check.rs | + | pub struct DispatchInput(T) + | ------------- required by a bound in this struct + | where | T: scale::Decode + 'static; | ^^^^^^^^^^^^^ required by this bound in `DispatchInput` @@ -50,6 +53,9 @@ error[E0277]: the trait bound `NonCodecType: WrapperTypeEncode` is not satisfied note: required by a bound in `ExecutionInput::>::push_arg` --> $WORKSPACE/crates/env/src/call/execution_input.rs | + | pub fn push_arg( + | -------- required by a bound in this associated function +... | T: scale::Encode, | ^^^^^^^^^^^^^ required by this bound in `ExecutionInput::>::push_arg` @@ -65,4 +71,4 @@ error[E0599]: the method `try_invoke` exists for struct `CallBuilder, ArgumentList>: Encode` + `ArgumentList, ArgumentList>: Encode` diff --git a/crates/ink/tests/ui/contract/fail/message-returns-non-codec.stderr b/crates/ink/tests/ui/contract/fail/message-returns-non-codec.stderr index 0dd6d58679..877500181f 100644 --- a/crates/ink/tests/ui/contract/fail/message-returns-non-codec.stderr +++ b/crates/ink/tests/ui/contract/fail/message-returns-non-codec.stderr @@ -18,6 +18,9 @@ error[E0277]: the trait bound `NonCodecType: WrapperTypeEncode` is not satisfied note: required by a bound in `DispatchOutput` --> src/codegen/dispatch/type_check.rs | + | pub struct DispatchOutput(T) + | -------------- required by a bound in this struct + | where | T: scale::Encode + 'static; | ^^^^^^^^^^^^^ required by this bound in `DispatchOutput` @@ -31,6 +34,9 @@ error[E0277]: the trait bound `Result: Encode` is not s note: required by a bound in `return_value` --> $WORKSPACE/crates/env/src/api.rs | + | pub fn return_value(return_flags: ReturnFlags, return_value: &R) -> ! + | ------------ required by a bound in this function + | where | R: scale::Encode, | ^^^^^^^^^^^^^ required by this bound in `return_value` diff --git a/crates/ink/tests/ui/trait_def/fail/message_input_non_codec.stderr b/crates/ink/tests/ui/trait_def/fail/message_input_non_codec.stderr index 4d2a1e4027..5ec79abc41 100644 --- a/crates/ink/tests/ui/trait_def/fail/message_input_non_codec.stderr +++ b/crates/ink/tests/ui/trait_def/fail/message_input_non_codec.stderr @@ -12,6 +12,9 @@ error[E0277]: the trait bound `NonCodec: WrapperTypeDecode` is not satisfied note: required by a bound in `DispatchInput` --> src/codegen/dispatch/type_check.rs | + | pub struct DispatchInput(T) + | ------------- required by a bound in this struct + | where | T: scale::Decode + 'static; | ^^^^^^^^^^^^^ required by this bound in `DispatchInput` @@ -38,6 +41,9 @@ error[E0277]: the trait bound `NonCodec: WrapperTypeEncode` is not satisfied note: required by a bound in `ExecutionInput::>::push_arg` --> $WORKSPACE/crates/env/src/call/execution_input.rs | + | pub fn push_arg( + | -------- required by a bound in this associated function +... | T: scale::Encode, | ^^^^^^^^^^^^^ required by this bound in `ExecutionInput::>::push_arg` @@ -45,9 +51,7 @@ error[E0599]: the method `try_invoke` exists for struct `CallBuilder tests/ui/trait_def/fail/message_input_non_codec.rs:5:5 | 5 | #[ink(message)] - | ^ - | | - | method cannot be called due to unsatisfied trait bounds + | ^ method cannot be called due to unsatisfied trait bounds | ::: $WORKSPACE/crates/env/src/call/execution_input.rs | @@ -55,4 +59,4 @@ error[E0599]: the method `try_invoke` exists for struct `CallBuilder, ArgumentList>: Encode` + `ArgumentList, ArgumentList>: Encode` diff --git a/crates/ink/tests/ui/trait_def/fail/message_output_non_codec.stderr b/crates/ink/tests/ui/trait_def/fail/message_output_non_codec.stderr index 1826315d23..f232190395 100644 --- a/crates/ink/tests/ui/trait_def/fail/message_output_non_codec.stderr +++ b/crates/ink/tests/ui/trait_def/fail/message_output_non_codec.stderr @@ -18,6 +18,9 @@ error[E0277]: the trait bound `NonCodec: WrapperTypeEncode` is not satisfied note: required by a bound in `DispatchOutput` --> src/codegen/dispatch/type_check.rs | + | pub struct DispatchOutput(T) + | -------------- required by a bound in this struct + | where | T: scale::Encode + 'static; | ^^^^^^^^^^^^^ required by this bound in `DispatchOutput` @@ -28,9 +31,7 @@ error[E0599]: the method `try_invoke` exists for struct `CallBuilder Date: Wed, 26 Jul 2023 17:01:57 +0100 Subject: [PATCH 11/13] Fix UI tests for 1.70 --- .../ui/contract/fail/constructor-input-non-codec.stderr | 6 ------ .../constructor-return-result-non-codec-error.stderr | 9 --------- .../ui/contract/fail/message-input-non-codec.stderr | 8 +------- .../ui/contract/fail/message-returns-non-codec.stderr | 6 ------ .../storage_item/fail/collections_only_packed_1.stderr | 6 ------ .../storage_item/fail/collections_only_packed_2.stderr | 6 ------ .../ui/trait_def/fail/message_input_non_codec.stderr | 8 +------- .../ui/trait_def/fail/message_output_non_codec.stderr | 3 --- 8 files changed, 2 insertions(+), 50 deletions(-) diff --git a/crates/ink/tests/ui/contract/fail/constructor-input-non-codec.stderr b/crates/ink/tests/ui/contract/fail/constructor-input-non-codec.stderr index 2218f22a1c..84471d5f79 100644 --- a/crates/ink/tests/ui/contract/fail/constructor-input-non-codec.stderr +++ b/crates/ink/tests/ui/contract/fail/constructor-input-non-codec.stderr @@ -12,9 +12,6 @@ error[E0277]: the trait bound `NonCodecType: WrapperTypeDecode` is not satisfied note: required by a bound in `DispatchInput` --> src/codegen/dispatch/type_check.rs | - | pub struct DispatchInput(T) - | ------------- required by a bound in this struct - | where | T: scale::Decode + 'static; | ^^^^^^^^^^^^^ required by this bound in `DispatchInput` @@ -53,8 +50,5 @@ error[E0277]: the trait bound `NonCodecType: WrapperTypeEncode` is not satisfied note: required by a bound in `ExecutionInput::>::push_arg` --> $WORKSPACE/crates/env/src/call/execution_input.rs | - | pub fn push_arg( - | -------- required by a bound in this associated function -... | T: scale::Encode, | ^^^^^^^^^^^^^ required by this bound in `ExecutionInput::>::push_arg` diff --git a/crates/ink/tests/ui/contract/fail/constructor-return-result-non-codec-error.stderr b/crates/ink/tests/ui/contract/fail/constructor-return-result-non-codec-error.stderr index 0907502d5a..0fcf8ce9f4 100644 --- a/crates/ink/tests/ui/contract/fail/constructor-return-result-non-codec-error.stderr +++ b/crates/ink/tests/ui/contract/fail/constructor-return-result-non-codec-error.stderr @@ -8,9 +8,6 @@ error[E0277]: the trait bound `Result, LangError>: note: required by a bound in `return_value` --> $WORKSPACE/crates/env/src/api.rs | - | pub fn return_value(return_flags: ReturnFlags, return_value: &R) -> ! - | ------------ required by a bound in this function - | where | R: scale::Encode, | ^^^^^^^^^^^^^ required by this bound in `return_value` @@ -29,9 +26,6 @@ error[E0277]: the trait bound `contract::Error: WrapperTypeDecode` is not satisf note: required by a bound in `CreateBuilder::>>::returns` --> $WORKSPACE/crates/env/src/call/create_builder.rs | - | pub fn returns( - | ------- required by a bound in this associated function -... | R: ConstructorReturnType, | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `CreateBuilder::>>::returns` @@ -57,8 +51,5 @@ error[E0277]: the trait bound `contract::Error: TypeInfo` is not satisfied note: required by a bound in `TypeSpec::with_name_str` --> $WORKSPACE/crates/metadata/src/specs.rs | - | pub fn with_name_str(display_name: &'static str) -> Self - | ------------- required by a bound in this associated function - | where | T: TypeInfo + 'static, | ^^^^^^^^ required by this bound in `TypeSpec::with_name_str` diff --git a/crates/ink/tests/ui/contract/fail/message-input-non-codec.stderr b/crates/ink/tests/ui/contract/fail/message-input-non-codec.stderr index 3e407002f5..29c65d9615 100644 --- a/crates/ink/tests/ui/contract/fail/message-input-non-codec.stderr +++ b/crates/ink/tests/ui/contract/fail/message-input-non-codec.stderr @@ -12,9 +12,6 @@ error[E0277]: the trait bound `NonCodecType: WrapperTypeDecode` is not satisfied note: required by a bound in `DispatchInput` --> src/codegen/dispatch/type_check.rs | - | pub struct DispatchInput(T) - | ------------- required by a bound in this struct - | where | T: scale::Decode + 'static; | ^^^^^^^^^^^^^ required by this bound in `DispatchInput` @@ -53,9 +50,6 @@ error[E0277]: the trait bound `NonCodecType: WrapperTypeEncode` is not satisfied note: required by a bound in `ExecutionInput::>::push_arg` --> $WORKSPACE/crates/env/src/call/execution_input.rs | - | pub fn push_arg( - | -------- required by a bound in this associated function -... | T: scale::Encode, | ^^^^^^^^^^^^^ required by this bound in `ExecutionInput::>::push_arg` @@ -71,4 +65,4 @@ error[E0599]: the method `try_invoke` exists for struct `CallBuilder, ArgumentList>: Encode` + `ArgumentList, ArgumentList>: Encode` diff --git a/crates/ink/tests/ui/contract/fail/message-returns-non-codec.stderr b/crates/ink/tests/ui/contract/fail/message-returns-non-codec.stderr index 877500181f..0dd6d58679 100644 --- a/crates/ink/tests/ui/contract/fail/message-returns-non-codec.stderr +++ b/crates/ink/tests/ui/contract/fail/message-returns-non-codec.stderr @@ -18,9 +18,6 @@ error[E0277]: the trait bound `NonCodecType: WrapperTypeEncode` is not satisfied note: required by a bound in `DispatchOutput` --> src/codegen/dispatch/type_check.rs | - | pub struct DispatchOutput(T) - | -------------- required by a bound in this struct - | where | T: scale::Encode + 'static; | ^^^^^^^^^^^^^ required by this bound in `DispatchOutput` @@ -34,9 +31,6 @@ error[E0277]: the trait bound `Result: Encode` is not s note: required by a bound in `return_value` --> $WORKSPACE/crates/env/src/api.rs | - | pub fn return_value(return_flags: ReturnFlags, return_value: &R) -> ! - | ------------ required by a bound in this function - | where | R: scale::Encode, | ^^^^^^^^^^^^^ required by this bound in `return_value` diff --git a/crates/ink/tests/ui/storage_item/fail/collections_only_packed_1.stderr b/crates/ink/tests/ui/storage_item/fail/collections_only_packed_1.stderr index 024f999a20..2d90225c6f 100644 --- a/crates/ink/tests/ui/storage_item/fail/collections_only_packed_1.stderr +++ b/crates/ink/tests/ui/storage_item/fail/collections_only_packed_1.stderr @@ -85,9 +85,6 @@ note: required because it appears within the type `Contract` | ^^^^^^^^ note: required by a bound in `Result` --> $RUST/core/src/result.rs - | - | pub enum Result { - | ^ required by this bound in `Result` = note: this error originates in the derive macro `::ink::storage::traits::Storable` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `[NonPacked]: Encode` is not satisfied @@ -110,7 +107,4 @@ note: required because it appears within the type `Contract` | ^^^^^^^^ note: required by a bound in `Result` --> $RUST/core/src/result.rs - | - | pub enum Result { - | ^ required by this bound in `Result` = note: this error originates in the derive macro `::ink::storage::traits::Storable` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/crates/ink/tests/ui/storage_item/fail/collections_only_packed_2.stderr b/crates/ink/tests/ui/storage_item/fail/collections_only_packed_2.stderr index b0a9b7a4b7..e4f83e2404 100644 --- a/crates/ink/tests/ui/storage_item/fail/collections_only_packed_2.stderr +++ b/crates/ink/tests/ui/storage_item/fail/collections_only_packed_2.stderr @@ -79,9 +79,6 @@ note: required because it appears within the type `Contract` | ^^^^^^^^ note: required by a bound in `Result` --> $RUST/core/src/result.rs - | - | pub enum Result { - | ^ required by this bound in `Result` = note: this error originates in the derive macro `::ink::storage::traits::Storable` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `BTreeMap: Encode` is not satisfied @@ -101,7 +98,4 @@ note: required because it appears within the type `Contract` | ^^^^^^^^ note: required by a bound in `Result` --> $RUST/core/src/result.rs - | - | pub enum Result { - | ^ required by this bound in `Result` = note: this error originates in the derive macro `::ink::storage::traits::Storable` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/crates/ink/tests/ui/trait_def/fail/message_input_non_codec.stderr b/crates/ink/tests/ui/trait_def/fail/message_input_non_codec.stderr index 5ec79abc41..46b68e5c77 100644 --- a/crates/ink/tests/ui/trait_def/fail/message_input_non_codec.stderr +++ b/crates/ink/tests/ui/trait_def/fail/message_input_non_codec.stderr @@ -12,9 +12,6 @@ error[E0277]: the trait bound `NonCodec: WrapperTypeDecode` is not satisfied note: required by a bound in `DispatchInput` --> src/codegen/dispatch/type_check.rs | - | pub struct DispatchInput(T) - | ------------- required by a bound in this struct - | where | T: scale::Decode + 'static; | ^^^^^^^^^^^^^ required by this bound in `DispatchInput` @@ -41,9 +38,6 @@ error[E0277]: the trait bound `NonCodec: WrapperTypeEncode` is not satisfied note: required by a bound in `ExecutionInput::>::push_arg` --> $WORKSPACE/crates/env/src/call/execution_input.rs | - | pub fn push_arg( - | -------- required by a bound in this associated function -... | T: scale::Encode, | ^^^^^^^^^^^^^ required by this bound in `ExecutionInput::>::push_arg` @@ -59,4 +53,4 @@ error[E0599]: the method `try_invoke` exists for struct `CallBuilder, ArgumentList>: Encode` + `ArgumentList, ArgumentList>: Encode` diff --git a/crates/ink/tests/ui/trait_def/fail/message_output_non_codec.stderr b/crates/ink/tests/ui/trait_def/fail/message_output_non_codec.stderr index f232190395..cdf966374b 100644 --- a/crates/ink/tests/ui/trait_def/fail/message_output_non_codec.stderr +++ b/crates/ink/tests/ui/trait_def/fail/message_output_non_codec.stderr @@ -18,9 +18,6 @@ error[E0277]: the trait bound `NonCodec: WrapperTypeEncode` is not satisfied note: required by a bound in `DispatchOutput` --> src/codegen/dispatch/type_check.rs | - | pub struct DispatchOutput(T) - | -------------- required by a bound in this struct - | where | T: scale::Encode + 'static; | ^^^^^^^^^^^^^ required by this bound in `DispatchOutput` From 98bc3d5b19c9d97aa43988ec8ae2c33bc7576576 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Wed, 26 Jul 2023 17:52:02 +0100 Subject: [PATCH 12/13] Use bullseye 1.71 --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9f72b9743c..57cdca8999 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -26,7 +26,7 @@ variables: GIT_DEPTH: 100 CARGO_INCREMENTAL: 0 CARGO_TARGET_DIR: "/ci-cache/${CI_PROJECT_NAME}/targets/${CI_COMMIT_REF_NAME}/${CI_JOB_NAME}" - CI_IMAGE: "paritytech/ci-unified:latest" + CI_IMAGE: "paritytech/ci-unified:bullseye-1.71.0-2023-05-23" PURELY_STD_CRATES: "ink/codegen metadata engine e2e e2e/macro ink/ir" ALSO_WASM_CRATES: "env storage storage/traits allocator prelude primitives ink ink/macro" ALL_CRATES: "${PURELY_STD_CRATES} ${ALSO_WASM_CRATES}" From 5982f23e49a431596433eddb0a61c12c4da38ae9 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Wed, 26 Jul 2023 18:01:24 +0100 Subject: [PATCH 13/13] UI tests for 1.71 --- .../ui/contract/fail/constructor-input-non-codec.stderr | 6 ++++++ .../constructor-return-result-non-codec-error.stderr | 9 +++++++++ .../ui/contract/fail/message-input-non-codec.stderr | 8 +++++++- .../ui/contract/fail/message-returns-non-codec.stderr | 6 ++++++ .../storage_item/fail/collections_only_packed_1.stderr | 6 ++++++ .../storage_item/fail/collections_only_packed_2.stderr | 6 ++++++ .../ui/trait_def/fail/message_input_non_codec.stderr | 8 +++++++- .../ui/trait_def/fail/message_output_non_codec.stderr | 3 +++ 8 files changed, 50 insertions(+), 2 deletions(-) diff --git a/crates/ink/tests/ui/contract/fail/constructor-input-non-codec.stderr b/crates/ink/tests/ui/contract/fail/constructor-input-non-codec.stderr index 84471d5f79..2218f22a1c 100644 --- a/crates/ink/tests/ui/contract/fail/constructor-input-non-codec.stderr +++ b/crates/ink/tests/ui/contract/fail/constructor-input-non-codec.stderr @@ -12,6 +12,9 @@ error[E0277]: the trait bound `NonCodecType: WrapperTypeDecode` is not satisfied note: required by a bound in `DispatchInput` --> src/codegen/dispatch/type_check.rs | + | pub struct DispatchInput(T) + | ------------- required by a bound in this struct + | where | T: scale::Decode + 'static; | ^^^^^^^^^^^^^ required by this bound in `DispatchInput` @@ -50,5 +53,8 @@ error[E0277]: the trait bound `NonCodecType: WrapperTypeEncode` is not satisfied note: required by a bound in `ExecutionInput::>::push_arg` --> $WORKSPACE/crates/env/src/call/execution_input.rs | + | pub fn push_arg( + | -------- required by a bound in this associated function +... | T: scale::Encode, | ^^^^^^^^^^^^^ required by this bound in `ExecutionInput::>::push_arg` diff --git a/crates/ink/tests/ui/contract/fail/constructor-return-result-non-codec-error.stderr b/crates/ink/tests/ui/contract/fail/constructor-return-result-non-codec-error.stderr index 0fcf8ce9f4..0907502d5a 100644 --- a/crates/ink/tests/ui/contract/fail/constructor-return-result-non-codec-error.stderr +++ b/crates/ink/tests/ui/contract/fail/constructor-return-result-non-codec-error.stderr @@ -8,6 +8,9 @@ error[E0277]: the trait bound `Result, LangError>: note: required by a bound in `return_value` --> $WORKSPACE/crates/env/src/api.rs | + | pub fn return_value(return_flags: ReturnFlags, return_value: &R) -> ! + | ------------ required by a bound in this function + | where | R: scale::Encode, | ^^^^^^^^^^^^^ required by this bound in `return_value` @@ -26,6 +29,9 @@ error[E0277]: the trait bound `contract::Error: WrapperTypeDecode` is not satisf note: required by a bound in `CreateBuilder::>>::returns` --> $WORKSPACE/crates/env/src/call/create_builder.rs | + | pub fn returns( + | ------- required by a bound in this associated function +... | R: ConstructorReturnType, | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `CreateBuilder::>>::returns` @@ -51,5 +57,8 @@ error[E0277]: the trait bound `contract::Error: TypeInfo` is not satisfied note: required by a bound in `TypeSpec::with_name_str` --> $WORKSPACE/crates/metadata/src/specs.rs | + | pub fn with_name_str(display_name: &'static str) -> Self + | ------------- required by a bound in this associated function + | where | T: TypeInfo + 'static, | ^^^^^^^^ required by this bound in `TypeSpec::with_name_str` diff --git a/crates/ink/tests/ui/contract/fail/message-input-non-codec.stderr b/crates/ink/tests/ui/contract/fail/message-input-non-codec.stderr index 29c65d9615..3e407002f5 100644 --- a/crates/ink/tests/ui/contract/fail/message-input-non-codec.stderr +++ b/crates/ink/tests/ui/contract/fail/message-input-non-codec.stderr @@ -12,6 +12,9 @@ error[E0277]: the trait bound `NonCodecType: WrapperTypeDecode` is not satisfied note: required by a bound in `DispatchInput` --> src/codegen/dispatch/type_check.rs | + | pub struct DispatchInput(T) + | ------------- required by a bound in this struct + | where | T: scale::Decode + 'static; | ^^^^^^^^^^^^^ required by this bound in `DispatchInput` @@ -50,6 +53,9 @@ error[E0277]: the trait bound `NonCodecType: WrapperTypeEncode` is not satisfied note: required by a bound in `ExecutionInput::>::push_arg` --> $WORKSPACE/crates/env/src/call/execution_input.rs | + | pub fn push_arg( + | -------- required by a bound in this associated function +... | T: scale::Encode, | ^^^^^^^^^^^^^ required by this bound in `ExecutionInput::>::push_arg` @@ -65,4 +71,4 @@ error[E0599]: the method `try_invoke` exists for struct `CallBuilder, ArgumentList>: Encode` + `ArgumentList, ArgumentList>: Encode` diff --git a/crates/ink/tests/ui/contract/fail/message-returns-non-codec.stderr b/crates/ink/tests/ui/contract/fail/message-returns-non-codec.stderr index 0dd6d58679..877500181f 100644 --- a/crates/ink/tests/ui/contract/fail/message-returns-non-codec.stderr +++ b/crates/ink/tests/ui/contract/fail/message-returns-non-codec.stderr @@ -18,6 +18,9 @@ error[E0277]: the trait bound `NonCodecType: WrapperTypeEncode` is not satisfied note: required by a bound in `DispatchOutput` --> src/codegen/dispatch/type_check.rs | + | pub struct DispatchOutput(T) + | -------------- required by a bound in this struct + | where | T: scale::Encode + 'static; | ^^^^^^^^^^^^^ required by this bound in `DispatchOutput` @@ -31,6 +34,9 @@ error[E0277]: the trait bound `Result: Encode` is not s note: required by a bound in `return_value` --> $WORKSPACE/crates/env/src/api.rs | + | pub fn return_value(return_flags: ReturnFlags, return_value: &R) -> ! + | ------------ required by a bound in this function + | where | R: scale::Encode, | ^^^^^^^^^^^^^ required by this bound in `return_value` diff --git a/crates/ink/tests/ui/storage_item/fail/collections_only_packed_1.stderr b/crates/ink/tests/ui/storage_item/fail/collections_only_packed_1.stderr index 2d90225c6f..024f999a20 100644 --- a/crates/ink/tests/ui/storage_item/fail/collections_only_packed_1.stderr +++ b/crates/ink/tests/ui/storage_item/fail/collections_only_packed_1.stderr @@ -85,6 +85,9 @@ note: required because it appears within the type `Contract` | ^^^^^^^^ note: required by a bound in `Result` --> $RUST/core/src/result.rs + | + | pub enum Result { + | ^ required by this bound in `Result` = note: this error originates in the derive macro `::ink::storage::traits::Storable` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `[NonPacked]: Encode` is not satisfied @@ -107,4 +110,7 @@ note: required because it appears within the type `Contract` | ^^^^^^^^ note: required by a bound in `Result` --> $RUST/core/src/result.rs + | + | pub enum Result { + | ^ required by this bound in `Result` = note: this error originates in the derive macro `::ink::storage::traits::Storable` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/crates/ink/tests/ui/storage_item/fail/collections_only_packed_2.stderr b/crates/ink/tests/ui/storage_item/fail/collections_only_packed_2.stderr index e4f83e2404..b0a9b7a4b7 100644 --- a/crates/ink/tests/ui/storage_item/fail/collections_only_packed_2.stderr +++ b/crates/ink/tests/ui/storage_item/fail/collections_only_packed_2.stderr @@ -79,6 +79,9 @@ note: required because it appears within the type `Contract` | ^^^^^^^^ note: required by a bound in `Result` --> $RUST/core/src/result.rs + | + | pub enum Result { + | ^ required by this bound in `Result` = note: this error originates in the derive macro `::ink::storage::traits::Storable` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `BTreeMap: Encode` is not satisfied @@ -98,4 +101,7 @@ note: required because it appears within the type `Contract` | ^^^^^^^^ note: required by a bound in `Result` --> $RUST/core/src/result.rs + | + | pub enum Result { + | ^ required by this bound in `Result` = note: this error originates in the derive macro `::ink::storage::traits::Storable` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/crates/ink/tests/ui/trait_def/fail/message_input_non_codec.stderr b/crates/ink/tests/ui/trait_def/fail/message_input_non_codec.stderr index 46b68e5c77..5ec79abc41 100644 --- a/crates/ink/tests/ui/trait_def/fail/message_input_non_codec.stderr +++ b/crates/ink/tests/ui/trait_def/fail/message_input_non_codec.stderr @@ -12,6 +12,9 @@ error[E0277]: the trait bound `NonCodec: WrapperTypeDecode` is not satisfied note: required by a bound in `DispatchInput` --> src/codegen/dispatch/type_check.rs | + | pub struct DispatchInput(T) + | ------------- required by a bound in this struct + | where | T: scale::Decode + 'static; | ^^^^^^^^^^^^^ required by this bound in `DispatchInput` @@ -38,6 +41,9 @@ error[E0277]: the trait bound `NonCodec: WrapperTypeEncode` is not satisfied note: required by a bound in `ExecutionInput::>::push_arg` --> $WORKSPACE/crates/env/src/call/execution_input.rs | + | pub fn push_arg( + | -------- required by a bound in this associated function +... | T: scale::Encode, | ^^^^^^^^^^^^^ required by this bound in `ExecutionInput::>::push_arg` @@ -53,4 +59,4 @@ error[E0599]: the method `try_invoke` exists for struct `CallBuilder, ArgumentList>: Encode` + `ArgumentList, ArgumentList>: Encode` diff --git a/crates/ink/tests/ui/trait_def/fail/message_output_non_codec.stderr b/crates/ink/tests/ui/trait_def/fail/message_output_non_codec.stderr index cdf966374b..f232190395 100644 --- a/crates/ink/tests/ui/trait_def/fail/message_output_non_codec.stderr +++ b/crates/ink/tests/ui/trait_def/fail/message_output_non_codec.stderr @@ -18,6 +18,9 @@ error[E0277]: the trait bound `NonCodec: WrapperTypeEncode` is not satisfied note: required by a bound in `DispatchOutput` --> src/codegen/dispatch/type_check.rs | + | pub struct DispatchOutput(T) + | -------------- required by a bound in this struct + | where | T: scale::Encode + 'static; | ^^^^^^^^^^^^^ required by this bound in `DispatchOutput`