o2-tools 0.1.17

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 = "contracts/test_artifacts/large_contract/out/release/large-contract-abi.json"
));
pub const LARGE_CONTRACT_BYTECODE: &[u8] = include_bytes!(
    "../../../contracts/test_artifacts/large_contract/out/release/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)
}