Skip to content

Commit

Permalink
Fix bogus import.
Browse files Browse the repository at this point in the history
  • Loading branch information
winder committed Aug 20, 2024
1 parent 2372882 commit 3dc9f2c
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions execute/report/report_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package report

import (
"context"
crand "crypto/rand"
"fmt"
"math/rand"
"reflect"
Expand All @@ -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"
Expand All @@ -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...
Expand Down Expand Up @@ -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: {
Expand All @@ -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)
}

Expand Down

0 comments on commit 3dc9f2c

Please sign in to comment.