From fbb63a09e7a1ef5cc34a2493915973ac0c99c8e8 Mon Sep 17 00:00:00 2001 From: amit-momin Date: Tue, 19 Sep 2023 14:04:45 -0500 Subject: [PATCH] Randomly generate idempotency key for fluxmonitor tests --- core/services/fluxmonitorv2/contract_submitter_test.go | 3 ++- core/services/fluxmonitorv2/orm_test.go | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/core/services/fluxmonitorv2/contract_submitter_test.go b/core/services/fluxmonitorv2/contract_submitter_test.go index 11fede3f692..7c282e3190c 100644 --- a/core/services/fluxmonitorv2/contract_submitter_test.go +++ b/core/services/fluxmonitorv2/contract_submitter_test.go @@ -4,6 +4,7 @@ import ( "math/big" "testing" + "github.com/google/uuid" "github.com/stretchr/testify/assert" "github.com/smartcontractkit/chainlink/v2/core/internal/mocks" @@ -33,7 +34,7 @@ func TestFluxAggregatorContractSubmitter_Submit(t *testing.T) { keyStore.On("GetRoundRobinAddress", testutils.FixtureChainID).Return(fromAddress, nil) fluxAggregator.On("Address").Return(toAddress) - idempotencyKey := "fluxmonitor-1" + idempotencyKey := uuid.New().String() orm.On("CreateEthTransaction", fromAddress, toAddress, payload, gasLimit, &idempotencyKey).Return(nil) err = submitter.Submit(roundID, submission, &idempotencyKey) diff --git a/core/services/fluxmonitorv2/orm_test.go b/core/services/fluxmonitorv2/orm_test.go index 0d44b36f169..a24f516c7f0 100644 --- a/core/services/fluxmonitorv2/orm_test.go +++ b/core/services/fluxmonitorv2/orm_test.go @@ -185,7 +185,7 @@ func TestORM_CreateEthTransaction(t *testing.T) { payload = []byte{1, 0, 0} gasLimit = uint32(21000) ) - idempotencyKey := "fluxmonitor-1" + idempotencyKey := uuid.New().String() txm.On("CreateTransaction", txmgr.TxRequest{ IdempotencyKey: &idempotencyKey, FromAddress: from,