From b188a1f075d43ae0ee57cfb7e66e424153df19d2 Mon Sep 17 00:00:00 2001 From: Dmytro Date: Tue, 19 Dec 2023 18:35:07 +0000 Subject: [PATCH] ima-agent#10 update gas limit calculation in tests --- network-browser/tests/testUtils.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/network-browser/tests/testUtils.ts b/network-browser/tests/testUtils.ts index d59ed54a..f2c3cad1 100644 --- a/network-browser/tests/testUtils.ts +++ b/network-browser/tests/testUtils.ts @@ -28,7 +28,7 @@ export const TEST_VALIDATOR_NAME = 'test_val' const TEST_VALIDATOR_ID = 1n const ETH_TRANSFER_AMOUNT = '0.1' const CONFIRMATION_BLOCKS = 2 -const GAS_MULTIPLIER = 2n +const GAS_MULTIPLIER = 1.2 export function validatorsContract(abi: SkaleManagerAbi, wallet: Wallet): Contract { return new Contract(abi.validator_service_address, abi.validator_service_abi, wallet) @@ -228,7 +228,7 @@ function ipToHex(ip: string): string { export async function sendTx(func: any, args: any[]): Promise { const estimatedGas = await func.estimateGas(...args) const response: TransactionResponse = await func(...args, { - gasLimit: estimatedGas * GAS_MULTIPLIER + gasLimit: BigInt(Math.round(Number(estimatedGas) * GAS_MULTIPLIER)) }) return await response.wait(CONFIRMATION_BLOCKS) }