Skip to content

Commit

Permalink
Randomly generate idempotency key for fluxmonitor tests
Browse files Browse the repository at this point in the history
  • Loading branch information
amit-momin committed Sep 19, 2023
1 parent 7983e87 commit fbb63a0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion core/services/fluxmonitorv2/contract_submitter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion core/services/fluxmonitorv2/orm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit fbb63a0

Please sign in to comment.