I created a new counter contract and added Rust SDK as the documentation suggests.
Then I am seeing this error message when I run cargo test on the default contract, how could I fix it?
$ cargo test
...
running 1 test
test can_get_contract_id ... FAILED
failures:
---- can_get_contract_id stdout ----
the exit status from the fuel binary was: Output { status: ExitStatus(unix_wait_status(256)), stdout: "", stderr: "Error: an error occurred while loading the chain state file: Some(\"/tmp/.tmp0NVqID/chain_config.json\")\n\nCaused by:\n unknown variant `V2`, expected `V1` at line 4 column 8\n" }, stdout: , stderr: Error: an error occurred while loading the chain state file: Some("/tmp/.tmp0NVqID/chain_config.json")
Caused by:
unknown variant `V2`, expected `V1` at line 4 column 8
thread 'can_get_contract_id' panicked at tests/harness.rs:21:6:
called `Result::unwrap()` on an `Err` value: Other("could not connect to fuel core server")
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
failures:
can_get_contract_id
test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 1.55s
error: test failed, to rerun pass `--test integration_tests`
It looks like our documentation and published crates online are ahead of what Fuelup is using for fuel-core… your fuelup is currently showing 0.35.0 while crates.io is at 0.36.0.
I’m not sure when, but we will be rolling out fuel-core to 0.36.0 soon which should get cargo test work again for you.
Until the fuelup toolchain updates, I used the fuel-core package for my system and it is running now.
If someone else is having the same issue go to the packages on fuel-core repository uncompress the file and replace the binaries of fuel-core in your fuelup toolchain.
You will find the outdated fuel-core binaries here