You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If a contract is included in an E2E test using the additional_contract argument then
this argument needs to come before any other invocations of ink_e2e::test, even if the
additional contracts aren't used, otherwise compilation fails.
For example, the below example fails to compile with the following error:
❯ cargo +nightly test --manifest-path ./examples/flipper/Cargo.toml
error[E0433]: failed to resolve: use of undeclared crate or module `accumulator`
--> lib.rs:77:31
|
77 | let constructor = accumulator::constructors::new(0);
| ^^^^^^^^^^^ use of undeclared crate or module `accumulator`
For more information about this error, try `rustc --explain E0433`.
error: could not compile `flipper` due to previous error
We should be able to include tests in any order, and we should expect that only tests
which use additional contracts require this argument.
This can be reproduced with ink@7789caf, cargo-contract@3e24722, and substrate-contracts-node@0.21.0 using the following tests with Flipper:
#[cfg(test)]mod e2e_tests {typeE2EResult<T> = std::result::Result<T,Box<dyn std::error::Error>>;#[ink_e2e::test]// N.B, We need to include this, even though the `accumulator` contract isn't used in// this test, otherwise compilation of `e2e_second_instantiation` fails.//// #[ink_e2e::test(additional_contracts = "../delegator/accumulator/Cargo.toml")]asyncfne2e_first_instantiation(mutclient: ink_e2e::Client<C,E>,) -> E2EResult<()>{let constructor = flipper::constructors::default();
client
.instantiate(&mut ink_e2e::alice(), constructor,0,None).await.expect("Instantiate `flipper` failed");Ok(())}#[ink_e2e::test(additional_contracts = "../delegator/accumulator/Cargo.toml")]asyncfne2e_second_instantiation(mutclient: ink_e2e::Client<C,E>,) -> E2EResult<()>{let constructor = accumulator::constructors::new(0);
client
.instantiate(&mut ink_e2e::bob(), constructor,0,None).await.expect("Instantiate `adder` failed");Ok(())}}
The text was updated successfully, but these errors were encountered:
If a contract is included in an E2E test using the
additional_contract
argument thenthis argument needs to come before any other invocations of
ink_e2e::test
, even if theadditional contracts aren't used, otherwise compilation fails.
For example, the below example fails to compile with the following error:
We should be able to include tests in any order, and we should expect that only tests
which use additional contracts require this argument.
This can be reproduced with
ink@7789caf
,cargo-contract@3e24722
, andsubstrate-contracts-node@0.21.0
using the following tests withFlipper
:The text was updated successfully, but these errors were encountered: