OutOfGas Error when calling contract will call parameters

Not sure if related to TransactionGasLimit error during contract method call:

but I am getting an out of gas error when calling my smart contract.

pub const TOKEN_A: AssetId = AssetId::new([1u8; 32]);
pub const BASE_ASSET: AssetId = AssetId::new([0u8; 32]);

struct Fixture {
    wallet: WalletUnlocked,
    voting_vault_instance: VotingVault<WalletUnlocked>,
}

async fn get_wallets() -> Vec<WalletUnlocked> {
    let initial_amount = 10_000_000_000 * 10u64.pow(9);
    let assets = vec![AssetConfig {
        id: TOKEN_A,
        num_coins: 1,
        coin_amount:  initial_amount,
    },
    AssetConfig {
        id: BASE_ASSET,
        num_coins: 1,
        coin_amount:  initial_amount,
    }];
    let wallet_config = WalletsConfig::new_multiple_assets(1, assets);
    let wallets = launch_custom_provider_and_get_wallets(wallet_config, None, None).await;
    wallets
}

async fn setup() -> Fixture {
    let mut wallets = get_wallets().await;
    let wallet = wallets.pop().unwrap();

    let voting_vault_id = ...
    let voting_vault_instance = VotingVault::new(voting_vault_id.clone(), wallet.clone());

    voting_vault_instance
        .methods()
        .deposit(Identity::Address(Address::from(fixture.wallet.address())))
        .tx_params(TxParameters::default())
        .call_params(CallParameters::new(1000, TOKEN_A, 0))
        .unwrap()
        .call()
        .await.unwrap();
}

This last line creates and out of gas error.

The deposit method doesn’t do much. I tried setting a gas limit in tx parameters but also didn’t help.

You have set a 0 amount of gas_forwarded in you call parameters :slight_smile:.
You should try with:

    voting_vault_instance
        .methods()
        .deposit(Identity::Address(Address::from(fixture.wallet.address())))
        .tx_params(TxParameters::default())
        .call_params(CallParameters::new(1000, TOKEN_A, 1000))
        .unwrap()
        .call()
        .await.unwrap();

You can play with the values to check if this works better.