Hi there
Trying to deploy my dapp in testnet using next test, but have an error
Test:
use dotenv::dotenv;
use fuels::prelude::*;
const RPC: &str = "https://node-beta-2.fuel.network/graphql";
#[tokio::test]
async fn deploy_token_contract() {
let provider = match Provider::connect(RPC).await {
Ok(p) => p,
Err(error) => panic!("❌ Problem creating provider: {:#?}", error),
};
dotenv().ok();
let secret = match std::env::var("SECRET") {
Ok(s) => s,
Err(error) => panic!("❌ Cannot find .env file: {:#?}", error),
};
let wallet = WalletUnlocked::new_from_private_key(secret.parse().unwrap(), Some(provider));
let token_contract_id = Contract::deploy(
"out/debug/token_contract.bin",
&wallet,
TxParameters::default(),
StorageConfiguration::with_storage_path(Some(
"./out/debug/token_contract-storage_slots.json".to_string(),
)),
)
.await;
let token_contract_id = match token_contract_id {
Ok(id) => id,
Err(error) => panic!("❌ Problem deploing the dapp: {:#?}", error),
};
println!("✅ Contract deployed @ {token_contract_id}");
}
Error:
Compiling tests v0.0.0 (/Users/alexey/projects/fuel-token-standard/token_contract)
Finished test [unoptimized + debuginfo] target(s) in 2.71s
Running tests/harness.rs (target/debug/deps/tests-ebb925acf86f95a5)
running 1 test
thread 'actions::deploy_token_contract::deploy_token_contract' panicked at '❌ Problem deploing the dapp: ProviderError(
"Response errors; Unknown field \"consensus\" on type \"Block\".; Unknown type \"Genesis\"; Unknown type \"PoAConsensus\"",
)', tests/actions/deploy_token_contract.rs:32:23
stack backtrace:
0: rust_begin_unwind
at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/std/src/panicking.rs:584:5
1: core::panicking::panic_fmt
at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/core/src/panicking.rs:142:14
2: tests::actions::deploy_token_contract::deploy_token_contract::{{closure}}
at ./tests/actions/deploy_token_contract.rs:32:23
3: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/core/src/future/mod.rs:91:19
4: <core::pin::Pin<P> as core::future::future::Future>::poll
at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/core/src/future/future.rs:124:9
5: <core::pin::Pin<P> as core::future::future::Future>::poll
at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/core/src/future/future.rs:124:9
6: tokio::runtime::scheduler::current_thread::CoreGuard::block_on::{{closure}}::{{closure}}::{{closure}}
at /Users/alexey/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.23.0/src/runtime/scheduler/current_thread.rs:541:57
7: tokio::runtime::coop::with_budget
at /Users/alexey/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.23.0/src/runtime/coop.rs:102:5
8: tokio::runtime::coop::budget
at /Users/alexey/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.23.0/src/runtime/coop.rs:68:5
9: tokio::runtime::scheduler::current_thread::CoreGuard::block_on::{{closure}}::{{closure}}
at /Users/alexey/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.23.0/src/runtime/scheduler/current_thread.rs:541:25
10: tokio::runtime::scheduler::current_thread::Context::enter
at /Users/alexey/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.23.0/src/runtime/scheduler/current_thread.rs:350:19
11: tokio::runtime::scheduler::current_thread::CoreGuard::block_on::{{closure}}
at /Users/alexey/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.23.0/src/runtime/scheduler/current_thread.rs:540:36
12: tokio::runtime::scheduler::current_thread::CoreGuard::enter::{{closure}}
at /Users/alexey/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.23.0/src/runtime/scheduler/current_thread.rs:615:57
13: tokio::macros::scoped_tls::ScopedKey<T>::set
at /Users/alexey/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.23.0/src/macros/scoped_tls.rs:61:9
14: tokio::runtime::scheduler::current_thread::CoreGuard::enter
at /Users/alexey/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.23.0/src/runtime/scheduler/current_thread.rs:615:27
15: tokio::runtime::scheduler::current_thread::CoreGuard::block_on
at /Users/alexey/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.23.0/src/runtime/scheduler/current_thread.rs:530:19
16: tokio::runtime::scheduler::current_thread::CurrentThread::block_on
at /Users/alexey/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.23.0/src/runtime/scheduler/current_thread.rs:154:24
17: tokio::runtime::runtime::Runtime::block_on
at /Users/alexey/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.23.0/src/runtime/runtime.rs:282:47
18: tests::actions::deploy_token_contract::deploy_token_contract
at ./tests/actions/deploy_token_contract.rs:35:5
19: tests::actions::deploy_token_contract::deploy_token_contract::{{closure}}
at ./tests/actions/deploy_token_contract.rs:7:7
20: core::ops::function::FnOnce::call_once
at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/core/src/ops/function.rs:248:5
21: core::ops::function::FnOnce::call_once
at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/core/src/ops/function.rs:248:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
test actions::deploy_token_contract::deploy_token_contract ... FAILED
failures:
failures:
actions::deploy_token_contract::deploy_token_contract
test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 4 filtered out; finished in 0.76s
error: test failed, to rerun pass '-p tests --test tests'