Skip to content

Commit

Permalink
core/services/fluxmonitorv2: fix TestFluxMonitor_Deviation race (#15344)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmank88 authored Nov 20, 2024
1 parent ac57f1a commit 226211a
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions core/services/fluxmonitorv2/integrations_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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()

Expand All @@ -172,9 +173,9 @@ func setupFluxAggregatorUniverse(t *testing.T, configOptions ...func(cfg *fluxAg
f.backend.Commit()
availableFunds, err := f.aggregatorContract.AvailableFunds(nil)
require.NoError(t, err, "failed to retrieve AvailableFunds")
require.Equal(t, availableFunds, oneEth)
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)
Expand Down

0 comments on commit 226211a

Please sign in to comment.