Hey @2575169674! Nice to see you in the Fuel community! I would highly recommend our Introduction to Sway for Javascript developers tutorial. The rust testing section specifically should be very useful to you.
Steps to replicate should goes as follows
Once you have written and built your sway contract you should have your ABI json file within this path
“out/debug/contract-abi.json” of your project
Using the ABI generated with forc build you can then load it into your rust file similar to the line above.
You just need to create an instance using the loaded abi within your Rust code like so
let instance = SwayStore::new(id.clone(), wallet);
Finally you can reference your contract instance and make contract calls like this
let (instance, _id, wallets) = get_contract_instance().await;
// get access to a test wallet
let wallet_1 = wallets.get(0).unwrap();
// initialize wallet_1 as the owner
let owner_result = instance
.with_account(wallet_1.clone())
.unwrap()
.methods()
.initialize_owner()
.call()
.await
.unwrap();