use-ink / ink-examples

A set of examples for ink! smart contract language. Happy hacking!
https://use.ink
The Unlicense
104 stars 54 forks source link

e2e tests are failing #20

Closed niklabh closed 1 year ago

niklabh commented 1 year ago

in flipper directory when running:

cargo test --features e2e-tests

getting this error:

  --> lib.rs:62:9
   |
62 |         #[ink_e2e::test]
   |         ^^^^^^^^^^^^^^^^
   |
   = help: message: contract build for /home/nikhil/astar/ink-examples/flipper/Cargo.toml failed: Loading of original wasm failed

error: custom attribute panicked
  --> lib.rs:94:9
   |
94 |         #[ink_e2e::test]
   |         ^^^^^^^^^^^^^^^^
   |
   = help: message: Once instance has previously been poisoned

warning: unused import: `super::*`
  --> lib.rs:57:13
   |
57 |         use super::*;
   |             ^^^^^^^^
   |
   = note: `#[warn(unused_imports)]` on by default

warning: unused import: `ink_e2e::build_message`
  --> lib.rs:58:13
   |
58 |         use ink_e2e::build_message;
   |             ^^^^^^^^^^^^^^^^^^^^^^

warning: `flipper` (lib test) generated 2 warnings
error: could not compile `flipper` (lib test) due to 2 previous errors; 2 warnings emitted
ascjones commented 1 year ago

I have tried this and it works for me. The original issue appears to be:

Loading of original wasm failed.

Can you do a cargo clean or even better a git clean -xdf (making sure you have any changes you want to keep committed) and run it again?

niklabh commented 1 year ago

Same error after cleaning

gangov commented 1 year ago

I can also confirm that cargo test --features e2e-tests runs fine. I'm using the latest ink version on my machine

SkymanOne commented 1 year ago

Please confirm that you are using the latest version of cargo-contract and substrate-contracts-node and the node is installed in your path

Steven-Chang commented 1 year ago

I got it to work by reinstalling substrate-contracts-node