2

I have the substrate-contracts-node running and I run the following command on the flipper contract:

cargo test --features e2e-tests

Results in the following error:

running 4 tests
test flipper::tests::default_works ... ok
test flipper::tests::it_works ... ok
test flipper::e2e_tests::default_works ... FAILED
test flipper::e2e_tests::it_works ... FAILED

failures:

---- flipper::e2e_tests::default_works stdout ----
thread 'flipper::e2e_tests::default_works' panicked at 'error on ws request `contracts_instantiate`: Rpc(ClientError(Call(Custom(ErrorObject { code: InternalError, message: "Unknown error occurred", data: Some(RawValue("Client(Execution(RuntimePanicked(\"Bad input data provided to instantiate: unexpected first byte decoding Option\")))")) }))))', /Users/bruno/.cargo/registry/src/github.com-1ecc6299db9ec823/ink_e2e-4.0.1/src/xts.rs:237:17

---- flipper::e2e_tests::it_works stdout ----
thread 'flipper::e2e_tests::it_works' panicked at 'error on ws request `contracts_instantiate`: Rpc(ClientError(Call(Custom(ErrorObject { code: InternalError, message: "Unknown error occurred", data: Some(RawValue("Client(Execution(RuntimePanicked(\"Bad input data provided to instantiate: unexpected first byte decoding Option\")))")) }))))', /Users/bruno/.cargo/registry/src/github.com-1ecc6299db9ec823/ink_e2e-4.0.1/src/xts.rs:237:17
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace


failures:
    flipper::e2e_tests::default_works
    flipper::e2e_tests::it_works

test result: FAILED. 2 passed; 2 failed; 0 ignored; 0 measured; 0 filtered out; finished in 1.04s
cargo-contract-contract 2.1.0-unknown-aarch64-apple-darwin
stable-aarch64-apple-darwin (default)
rustc 1.68.0 (2c8cc3432 2023-03-06)

1 Answer 1

2

Make sure you run the latest release of substrate-contracts-node and have it installed in PATH. You do not need to run it in the background, E2E tests will automatically start the node for each test independently.

1
  • This is correct. I ran: cargo install contracts-node --git https://github.com/paritytech/substrate-contracts-node.git --tag v0.24.0 and re-ran the e2e tests and it worked.
    – Bruno
    Commented Mar 15, 2023 at 15:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.