diff --git a/docs/book/src/testing/testing-with-rust.md b/docs/book/src/testing/testing-with-rust.md index 2efaf9e7160..d87402f9c7d 100644 --- a/docs/book/src/testing/testing-with-rust.md +++ b/docs/book/src/testing/testing-with-rust.md @@ -180,10 +180,13 @@ following: ```rust,ignore use fuels::{prelude::*, types::ContractId}; -// Load ABI from JSON -abigen!(TestContract, "out/debug/my-fuel-project-abi.json"); +// Load abi from json +abigen!(Contract( + name = "MyContract", + abi = "out/debug/my-fuel-project-abi.json" +)); -async fn get_contract_instance() -> (TestContract, ContractId) { +async fn get_contract_instance() -> (MyContract, ContractId) { // Launch a local network and deploy the contract let mut wallets = launch_custom_provider_and_get_wallets( WalletsConfig::new( @@ -192,8 +195,10 @@ async fn get_contract_instance() -> (TestContract, ContractId) { Some(1_000_000_000), /* Amount per coin */ ), None, + None, ) - .await; + .await + .unwrap(); let wallet = wallets.pop().unwrap(); let id = Contract::load_from( @@ -206,11 +211,11 @@ async fn get_contract_instance() -> (TestContract, ContractId) { ), ) .unwrap() - .deploy(&wallet, TxParameters::default()) + .deploy(&wallet, TxPolicies::default()) .await .unwrap(); - let instance = TestContract::new(id.to_string(), wallet); + let instance = MyContract::new(id.clone(), wallet); (instance, id.into()) }