Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cross-contract-calls e2e tests fail if non-default name is chosen for the folder #323

Open
Tomen opened this issue Oct 19, 2024 · 1 comment

Comments

@Tomen
Copy link

Tomen commented Oct 19, 2024

  1. create the cross-contract-calls template, but name it differently
  2. run the e2e tests

Output:

    Finished `release` profile [optimized] target(s) in 37.08s
     Running `target/ink/release/metadata-gen`
test e2e_tests::instantiate_v2_no_limits ... FAILED
test e2e_tests::flip_and_get ... FAILED
test e2e_tests::instantiate_v2_with_sufficient_limits ... FAILED
test e2e_tests::flip_and_get_v2 ... FAILED
test e2e_tests::instantiate_v2_with_insufficient_storage_deposit_limit ... FAILED

failures:

---- e2e_tests::instantiate_v2_no_limits stdout ----
thread 'e2e_tests::instantiate_v2_no_limits' panicked at /home/tomen/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ink_e2e-5.0.0/src/client_utils.rs:62:17:
Unknown contract cross-contract-calls. Available contracts: ["other_contract", "t3_test"].
For a contract to be built, add it as a dependency to the `Cargo.toml`

---- e2e_tests::flip_and_get stdout ----
thread 'e2e_tests::flip_and_get' panicked at /home/tomen/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ink_e2e-5.0.0/src/client_utils.rs:62:17:
Unknown contract cross-contract-calls. Available contracts: ["other_contract", "t3_test"].
For a contract to be built, add it as a dependency to the `Cargo.toml`

---- e2e_tests::instantiate_v2_with_sufficient_limits stdout ----
thread 'e2e_tests::instantiate_v2_with_sufficient_limits' panicked at /home/tomen/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ink_e2e-5.0.0/src/client_utils.rs:62:17:
Unknown contract cross-contract-calls. Available contracts: ["other_contract", "t3_test"].
For a contract to be built, add it as a dependency to the `Cargo.toml`

---- e2e_tests::flip_and_get_v2 stdout ----
thread 'e2e_tests::flip_and_get_v2' panicked at /home/tomen/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ink_e2e-5.0.0/src/client_utils.rs:62:17:
Unknown contract cross-contract-calls. Available contracts: ["other_contract", "t3_test"].
For a contract to be built, add it as a dependency to the `Cargo.toml`

---- e2e_tests::instantiate_v2_with_insufficient_storage_deposit_limit stdout ----
 [==] Checking clippy linting rules
 [==] Building cargo project
warning: the `name` field in the `[lib]` section of the `Cargo.toml`, is no longer used for the name of generated contract artifacts. The package name is used instead. Remove the `[lib] name` to stop this warning.
 [==] Checking clippy linting rules
 [==] Building cargo project
 [==] Post processing code
 [==] Generating metadata
 [==] Generating bundle
thread 'e2e_tests::instantiate_v2_with_insufficient_storage_deposit_limit' panicked at /home/tomen/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ink_e2e-5.0.0/src/client_utils.rs:62:17:
Unknown contract cross-contract-calls. Available contracts: ["other_contract", "t3_test"].
For a contract to be built, add it as a dependency to the `Cargo.toml`
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace


failures:
    e2e_tests::flip_and_get
    e2e_tests::flip_and_get_v2
    e2e_tests::instantiate_v2_no_limits
    e2e_tests::instantiate_v2_with_insufficient_storage_deposit_limit
    e2e_tests::instantiate_v2_with_sufficient_limits

test result: FAILED. 0 passed; 5 failed; 0 ignored; 0 measured; 0 filtered out; finished in 96.24s

error: test failed, to rerun pass `--lib`
Error: Failed to execute test command: Cargo test command failed: command ["cargo", "test", "--features=e2e-tests"] exited with code 101
@AlexD10S
Copy link
Collaborator

Thank you for reporting the bug. We're working on a fix.
In the meantime, to unblock you, you can manually change the name of the contract instantiated in the e2e_tests.rs file. Here: https://github.com/use-ink/ink-examples/blob/main/cross-contract-calls/e2e_tests.rs#L17

let contract = client
    .instantiate("cross-contract-calls", &ink_e2e::alice(), &mut constructor)
    .submit();

Replace "cross-contract-calls" with the name of your contract. This should allow you to proceed while we address the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants