Skip to content

Commit

Permalink
[v4.x.x] fix E2E tests for newer rust toolchain & contracts node (u…
Browse files Browse the repository at this point in the history
…se-ink#1884)

* Manual backport of use-ink#1883: Use `contract-build` `3.2.0`

* ink-e2e Test Failures in substrate-contracts-node (v0.27.0) due to Unsupported --ws-port Argument (use-ink#1850)

* Update ink-e2e to the latest substrate-contracts-node

* Apply rust-fmt

* Change logging, to be up-to-date with master branch

* Apply rustfmt-nightly

(cherry picked from commit 6d7810e)

* Remove --ws-port arg

* Update substrate deps

* Manual backports of use-ink#1795 and use-ink#1855 to update subxt

* Update subxt in example

* Backport: fix e2e test, account for contract initial free balance (use-ink#1777)

* Use latest CI image

* 🦖 fix spellcheck for new version, add words to dict (use-ink#1836)

* Fix call-runtime tests

* enable call-runtime tests

* ui tests

* `[ink_e2e]` update `Determinism` enum to match Substrate definition (use-ink#1781)

* `[ink_e2e]` update `Determinism` enum to match Substrate definition

* fmt

* Fix multi_contract_caller example for new deposit behaviour

* Reenable examples-test step

* Fix integration test

* Remove riscv +stable

* Fix riscv build

---------

Co-authored-by: Bohdan Ohorodnii <35969035+varex83@users.noreply.github.com>
  • Loading branch information
2 people authored and goastler committed Aug 31, 2023
1 parent d6f94b3 commit 03be415
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 12 deletions.
2 changes: 1 addition & 1 deletion integration-tests/e2e-call-runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ scale-info = { version = "2.6", default-features = false, features = ["derive"],

[dev-dependencies]
ink_e2e = { path = "../../crates/e2e" }
subxt = { version = "0.30.0", default-features = false }
subxt = { version = "0.31.0", default-features = false }

[lib]
path = "lib.rs"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<T> = std::result::Result<T, Box<dyn std::error::Error>>;

Expand All @@ -106,12 +107,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::<CallBuilderDelegateTest>();
.expect("instantiate failed")
.account_id;

let code_hash = client
.upload("incrementer", &origin, None)
Expand All @@ -120,9 +120,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::<CallBuilderDelegateTestRef>(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");

Expand All @@ -143,12 +147,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::<CallBuilderDelegateTest>();
.expect("instantiate failed")
.account_id;

let code_hash = client
.upload("incrementer", &origin, None)
Expand All @@ -159,7 +162,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::<CallBuilderDelegateTestRef>(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());
Expand Down

0 comments on commit 03be415

Please sign in to comment.