diff --git a/execute/report/report_test.go b/execute/report/report_test.go index a35e4b87..8d25c3ad 100644 --- a/execute/report/report_test.go +++ b/execute/report/report_test.go @@ -2,6 +2,7 @@ package report import ( "context" + crand "crypto/rand" "fmt" "math/rand" "reflect" @@ -17,7 +18,6 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/chainlink-common/pkg/merklemulti" cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccipocr3" - "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils" "github.com/smartcontractkit/chainlink-ccip/execute/exectypes" "github.com/smartcontractkit/chainlink-ccip/execute/internal/gas" @@ -26,6 +26,12 @@ import ( "github.com/smartcontractkit/chainlink-ccip/internal/mocks" ) +func randomAddress() string { + b := make([]byte, 20) + _, _ = crand.Read(b) // Assignment for errcheck. Only used in tests so we can ignore. + return cciptypes.Bytes(b).String() +} + // mustMakeBytes parses a given string into a byte array, any error causes a panic. Pass in an empty string for a // random byte array. // nolint:unparam // surly this will be useful at some point... @@ -419,7 +425,7 @@ func Test_Builder_Build(t *testing.T) { codec := mocks.NewExecutePluginJSONReportCodec() lggr := logger.Test(t) tokenDataReader := tdr{mode: good} - sender, err := cciptypes.NewBytesFromString(utils.RandomAddress().String()) + sender, err := cciptypes.NewBytesFromString(randomAddress()) require.NoError(t, err) defaultNonces := map[cciptypes.ChainSelector]map[string]uint64{ 1: { @@ -431,7 +437,7 @@ func Test_Builder_Build(t *testing.T) { } tenSenders := make([]cciptypes.Bytes, 10) for i := range tenSenders { - tenSenders[i], err = cciptypes.NewBytesFromString(utils.RandomAddress().String()) + tenSenders[i], err = cciptypes.NewBytesFromString(randomAddress()) require.NoError(t, err) }