Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

core/services/fluxmonitorv2: fix TestFluxMonitor_Deviation race #15344

Merged
merged 1 commit into from
Nov 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading