From 58831a59fc107834e69277c4e09426930abe2226 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Venturo?= Date: Fri, 10 Mar 2023 15:20:34 -0300 Subject: [PATCH] Fix flaky test (#2348) --- pkg/solidity-utils/test/WordCodec.test.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/solidity-utils/test/WordCodec.test.ts b/pkg/solidity-utils/test/WordCodec.test.ts index 47d564d48e..8d15723961 100644 --- a/pkg/solidity-utils/test/WordCodec.test.ts +++ b/pkg/solidity-utils/test/WordCodec.test.ts @@ -5,6 +5,7 @@ import { deploy } from '@balancer-labs/v2-helpers/src/contract'; import { bn, negate } from '@balancer-labs/v2-helpers/src/numbers'; import { random } from 'lodash'; import { ONES_BYTES32, ZERO_BYTES32 } from '@balancer-labs/v2-helpers/src/constants'; +import { hexZeroPad } from 'ethers/lib/utils'; describe('WordCodec', () => { let lib: Contract; @@ -162,7 +163,7 @@ describe('WordCodec', () => { }); describe('insert', () => { - const word = bn(random(2 ** 255)); + const word = hexZeroPad(bn(random(2 ** 255)).toHexString(), 32); describe('unsigned', () => { it('reverts with zero bit length', async () => {