diff --git a/core/services/ocr2/plugins/mercury/integration_test.go b/core/services/ocr2/plugins/mercury/integration_test.go index 16d992974c3..832a39237ee 100644 --- a/core/services/ocr2/plugins/mercury/integration_test.go +++ b/core/services/ocr2/plugins/mercury/integration_test.go @@ -126,7 +126,6 @@ func setupBlockchain(t *testing.T) (*bind.TransactOpts, *backends.SimulatedBacke } func TestIntegration_MercuryV1(t *testing.T) { - testutils.SkipFlakey(t, "https://smartcontract-it.atlassian.net/browse/MERC-5697") t.Parallel() integration_MercuryV1(t) @@ -228,8 +227,8 @@ func integration_MercuryV1(t *testing.T) { createBridge := func(name string, i int, p *big.Int, borm bridges.ORM) (bridgeName string) { bridge := httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) { - b, err := io.ReadAll(req.Body) - require.NoError(t, err) + b, herr := io.ReadAll(req.Body) + require.NoError(t, herr) require.Equal(t, `{"data":{"from":"ETH","to":"USD"}}`, string(b)) r := rand.Int63n(101) @@ -237,13 +236,13 @@ func integration_MercuryV1(t *testing.T) { res.WriteHeader(http.StatusOK) val := decimal.NewFromBigInt(p, 0).Div(decimal.NewFromInt(multiplier)).Add(decimal.NewFromInt(int64(i)).Div(decimal.NewFromInt(100))).String() resp := fmt.Sprintf(`{"result": %s}`, val) - _, err = res.Write([]byte(resp)) - require.NoError(t, err) + _, herr = res.Write([]byte(resp)) + require.NoError(t, herr) } else { res.WriteHeader(http.StatusInternalServerError) resp := `{"error": "pError test error"}` - _, err = res.Write([]byte(resp)) - require.NoError(t, err) + _, herr = res.Write([]byte(resp)) + require.NoError(t, herr) } })) t.Cleanup(bridge.Close) @@ -330,7 +329,7 @@ func integration_MercuryV1(t *testing.T) { "offchainConfig", offchainConfig, ) - _, err = verifier.SetConfig( + _, ferr := verifier.SetConfig( steve, feed.id, signerAddresses, @@ -341,7 +340,7 @@ func integration_MercuryV1(t *testing.T) { offchainConfig, nil, ) - require.NoError(t, err) + require.NoError(t, ferr) backend.Commit() } @@ -582,9 +581,8 @@ func integration_MercuryV2(t *testing.T) { createBridge := func(name string, i int, p *big.Int, borm bridges.ORM) (bridgeName string) { bridge := httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) { - var b []byte - b, err = io.ReadAll(req.Body) - require.NoError(t, err) + b, herr := io.ReadAll(req.Body) + require.NoError(t, herr) require.Equal(t, `{"data":{"from":"ETH","to":"USD"}}`, string(b)) r := rand.Int63n(101) @@ -592,13 +590,13 @@ func integration_MercuryV2(t *testing.T) { res.WriteHeader(http.StatusOK) val := decimal.NewFromBigInt(p, 0).Div(decimal.NewFromInt(multiplier)).Add(decimal.NewFromInt(int64(i)).Div(decimal.NewFromInt(100))).String() resp := fmt.Sprintf(`{"result": %s}`, val) - _, err = res.Write([]byte(resp)) - require.NoError(t, err) + _, herr = res.Write([]byte(resp)) + require.NoError(t, herr) } else { res.WriteHeader(http.StatusInternalServerError) resp := `{"error": "pError test error"}` - _, err = res.Write([]byte(resp)) - require.NoError(t, err) + _, herr = res.Write([]byte(resp)) + require.NoError(t, herr) } })) t.Cleanup(bridge.Close) @@ -670,7 +668,7 @@ func integration_MercuryV2(t *testing.T) { } for _, feed := range feeds { - _, err = verifier.SetConfig( + _, ferr := verifier.SetConfig( steve, feed.id, signerAddresses, @@ -681,7 +679,7 @@ func integration_MercuryV2(t *testing.T) { offchainConfig, nil, ) - require.NoError(t, err) + require.NoError(t, ferr) backend.Commit() } @@ -872,9 +870,8 @@ func integration_MercuryV3(t *testing.T) { createBridge := func(name string, i int, p *big.Int, borm bridges.ORM) (bridgeName string) { bridge := httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) { - var b []byte - b, err = io.ReadAll(req.Body) - require.NoError(t, err) + b, herr := io.ReadAll(req.Body) + require.NoError(t, herr) require.Equal(t, `{"data":{"from":"ETH","to":"USD"}}`, string(b)) r := rand.Int63n(101) @@ -882,13 +879,13 @@ func integration_MercuryV3(t *testing.T) { res.WriteHeader(http.StatusOK) val := decimal.NewFromBigInt(p, 0).Div(decimal.NewFromInt(multiplier)).Add(decimal.NewFromInt(int64(i)).Div(decimal.NewFromInt(100))).String() resp := fmt.Sprintf(`{"result": %s}`, val) - _, err = res.Write([]byte(resp)) - require.NoError(t, err) + _, herr = res.Write([]byte(resp)) + require.NoError(t, herr) } else { res.WriteHeader(http.StatusInternalServerError) resp := `{"error": "pError test error"}` - _, err = res.Write([]byte(resp)) - require.NoError(t, err) + _, herr = res.Write([]byte(resp)) + require.NoError(t, herr) } })) t.Cleanup(bridge.Close) @@ -963,7 +960,7 @@ func integration_MercuryV3(t *testing.T) { } for _, feed := range feeds { - _, err = verifier.SetConfig( + _, ferr := verifier.SetConfig( steve, feed.id, signerAddresses, @@ -974,7 +971,7 @@ func integration_MercuryV3(t *testing.T) { offchainConfig, nil, ) - require.NoError(t, err) + require.NoError(t, ferr) backend.Commit() }