Skip to content

Commit

Permalink
ima-agent#10 update gas limit calculation in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dmytrotkk committed Dec 19, 2023
1 parent ad3cc8e commit b188a1f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions network-browser/tests/testUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -228,7 +228,7 @@ function ipToHex(ip: string): string {
export async function sendTx(func: any, args: any[]): Promise<TransactionReceipt | null> {
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)
}
Expand Down

0 comments on commit b188a1f

Please sign in to comment.