diff --git a/.config/cargo_spellcheck.dic b/.config/cargo_spellcheck.dic index 284c18234ac..43ee77d2d4d 100644 --- a/.config/cargo_spellcheck.dic +++ b/.config/cargo_spellcheck.dic @@ -12,7 +12,10 @@ FFI Gnosis GPL KECCAK +L1 +L2 Polkadot +PSP22 RPC SHA UI/S @@ -62,6 +65,7 @@ scalability scalable stdin stdout +subber tuple unordered untyped diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e3417f6b790..70d7beaef14 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -26,9 +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 is changed to "-:staging" when the CI image gets rebuilt - # read more https://github.com/paritytech/scripts/pull/244 - CI_IMAGE: "paritytech/ink-ci-linux:a1f03f4b-20230420" + 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}" @@ -451,7 +449,7 @@ examples-contract-build-riscv: if [ "$example" = "integration-tests/custom_allocator/" ]; then continue; fi; if [ "$example" = "integration-tests/call-runtime/" ]; then continue; fi; pushd $example && - cargo +stable build --no-default-features --target $RISCV_TARGET -Zbuild-std="core,alloc" && + cargo build --no-default-features --target $RISCV_TARGET -Zbuild-std="core,alloc" && popd; done diff --git a/crates/e2e/Cargo.toml b/crates/e2e/Cargo.toml index 4c469177467..2c8ce9c6145 100644 --- a/crates/e2e/Cargo.toml +++ b/crates/e2e/Cargo.toml @@ -29,14 +29,15 @@ tokio = { version = "1.18.2", features = ["rt-multi-thread"] } log = { version = "0.4" } env_logger = { version = "0.10" } scale = { package = "parity-scale-codec", version = "3.4", default-features = false, features = ["derive"] } -subxt = "0.28.0" +subxt = "0.31.0" +subxt-signer = { version = "0.31.0", features = ["subxt", "sr25519"] } # Substrate -pallet-contracts-primitives = "23.0.0" -sp-core = "20.0.0" -sp-keyring = "23.0.0" -sp-runtime = "23.0.0" -sp-weights = "19.0.0" +pallet-contracts-primitives = "24.0.0" +sp-core = "21.0.0" +sp-keyring = "24.0.0" +sp-runtime = "24.0.0" +sp-weights = "20.0.0" [dev-dependencies] # Required for the doctest of `MessageBuilder::call` diff --git a/crates/e2e/macro/Cargo.toml b/crates/e2e/macro/Cargo.toml index 75c6f832f03..432372fa7b0 100644 --- a/crates/e2e/macro/Cargo.toml +++ b/crates/e2e/macro/Cargo.toml @@ -21,7 +21,7 @@ proc-macro = true [dependencies] ink_ir = { version = "4.2.1", path = "../../ink/ir" } cargo_metadata = "0.15.3" -contract-build = "2.0.2" +contract-build = "3.2.0" derive_more = "0.99.17" env_logger = "0.10.0" log = "0.4.17" diff --git a/crates/e2e/macro/src/codegen.rs b/crates/e2e/macro/src/codegen.rs index 7711f07bc53..54b8b3778f7 100644 --- a/crates/e2e/macro/src/codegen.rs +++ b/crates/e2e/macro/src/codegen.rs @@ -13,7 +13,10 @@ // limitations under the License. use crate::ir; -use contract_build::ManifestPath; +use contract_build::{ + ManifestPath, + Target, +}; use core::cell::RefCell; use derive_more::From; use proc_macro2::TokenStream as TokenStream2; @@ -289,6 +292,7 @@ fn build_contract(path_to_cargo_toml: &str) -> String { lint: false, output_type: OutputType::HumanReadable, skip_wasm_validation: false, + target: Target::Wasm, }; match contract_build::execute(args) { diff --git a/crates/e2e/src/client.rs b/crates/e2e/src/client.rs index 8165f7f6a7a..afde1a1182e 100644 --- a/crates/e2e/src/client.rs +++ b/crates/e2e/src/client.rs @@ -25,12 +25,11 @@ use super::{ ContractExecResult, ContractInstantiateResult, ContractsApi, - Signer, + Keypair, }; use ink_env::Environment; use ink_primitives::MessageResult; use pallet_contracts_primitives::ExecReturnValue; -use sp_core::Pair; #[cfg(feature = "std")] use std::{ collections::BTreeMap, @@ -52,7 +51,8 @@ use subxt::{ ValueDef, }, }, - tx::PairSigner, + tx::Signer, + Config, }; /// Result of a contract instantiation. @@ -61,7 +61,7 @@ pub struct InstantiationResult { pub account_id: E::AccountId, /// The result of the dry run, contains debug messages /// if there were any. - pub dry_run: ContractInstantiateResult, + pub dry_run: ContractInstantiateResult, /// Events that happened with the contract instantiation. pub events: ExtrinsicEvents, } @@ -191,7 +191,7 @@ where pub struct CallDryRunResult { /// The result of the dry run, contains debug messages /// if there were any. - pub exec_result: ContractExecResult, + pub exec_result: ContractExecResult, _marker: PhantomData, } @@ -271,7 +271,7 @@ where /// No contract with the given name found in scope. ContractNotFound(String), /// The `instantiate_with_code` dry run failed. - InstantiateDryRun(ContractInstantiateResult), + InstantiateDryRun(ContractInstantiateResult), /// The `instantiate_with_code` extrinsic failed. InstantiateExtrinsic(subxt::error::DispatchError), /// The `upload` dry run failed. @@ -279,7 +279,7 @@ where /// The `upload` extrinsic failed. UploadExtrinsic(subxt::error::DispatchError), /// The `call` dry run failed. - CallDryRun(ContractExecResult), + CallDryRun(ContractExecResult), /// The `call` extrinsic failed. CallExtrinsic(subxt::error::DispatchError), /// Error fetching account balance. @@ -383,12 +383,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, @@ -424,17 +423,20 @@ 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, { - 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 = 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) @@ -442,19 +444,16 @@ 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, )); - pair_signer + keypair } /// This function extracts the metadata of the contract at the file path @@ -468,7 +467,7 @@ where pub async fn instantiate( &mut self, contract_name: &str, - signer: &Signer, + signer: &Keypair, constructor: CreateBuilderPartial, value: E::Balance, storage_deposit_limit: Option, @@ -488,11 +487,11 @@ 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, - ) -> ContractInstantiateResult + ) -> ContractInstantiateResult where Args: scale::Encode, { @@ -535,7 +534,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, @@ -646,7 +645,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); @@ -660,7 +659,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> { @@ -731,7 +730,7 @@ where /// contains all events that are associated with this transaction. pub async fn call( &mut self, - signer: &Signer, + signer: &Keypair, message: Message, value: E::Balance, storage_deposit_limit: Option, @@ -793,7 +792,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, @@ -828,7 +827,7 @@ where /// invoked message. pub async fn call_dry_run( &mut self, - signer: &Signer, + signer: &Keypair, message: &Message, value: E::Balance, storage_deposit_limit: Option, @@ -839,7 +838,7 @@ where let exec_result = self .api .call_dry_run( - Signer::account_id(signer).clone(), + Signer::::account_id(signer), message, value, storage_deposit_limit, @@ -940,6 +939,6 @@ where } /// Returns true if the give event is System::Extrinsic failed. -fn is_extrinsic_failed_event(event: &EventDetails) -> bool { +fn is_extrinsic_failed_event(event: &EventDetails) -> bool { event.pallet_name() == "System" && event.variant_name() == "ExtrinsicFailed" } diff --git a/crates/e2e/src/lib.rs b/crates/e2e/src/lib.rs index 445286cbf9c..0310cd0305f 100644 --- a/crates/e2e/src/lib.rs +++ b/crates/e2e/src/lib.rs @@ -21,7 +21,6 @@ mod builders; mod client; -mod default_accounts; mod node_proc; mod xts; @@ -37,7 +36,6 @@ pub use client::{ InstantiationResult, UploadResult, }; -pub use default_accounts::*; pub use env_logger; pub use ink_e2e_macro::test; pub use node_proc::{ @@ -46,9 +44,11 @@ pub use node_proc::{ }; pub use sp_core::H256; pub use sp_keyring::AccountKeyring; -pub use subxt::{ +pub use subxt; +pub use subxt_signer::sr25519::{ self, - tx::PairSigner, + dev::*, + Keypair, }; pub use tokio; @@ -57,44 +57,13 @@ use pallet_contracts_primitives::{ ContractExecResult, ContractInstantiateResult, }; -use sp_core::sr25519; use std::{ cell::RefCell, sync::Once, }; use xts::ContractsApi; -/// Default set of commonly used types by Substrate runtimes. -#[cfg(feature = "std")] -pub enum SubstrateConfig {} - -#[cfg(feature = "std")] -impl subxt::Config for SubstrateConfig { - type Index = u32; - type Hash = sp_core::H256; - type Hasher = subxt::config::substrate::BlakeTwo256; - type AccountId = subxt::config::substrate::AccountId32; - type Address = sp_runtime::MultiAddress; - type Header = subxt::config::substrate::SubstrateHeader< - u32, - subxt::config::substrate::BlakeTwo256, - >; - type Signature = sp_runtime::MultiSignature; - type ExtrinsicParams = subxt::config::substrate::SubstrateExtrinsicParams; -} - -/// Default set of commonly used types by Polkadot nodes. -#[cfg(feature = "std")] -pub type PolkadotConfig = subxt::config::WithExtrinsicParams< - SubstrateConfig, - subxt::config::polkadot::PolkadotExtrinsicParams, ->; - -/// 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; +pub use subxt::PolkadotConfig; /// We use this to only initialize `env_logger` once. pub static INIT: Once = Once::new(); diff --git a/crates/e2e/src/node_proc.rs b/crates/e2e/src/node_proc.rs index 94c160cefa2..6bed4090b3d 100644 --- a/crates/e2e/src/node_proc.rs +++ b/crates/e2e/src/node_proc.rs @@ -116,8 +116,7 @@ where .stdout(process::Stdio::piped()) .stderr(process::Stdio::piped()) .arg("--port=0") - .arg("--rpc-port=0") - .arg("--ws-port=0"); + .arg("--rpc-port=0"); if let Some(authority) = self.authority { let authority = format!("{authority:?}"); @@ -135,21 +134,21 @@ where // Wait for RPC port to be logged (it's logged to stderr): let stderr = proc.stderr.take().unwrap(); - let ws_port = find_substrate_port_from_output(stderr); - let ws_url = format!("ws://127.0.0.1:{ws_port}"); + let port = find_substrate_port_from_output(stderr); + let url = format!("ws://127.0.0.1:{port}"); // Connect to the node with a `subxt` client: - let client = OnlineClient::from_url(ws_url.clone()).await; + let client = OnlineClient::from_url(url.clone()).await; match client { Ok(client) => { Ok(TestNodeProcess { proc, client, - url: ws_url.clone(), + url: url.clone(), }) } Err(err) => { - let err = format!("Failed to connect to node rpc at {ws_url}: {err}"); + let err = format!("Failed to connect to node rpc at {url}: {err}"); log::error!("{}", err); proc.kill().map_err(|e| { format!("Error killing substrate process '{}': {}", proc.id(), e) @@ -176,6 +175,7 @@ fn find_substrate_port_from_output(r: impl Read + Send + 'static) -> u16 { .or_else(|| { line.rsplit_once("Running JSON-RPC WS server: addr=127.0.0.1:") }) + .or_else(|| line.rsplit_once("Running JSON-RPC server: addr=127.0.0.1:")) .map(|(_, port_str)| port_str)?; // trim non-numeric chars from the end of the port part of the line. diff --git a/crates/e2e/src/xts.rs b/crates/e2e/src/xts.rs index ffccdb344c1..b765dc897fa 100644 --- a/crates/e2e/src/xts.rs +++ b/crates/e2e/src/xts.rs @@ -18,7 +18,7 @@ use super::{ sr25519, ContractExecResult, ContractInstantiateResult, - Signer, + Keypair, }; use ink_env::Environment; @@ -33,6 +33,7 @@ use subxt::{ config::ExtrinsicParams, ext::scale_encode, rpc_params, + tx::Signer, utils::MultiAddress, OnlineClient, }; @@ -129,7 +130,7 @@ pub enum Determinism { /// /// Dispatchables always use this mode in order to make on-chain execution /// deterministic. - Deterministic, + Enforced, /// Allow calling or uploading an indeterministic code. /// /// This is only possible when calling into `pallet-contracts` directly via @@ -138,7 +139,7 @@ pub enum Determinism { /// # Note /// /// **Never** use this mode for on-chain execution. - AllowIndeterminism, + Relaxed, } /// A raw call to `pallet-contracts`'s `upload`. @@ -210,10 +211,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, @@ -232,7 +233,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> { @@ -267,11 +268,11 @@ where code: Vec, data: Vec, salt: Vec, - signer: &Signer, - ) -> ContractInstantiateResult { + signer: &Keypair, + ) -> 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, @@ -298,7 +299,7 @@ where pub async fn submit_extrinsic( &self, call: &Call, - signer: &Signer, + signer: &Keypair, ) -> ExtrinsicEvents where Call: subxt::tx::TxPayload, @@ -342,7 +343,7 @@ where code: Vec, data: Vec, salt: Vec, - signer: &Signer, + signer: &Keypair, ) -> ExtrinsicEvents { let call = subxt::tx::Payload::new( "Contracts", @@ -364,15 +365,15 @@ 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 { let call_request = RpcCodeUploadRequest:: { - origin: subxt::tx::Signer::account_id(signer).clone(), + origin: Signer::::account_id(signer), code, storage_deposit_limit, - determinism: Determinism::Deterministic, + determinism: Determinism::Enforced, }; let func = "ContractsApi_upload_code"; let params = rpc_params![func, Bytes(scale::Encode::encode(&call_request))]; @@ -394,7 +395,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 { @@ -404,7 +405,7 @@ where UploadCode:: { code, storage_deposit_limit, - determinism: Determinism::Deterministic, + determinism: Determinism::Enforced, }, ) .unvalidated(); @@ -419,7 +420,7 @@ where message: &Message, value: E::Balance, storage_deposit_limit: Option, - ) -> ContractExecResult { + ) -> ContractExecResult { let call_request = RpcCallRequest:: { origin, dest: message.account_id().clone(), @@ -453,7 +454,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 +480,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/crates/env/Cargo.toml b/crates/env/Cargo.toml index c1676ede5ec..8757e749152 100644 --- a/crates/env/Cargo.toml +++ b/crates/env/Cargo.toml @@ -47,8 +47,8 @@ secp256k1 = { version = "0.27.0", features = ["recovery", "global-context"], opt # # Sadly couldn't be marked as dev-dependency. # Never use this crate outside the off-chain environment! -scale-decode = { version = "0.5.0", default-features = false, optional = true } -scale-encode = { version = "0.1.0", default-features = false, optional = true } +scale-decode = { version = "0.9.0", default-features = false, optional = true } +scale-encode = { version = "0.5.0", default-features = false, optional = true } scale-info = { version = "2.5", default-features = false, features = ["derive"], optional = true } [dev-dependencies] 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 84471d5f79d..2218f22a1c8 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 0fcf8ce9f45..0907502d5ae 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/constructor-self-receiver-03.stderr b/crates/ink/tests/ui/contract/fail/constructor-self-receiver-03.stderr index 0ec98d66bff..99087f2b51c 100644 --- a/crates/ink/tests/ui/contract/fail/constructor-self-receiver-03.stderr +++ b/crates/ink/tests/ui/contract/fail/constructor-self-receiver-03.stderr @@ -22,14 +22,14 @@ error[E0411]: cannot find type `Self` in this scope 8 | pub fn constructor(this: &Self) -> Self { | ^^^^ `Self` is only available in impls, traits, and type definitions -error[E0277]: the trait bound `&'static Contract: WrapperTypeDecode` is not satisfied +error[E0277]: the trait bound `&Contract: WrapperTypeDecode` is not satisfied --> tests/ui/contract/fail/constructor-self-receiver-03.rs:8:9 | 8 | pub fn constructor(this: &Self) -> Self { - | ^^^ the trait `WrapperTypeDecode` is not implemented for `&'static Contract` + | ^^^ the trait `WrapperTypeDecode` is not implemented for `&Contract` | = help: the following other types implement trait `WrapperTypeDecode`: Arc Box Rc - = note: required for `&'static Contract` to implement `parity_scale_codec::Decode` + = note: required for `&Contract` to implement `parity_scale_codec::Decode` diff --git a/crates/ink/tests/ui/contract/fail/event-too-many-topics-anonymous.stderr b/crates/ink/tests/ui/contract/fail/event-too-many-topics-anonymous.stderr index b3781159671..e9eddb81021 100644 --- a/crates/ink/tests/ui/contract/fail/event-too-many-topics-anonymous.stderr +++ b/crates/ink/tests/ui/contract/fail/event-too-many-topics-anonymous.stderr @@ -17,5 +17,8 @@ error[E0277]: the trait bound `EventTopics<4>: RespectTopicLimit<2>` is not sati note: required by a bound in `EventRespectsTopicLimit` --> src/codegen/event/topics.rs | + | pub struct EventRespectsTopicLimit + | ----------------------- required by a bound in this struct +... | ::LenTopics: RespectTopicLimit, | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `EventRespectsTopicLimit` diff --git a/crates/ink/tests/ui/contract/fail/event-too-many-topics.stderr b/crates/ink/tests/ui/contract/fail/event-too-many-topics.stderr index e542e880c0c..a82bb82a292 100644 --- a/crates/ink/tests/ui/contract/fail/event-too-many-topics.stderr +++ b/crates/ink/tests/ui/contract/fail/event-too-many-topics.stderr @@ -17,5 +17,8 @@ error[E0277]: the trait bound `EventTopics<3>: RespectTopicLimit<2>` is not sati note: required by a bound in `EventRespectsTopicLimit` --> src/codegen/event/topics.rs | + | pub struct EventRespectsTopicLimit + | ----------------------- required by a bound in this struct +... | ::LenTopics: RespectTopicLimit, | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `EventRespectsTopicLimit` diff --git a/crates/ink/tests/ui/contract/fail/impl-block-for-non-storage-01.stderr b/crates/ink/tests/ui/contract/fail/impl-block-for-non-storage-01.stderr index 53823fe552c..c6418df8cf0 100644 --- a/crates/ink/tests/ui/contract/fail/impl-block-for-non-storage-01.stderr +++ b/crates/ink/tests/ui/contract/fail/impl-block-for-non-storage-01.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> tests/ui/contract/fail/impl-block-for-non-storage-01.rs:18:10 | 18 | impl NonContract { - | ^^^^^^^^^^^ expected struct `Contract`, found struct `NonContract` + | ^^^^^^^^^^^ expected `IsSameType`, found `IsSameType` | = note: expected struct `IsSameType` found struct `IsSameType` @@ -10,23 +10,37 @@ error[E0308]: mismatched types error[E0599]: no function or associated item named `constructor_2` found for struct `Contract` in the current scope --> tests/ui/contract/fail/impl-block-for-non-storage-01.rs:20:16 | -4 | pub struct Contract {} - | --- function or associated item `constructor_2` not found for this struct -... -20 | pub fn constructor_2() -> Self { - | ^^^^^^^^^^^^^ - | | - | function or associated item not found in `Contract` - | help: there is an associated function with a similar name: `constructor_1` +4 | pub struct Contract {} + | _____---________- + | | | + | | function or associated item `constructor_2` not found for this struct +5 | | +6 | | impl Contract { +7 | | #[ink(constructor)] +... | +19 | | #[ink(constructor)] +20 | | pub fn constructor_2() -> Self { + | | -^^^^^^^^^^^^^ + | | || + | | |function or associated item not found in `Contract` + | |_______________|help: there is an associated function with a similar name: `constructor_1` + | error[E0599]: no function or associated item named `message_2` found for struct `Contract` in the current scope --> tests/ui/contract/fail/impl-block-for-non-storage-01.rs:25:16 | -4 | pub struct Contract {} - | --- function or associated item `message_2` not found for this struct -... -25 | pub fn message_2(&self) {} - | ^^^^^^^^^ - | | - | function or associated item not found in `Contract` - | help: there is a method with a similar name: `message_1` +4 | pub struct Contract {} + | _____---________- + | | | + | | function or associated item `message_2` not found for this struct +5 | | +6 | | impl Contract { +7 | | #[ink(constructor)] +... | +24 | | #[ink(message)] +25 | | pub fn message_2(&self) {} + | | -^^^^^^^^^ + | | || + | | |function or associated item not found in `Contract` + | |_______________|help: there is a method with a similar name: `message_1` + | diff --git a/crates/ink/tests/ui/contract/fail/impl-block-for-non-storage-02.stderr b/crates/ink/tests/ui/contract/fail/impl-block-for-non-storage-02.stderr index a55646fc2bb..ba0f236a710 100644 --- a/crates/ink/tests/ui/contract/fail/impl-block-for-non-storage-02.stderr +++ b/crates/ink/tests/ui/contract/fail/impl-block-for-non-storage-02.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> tests/ui/contract/fail/impl-block-for-non-storage-02.rs:19:10 | 19 | impl NonContract {} - | ^^^^^^^^^^^ expected struct `Contract`, found struct `NonContract` + | ^^^^^^^^^^^ expected `IsSameType`, found `IsSameType` | = note: expected struct `IsSameType` found struct `IsSameType` 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 33dee250415..cc74017436f 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 24dfe00bc5d..3ac2382e770 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 c1e9eb810e6..3e407002f52 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,10 +53,13 @@ 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` -error[E0599]: the method `try_invoke` exists for struct `CallBuilder>, Set, ArgumentList>>>, Set>>`, but its trait bounds were not satisfied +error[E0599]: the method `try_invoke` exists for struct `CallBuilder>, Set>, ...>`, but its trait bounds were not satisfied --> tests/ui/contract/fail/message-input-non-codec.rs:16:9 | 16 | pub fn message(&self, _input: NonCodecType) {} @@ -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 1d4083bd2f3..877500181fa 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,10 +34,13 @@ 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` -error[E0599]: the method `try_invoke` exists for struct `CallBuilder>, Set>>, Set>>`, but its trait bounds were not satisfied +error[E0599]: the method `try_invoke` exists for struct `CallBuilder>, Set>, ...>`, but its trait bounds were not satisfied --> tests/ui/contract/fail/message-returns-non-codec.rs:16:9 | 4 | pub struct NonCodecType; @@ -46,7 +52,7 @@ error[E0599]: the method `try_invoke` exists for struct `CallBuilder $CARGO/parity-scale-codec-3.5.0/src/codec.rs + --> $CARGO/parity-scale-codec-3.6.4/src/codec.rs | | pub trait Decode: Sized { | ^^^^^^^^^^^^^^^^^^^^^^^ 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 69ac228acc1..5ec79abc41f 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,10 +41,13 @@ 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` -error[E0599]: the method `try_invoke` exists for struct `CallBuilder>, Set, ArgumentList>>>, Set>>`, but its trait bounds were not satisfied +error[E0599]: the method `try_invoke` exists for struct `CallBuilder>, Set, ...>>>, ...>`, but its trait bounds were not satisfied --> tests/ui/trait_def/fail/message_input_non_codec.rs:5:5 | 5 | #[ink(message)] @@ -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 83a0c2c9774..f2321903953 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` @@ -33,7 +36,7 @@ error[E0599]: the method `try_invoke` exists for struct `CallBuilder $CARGO/parity-scale-codec-3.5.0/src/codec.rs + --> $CARGO/parity-scale-codec-3.6.4/src/codec.rs | | pub trait Decode: Sized { | ^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/crates/primitives/Cargo.toml b/crates/primitives/Cargo.toml index 3ad1c251bc3..5ad52bd57a9 100644 --- a/crates/primitives/Cargo.toml +++ b/crates/primitives/Cargo.toml @@ -18,8 +18,8 @@ include = ["/Cargo.toml", "src/**/*.rs", "/README.md", "/LICENSE"] derive_more = { version = "0.99", default-features = false, features = ["from", "display"] } ink_prelude = { version = "4.2.1", path = "../prelude/", default-features = false } scale = { package = "parity-scale-codec", version = "3.4", default-features = false, features = ["derive"] } -scale-decode = { version = "0.5.0", default-features = false, features = ["derive"], optional = true } -scale-encode = { version = "0.1.0", default-features = false, features = ["derive"], optional = true } +scale-decode = { version = "0.9.0", default-features = false, features = ["derive"], optional = true } +scale-encode = { version = "0.5.0", default-features = false, features = ["derive"], optional = true } scale-info = { version = "2.5", default-features = false, features = ["derive"], optional = true } xxhash-rust = { version = "0.8", features = ["const_xxh32"] } diff --git a/integration-tests/call-runtime/Cargo.toml b/integration-tests/call-runtime/Cargo.toml index 3406b0868fc..280b5d49ff8 100644 --- a/integration-tests/call-runtime/Cargo.toml +++ b/integration-tests/call-runtime/Cargo.toml @@ -17,8 +17,8 @@ scale-info = { version = "2.5", default-features = false, features = ["derive"], # (especially for global allocator). # # See also: https://substrate.stackexchange.com/questions/4733/error-when-compiling-a-contract-using-the-xcm-chain-extension. -sp-io = { version = "22.0.0", default-features = false, features = ["disable_panic_handler", "disable_oom", "disable_allocator"] } -sp-runtime = { version = "23.0.0", default-features = false } +sp-io = { version = "23.0.0", default-features = false, features = ["disable_panic_handler", "disable_oom", "disable_allocator"] } +sp-runtime = { version = "24.0.0", default-features = false } [dev-dependencies] ink_e2e = { path = "../../crates/e2e" } diff --git a/integration-tests/call-runtime/lib.rs b/integration-tests/call-runtime/lib.rs index 7bf35e12507..409ce372519 100644 --- a/integration-tests/call-runtime/lib.rs +++ b/integration-tests/call-runtime/lib.rs @@ -82,8 +82,6 @@ mod runtime_call { /// /// Fails if: /// - called in the off-chain environment - /// - the chain doesn't allow `call-runtime` API (`UnsafeUnstableInterface` is - /// turned off) /// - the chain forbids contracts to call `Balances::transfer` (`CallFilter` is /// too restrictive) /// - after the transfer, `receiver` doesn't have at least existential deposit @@ -133,7 +131,6 @@ mod runtime_call { const UNIT: Balance = 1_000_000_000_000; /// The contract will be given 1000 tokens during instantiation. - #[cfg(feature = "permissive-node")] const CONTRACT_BALANCE: Balance = 1_000 * UNIT; /// The receiver will get enough funds to have the required existential deposit. @@ -145,14 +142,12 @@ mod runtime_call { /// empty account fails. /// /// Must not be zero, because such an operation would be a successful no-op. - #[cfg(feature = "permissive-node")] const INSUFFICIENT_TRANSFER_VALUE: Balance = 1; /// Positive case scenario: /// - `call_runtime` is enabled /// - the call is valid /// - the call execution succeeds - #[cfg(feature = "permissive-node")] #[ink_e2e::test] async fn transfer_with_call_runtime_works( mut client: Client, @@ -219,7 +214,6 @@ mod runtime_call { /// - `call_runtime` is enabled /// - the call is valid /// - the call execution fails - #[cfg(feature = "permissive-node")] #[ink_e2e::test] async fn transfer_with_call_runtime_fails_when_execution_fails( mut client: Client, @@ -260,7 +254,6 @@ mod runtime_call { /// Negative case scenario: /// - `call_runtime` is enabled /// - the call is invalid - #[cfg(feature = "permissive-node")] #[ink_e2e::test] async fn transfer_with_call_runtime_fails_when_call_is_invalid( mut client: Client, @@ -292,36 +285,5 @@ mod runtime_call { Ok(()) } - - /// Negative case scenario: - /// - `call_runtime` is disabled - #[cfg(not(feature = "permissive-node"))] - #[ink_e2e::test] - async fn call_runtime_fails_when_forbidden( - mut client: Client, - ) -> E2EResult<()> { - // given - let constructor = RuntimeCallerRef::new(); - let contract_acc_id = client - .instantiate("call-runtime", &ink_e2e::alice(), constructor, 0, None) - .await - .expect("instantiate failed") - .account_id; - - let receiver: AccountId = default_accounts::().bob; - - let transfer_message = build_message::(contract_acc_id) - .call(|caller| caller.transfer_through_runtime(receiver, TRANSFER_VALUE)); - - // when - let call_res = client - .call(&ink_e2e::alice(), transfer_message, 0, None) - .await; - - // then - assert!(matches!(call_res, Err(ink_e2e::Error::CallExtrinsic(_)))); - - Ok(()) - } } } diff --git a/integration-tests/e2e-call-runtime/Cargo.toml b/integration-tests/e2e-call-runtime/Cargo.toml index 137f97e33aa..f23555fc09a 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.5", default-features = false, features = ["derive"], [dev-dependencies] ink_e2e = { path = "../../crates/e2e" } -subxt = { version = "0.28.0", default-features = false } +subxt = { version = "0.31.0", default-features = false } [lib] path = "lib.rs" diff --git a/integration-tests/e2e-call-runtime/lib.rs b/integration-tests/e2e-call-runtime/lib.rs index 07fa4cf87a7..ccfa85ac033 100644 --- a/integration-tests/e2e-call-runtime/lib.rs +++ b/integration-tests/e2e-call-runtime/lib.rs @@ -37,6 +37,7 @@ pub mod e2e_call_runtime { .await .expect("instantiate failed") .account_id; + let transfer_amount = 100_000_000_000u128; // when let call_data = vec![ @@ -45,9 +46,16 @@ pub mod e2e_call_runtime { // bytes for our destination address Value::unnamed_variant("Id", [Value::from_bytes(&contract_acc_id)]), // A value representing the amount we'd like to transfer. - Value::u128(100_000_000_000u128), + Value::u128(transfer_amount), ]; + let get_balance = build_message::(contract_acc_id.clone()) + .call(|contract| contract.get_contract_balance()); + let pre_balance = client + .call_dry_run(&ink_e2e::alice(), &get_balance, 0, None) + .await + .return_value(); + // Send funds from Alice to the contract using Balances::transfer client .runtime_call(&ink_e2e::alice(), "Balances", "transfer", call_data) @@ -61,10 +69,10 @@ pub mod e2e_call_runtime { .call_dry_run(&ink_e2e::alice(), &get_balance, 0, None) .await; - assert!(matches!( + assert_eq!( get_balance_res.return_value(), - 100_000_000_000u128 - )); + pre_balance + transfer_amount + ); Ok(()) } diff --git a/integration-tests/lang-err-integration-tests/call-builder-delegate/lib.rs b/integration-tests/lang-err-integration-tests/call-builder-delegate/lib.rs index 66ec07f6cc7..5cfc5e1d8a9 100755 --- a/integration-tests/lang-err-integration-tests/call-builder-delegate/lib.rs +++ b/integration-tests/lang-err-integration-tests/call-builder-delegate/lib.rs @@ -94,6 +94,7 @@ mod call_builder { #[cfg(all(test, feature = "e2e-tests"))] mod e2e_tests { use super::*; + use ink_e2e::build_message; type E2EResult = std::result::Result>; @@ -107,11 +108,11 @@ mod call_builder { let expected_value = 42; let constructor = CallBuilderDelegateTestRef::new(expected_value); - let call_builder = client + let contract_acc_id = client .instantiate("call_builder_delegate", &origin, constructor, 0, None) .await - .expect("instantiate failed"); - let mut call_builder_call = call_builder.call::(); + .expect("instantiate failed") + .account_id; let code_hash = client .upload("incrementer", &origin, None) @@ -120,9 +121,13 @@ mod call_builder { .code_hash; let selector = ink::selector_bytes!("get"); - let call = call_builder_call.invoke(code_hash, selector); + let call = + build_message::(contract_acc_id.clone()) + .call(|call_builder_contract| { + call_builder_contract.invoke(code_hash, selector) + }); let call_result = client - .call(&origin, &call, 0, None) + .call(&origin, call, 0, None) .await .expect("Client failed to call `call_builder::invoke`.") .return_value(); @@ -144,12 +149,11 @@ mod call_builder { .await; let constructor = CallBuilderDelegateTestRef::new(Default::default()); - let call_builder_contract = client + let contract_acc_id = client .instantiate("call_builder_delegate", &origin, constructor, 0, None) .await - .expect("instantiate failed"); - let mut call_builder_call = - call_builder_contract.call::(); + .expect("instantiate failed") + .account_id; let code_hash = client .upload("incrementer", &origin, None) @@ -158,9 +162,13 @@ mod call_builder { .code_hash; let selector = ink::selector_bytes!("invalid_selector"); - let call = call_builder_call.delegate(code_hash, selector); + let call = + build_message::(contract_acc_id.clone()) + .call(|call_builder_contract| { + call_builder_contract.delegate(code_hash, selector) + }); let call_result = client - .call(&origin, &call, 0, None) + .call(&origin, call, 0, None) .await .expect("Calling `call_builder::delegate` failed"); @@ -181,12 +189,11 @@ mod call_builder { .await; let constructor = CallBuilderDelegateTestRef::new(Default::default()); - let call_builder_contract = client + let contract_acc_id = client .instantiate("call_builder_delegate", &origin, constructor, 0, None) .await - .expect("instantiate failed"); - let mut call_builder_call = - call_builder_contract.call::(); + .expect("instantiate failed") + .account_id; let code_hash = client .upload("incrementer", &origin, None) @@ -197,7 +204,11 @@ mod call_builder { // Since `LangError`s can't be handled by the `CallBuilder::invoke()` method // we expect this to panic. let selector = ink::selector_bytes!("invalid_selector"); - let call = call_builder_call.invoke(code_hash, selector); + let call = + build_message::(contract_acc_id.clone()) + .call(|call_builder_contract| { + call_builder_contract.invoke(code_hash, selector) + }); let call_result = client.call_dry_run(&origin, &call, 0, None).await; assert!(call_result.is_err()); diff --git a/integration-tests/multi_contract_caller/accumulator/lib.rs b/integration-tests/multi_contract_caller/accumulator/lib.rs index 9986f4dc139..5f76910081c 100644 --- a/integration-tests/multi_contract_caller/accumulator/lib.rs +++ b/integration-tests/multi_contract_caller/accumulator/lib.rs @@ -15,7 +15,7 @@ pub mod accumulator { impl Accumulator { /// Initializes the value to the initial value. - #[ink(constructor)] + #[ink(constructor, payable)] pub fn new(init_value: i32) -> Self { Self { value: init_value } } diff --git a/integration-tests/multi_contract_caller/adder/lib.rs b/integration-tests/multi_contract_caller/adder/lib.rs index 72529d7dadb..366693122d2 100644 --- a/integration-tests/multi_contract_caller/adder/lib.rs +++ b/integration-tests/multi_contract_caller/adder/lib.rs @@ -18,7 +18,7 @@ mod adder { impl Adder { /// Creates a new `adder` from the given `accumulator`. - #[ink(constructor)] + #[ink(constructor, payable)] pub fn new(accumulator: AccumulatorRef) -> Self { Self { accumulator } } diff --git a/integration-tests/multi_contract_caller/lib.rs b/integration-tests/multi_contract_caller/lib.rs index be4318f8f97..44fa79a541b 100644 --- a/integration-tests/multi_contract_caller/lib.rs +++ b/integration-tests/multi_contract_caller/lib.rs @@ -50,7 +50,7 @@ mod multi_contract_caller { impl MultiContractCaller { /// Instantiate a `multi_contract_caller` contract with the given sub-contract /// codes. - #[ink(constructor)] + #[ink(constructor, payable)] pub fn new( init_value: i32, version: u32, @@ -155,7 +155,7 @@ mod multi_contract_caller { "multi_contract_caller", &ink_e2e::alice(), constructor, - 0, + 10_000_000_000_000, None, ) .await diff --git a/integration-tests/multi_contract_caller/subber/lib.rs b/integration-tests/multi_contract_caller/subber/lib.rs index aee051bfc90..541f290d320 100644 --- a/integration-tests/multi_contract_caller/subber/lib.rs +++ b/integration-tests/multi_contract_caller/subber/lib.rs @@ -18,7 +18,7 @@ mod subber { impl Subber { /// Creates a new `subber` from the given `accumulator`. - #[ink(constructor)] + #[ink(constructor, payable)] pub fn new(accumulator: AccumulatorRef) -> Self { Self { accumulator } } diff --git a/integration-tests/payment-channel/Cargo.toml b/integration-tests/payment-channel/Cargo.toml index ba8d86ec119..7b8e876b456 100755 --- a/integration-tests/payment-channel/Cargo.toml +++ b/integration-tests/payment-channel/Cargo.toml @@ -9,7 +9,7 @@ publish = false ink = { path = "../../crates/ink", default-features = false } scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } -scale-info = { version = "2.5", default-features = false, features = ["derive"] } +scale-info = { version = "2.5", default-features = false, features = ["derive"], optional = true } [dev-dependencies] hex-literal = { version = "0.3" }