From 4054de617b703e52601387259ffcc391f5961a8b Mon Sep 17 00:00:00 2001 From: Jordan Krage Date: Wed, 20 Nov 2024 14:04:13 -0600 Subject: [PATCH] core/services/fluxmonitorv2: fix TestFluxMonitor_Deviation race --- core/services/fluxmonitorv2/integrations_test.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/core/services/fluxmonitorv2/integrations_test.go b/core/services/fluxmonitorv2/integrations_test.go index e2344be3483..4709079a670 100644 --- a/core/services/fluxmonitorv2/integrations_test.go +++ b/core/services/fluxmonitorv2/integrations_test.go @@ -55,9 +55,10 @@ const fee = int64(100) // Amount paid by FA contract, in LINK-wei const faTimeout = uint32(1) var pollTimerPeriod = 200 * time.Millisecond // if failing due to timeouts, increase this -var oneEth = big.NewInt(1000000000000000000) var emptyList = []common.Address{} +func oneEth() *big.Int { return big.NewInt(1000000000000000000) } + // fluxAggregatorUniverse represents the universe with which the aggregator // contract interacts type fluxAggregatorUniverse struct { @@ -162,7 +163,7 @@ func setupFluxAggregatorUniverse(t *testing.T, configOptions ...func(cfg *fluxAg f.sergey.GasLimit = oldGasLimit - _, err = f.linkContract.Transfer(f.sergey, f.aggregatorContractAddress, oneEth) // Actually, LINK + _, err = f.linkContract.Transfer(f.sergey, f.aggregatorContractAddress, oneEth()) // Actually, LINK require.NoError(t, err, "failed to fund FluxAggregator contract with LINK") f.backend.Commit() @@ -174,7 +175,7 @@ func setupFluxAggregatorUniverse(t *testing.T, configOptions ...func(cfg *fluxAg require.NoError(t, err, "failed to retrieve AvailableFunds") require.Equal(t, availableFunds, oneEth) - ilogs, err := f.aggregatorContract.FilterAvailableFundsUpdated(nil, []*big.Int{oneEth}) + ilogs, err := f.aggregatorContract.FilterAvailableFundsUpdated(nil, []*big.Int{oneEth()}) require.NoError(t, err, "failed to gather AvailableFundsUpdated logs") logs := cltest.GetLogs(t, nil, ilogs)