Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merge branch 'master' into ag-call-runtime-stabilize
  • Loading branch information
agryaznov committed May 26, 2023
commit 1e658b1fa403d50b8546085133ac19d076e848b6
3 changes: 3 additions & 0 deletions integration-tests/custom-environment/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,6 @@ std = [
]
ink-as-dependency = []
e2e-tests = []

# Assumes that the node used in E2E testing allows for at least 6 event topics.
permissive-node = []
33 changes: 33 additions & 0 deletions integration-tests/custom-environment/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ mod runtime_call {

type E2EResult<T> = Result<T, Box<dyn std::error::Error>>;

#[cfg(feature = "permissive-node")]
#[ink_e2e::test(environment = crate::EnvironmentWithManyTopics)]
async fn calling_custom_environment_works(
mut client: Client<C, E>,
Expand Down Expand Up @@ -125,5 +126,37 @@ mod runtime_call {

Ok(())
}

#[cfg(not(feature = "permissive-node"))]
#[ink_e2e::test(environment = crate::EnvironmentWithManyTopics)]
async fn calling_custom_environment_fails_if_incompatible_with_node(
mut client: Client<C, E>,
) -> E2EResult<()> {
// given
let constructor = TopicsRef::new();
let contract = client
.instantiate(
"custom-environment",
&ink_e2e::alice(),
constructor,
0,
None,
)
.await
.expect("instantiate failed");
let mut call = contract.call::<Topics>();

let message = call.trigger();

// when
let call_res = client
.call_dry_run(&ink_e2e::alice(), &message, 0, None)
.await;

// then
assert!(call_res.is_err());

Ok(())
}
}
}
You are viewing a condensed version of this merge commit. You can view the full changes here.