You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
use fuels::{prelude::*, types::ContractId};// Load abi from jsonabigen!(Contract(
name = "MyContract",
abi = "out/debug/test_sdk_vec_alias-abi.json"));asyncfnget_contract_instance() -> (MyContract<WalletUnlocked>,ContractId){// Launch a local network and deploy the contractletmut wallets = launch_custom_provider_and_get_wallets(WalletsConfig::new(Some(1),/* Single wallet */Some(1),/* Single coin (UTXO) */Some(1_000_000_000),/* Amount per coin */),None,None,).await.unwrap();let wallet = wallets.pop().unwrap();let id = Contract::load_from("./out/debug/test_sdk_vec_alias.bin",LoadConfiguration::default(),).unwrap().deploy(&wallet,TxPolicies::default()).await.unwrap();let instance = MyContract::new(id.clone(), wallet);(instance, id.into())}#[tokio::test]asyncfncan_get_contract_id(){let(instance, _id) = get_contract_instance().await;// Now you have an instance of your contract you can use to test each functionlet result = instance.methods().test_function().await.unwrap().value;}
The text was updated successfully, but these errors were encountered:
If an alias is defined in Sway that is a
Vec
, then the Rust SDK will fail to compile.Minimal Repro Sway Contract:
Minimal Repro SDK harness:
The text was updated successfully, but these errors were encountered: