o2-tools 0.1.10

Reusable tooling for trade account and order book contract interactions on Fuel
use fuels::{
    accounts::{
        signers::private_key::PrivateKeySigner,
        wallet::{
            Unlocked,
            Wallet,
        },
    },
    macros::abigen,
    programs::contract::Contract,
    types::{
        ContractId,
        Salt,
        transaction::TxPolicies,
    },
};

abigen!(Contract(
    name = "LargeContract",
    abi = "artifacts/test_artifacts/large_contract-abi.json"
));
pub const LARGE_CONTRACT_BYTECODE: &[u8] =
    include_bytes!("../../../artifacts/test_artifacts/large_contract.bin");

pub async fn setup_large_contract(
    wallet: &Wallet<Unlocked<PrivateKeySigner>>,
) -> (
    LargeContract<Wallet<Unlocked<PrivateKeySigner>>>,
    ContractId,
) {
    let id = Contract::regular(LARGE_CONTRACT_BYTECODE.to_vec(), Salt::default(), vec![])
        .deploy(wallet, TxPolicies::default())
        .await
        .unwrap()
        .contract_id;

    let instance = LargeContract::new(id, wallet.clone());

    (instance, id)
}