diff --git a/_typos.toml b/_typos.toml index 65b99f85a9a..22462afdb8e 100644 --- a/_typos.toml +++ b/_typos.toml @@ -193,3 +193,5 @@ ot = "ot" ba = "ba" BA = "BA" unparseable = "unparseable" +# ExternalInitiators common var name +eis = "eis" diff --git a/core/scripts/go.mod b/core/scripts/go.mod index 28228f3505f..7400a8e072d 100644 --- a/core/scripts/go.mod +++ b/core/scripts/go.mod @@ -36,7 +36,7 @@ require ( github.com/pkg/errors v0.9.1 github.com/rs/zerolog v1.35.1 github.com/shopspring/decimal v1.4.0 - github.com/smartcontractkit/chain-selectors v1.0.109 + github.com/smartcontractkit/chain-selectors v1.0.111 github.com/smartcontractkit/chainlink-ccip/chains/evm v0.0.0-20260908164107-3de1349d970b github.com/smartcontractkit/chainlink-common v0.11.2-0.20260917115705-1d3a14a9b049 github.com/smartcontractkit/chainlink-common/keystore v1.3.1-0.20260903141829-ef07b52a737d @@ -513,7 +513,7 @@ require ( github.com/smartcontractkit/chainlink-ccip v0.1.1-solana.0.20260908155618-50f521d70e62 // indirect github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20260908155618-50f521d70e62 // indirect github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20260908155618-50f521d70e62 // indirect - github.com/smartcontractkit/chainlink-ccv v0.12.0 // indirect + github.com/smartcontractkit/chainlink-ccv v0.13.1-0.20260918171034-c93b0d2ef3c0 // indirect github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.11-0.20260915184316-2730f1867c92 // indirect github.com/smartcontractkit/chainlink-confidential-compute v1.3.0 // indirect github.com/smartcontractkit/chainlink-data-streams v1.1.1 // indirect @@ -528,7 +528,7 @@ require ( github.com/smartcontractkit/chainlink-protos/chainlink-ccv/message-discovery v0.0.0-20251211142334-5c3421fe2c8d // indirect github.com/smartcontractkit/chainlink-protos/chainlink-ccv/message-rules v0.0.0-20260505131349-78e491b80735 // indirect github.com/smartcontractkit/chainlink-protos/chainlink-ccv/verifier v0.0.0-20251211142334-5c3421fe2c8d // indirect - github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260804200254-c1accce563a8 // indirect + github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260916140808-f5d22b3cb3ee // indirect github.com/smartcontractkit/chainlink-protos/data-feeds v0.1.1-0.20260501174546-2e8846986b36 // indirect github.com/smartcontractkit/chainlink-protos/linking-service/go v0.0.0-20260512230622-65f10f4cd305 // indirect github.com/smartcontractkit/chainlink-protos/metering/go v0.0.0-20260729184203-90b4cdd48536 // indirect diff --git a/core/scripts/go.sum b/core/scripts/go.sum index b63f7ea0d9f..06b616403c0 100644 --- a/core/scripts/go.sum +++ b/core/scripts/go.sum @@ -1665,8 +1665,8 @@ github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966 h1:JIAuq3EE github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966/go.mod h1:sUM3LWHvSMaG192sy56D9F7CNvL7jUJVXoqM1QKLnog= github.com/smartcontractkit/ccip-owner-contracts v0.2.1 h1:HgrVtzpyqrPCQiyIeoUKcPK/S+TQI76F3CNU6/hH+6s= github.com/smartcontractkit/ccip-owner-contracts v0.2.1/go.mod h1:dpKtlTVEKohsbhnPe/r1oLFqfq7TP7iKvMaUOiidAaM= -github.com/smartcontractkit/chain-selectors v1.0.109 h1:nM4bESP4OpJSdoHPSwS2+OyG+ef8pow3FAaYK6WXF6g= -github.com/smartcontractkit/chain-selectors v1.0.109/go.mod h1:qy7whtgG5g+7z0jt0nRyii9bLND9m15NZTzuQPkMZ5w= +github.com/smartcontractkit/chain-selectors v1.0.111 h1:urb/qOyRanxDn+Wras+LULHEHSlJ4tYnfeAHzeMBn5U= +github.com/smartcontractkit/chain-selectors v1.0.111/go.mod h1:qy7whtgG5g+7z0jt0nRyii9bLND9m15NZTzuQPkMZ5w= github.com/smartcontractkit/chainlink-aptos v0.0.0-20260828090428-9828cc37ebc2 h1:gIlepiEA6cYoYtIYHV0dsGwrarU5LlXhIZ+AhhPFtRY= github.com/smartcontractkit/chainlink-aptos v0.0.0-20260828090428-9828cc37ebc2/go.mod h1:zxbSVfmTCjxN2LdXeOhZS8T5wh6TVDGC40iliRsF62o= github.com/smartcontractkit/chainlink-aptos/codec v0.0.0-20260716230027-bd85997bc03c h1:aDS7I+SK9mWkDcWlfP5JrDY4NnicC/4KVm30dG7HQaw= @@ -1681,8 +1681,8 @@ github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20260908155618-5 github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20260908155618-50f521d70e62/go.mod h1:5snE6Mg2+wYIddLZ5NIUPno3mYa9edyV3EyXJnE54vw= github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20260908155618-50f521d70e62 h1:psQpY4BeoAH50S7QTX5fUhUYeYnM88jldPXRPXpXuvU= github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20260908155618-50f521d70e62/go.mod h1:c++Ed0jeYn4w8WIfiAboRwN6ClRRVGglL0qwB/QjJvM= -github.com/smartcontractkit/chainlink-ccv v0.12.0 h1:/EbL7S96ItC3YF9pZ/fihbxugYxT1xxLSQSFJT4JQoQ= -github.com/smartcontractkit/chainlink-ccv v0.12.0/go.mod h1:yijeTgli1K0e1noV/06/etKFxnYz8kBIe3IVXBaGnQw= +github.com/smartcontractkit/chainlink-ccv v0.13.1-0.20260918171034-c93b0d2ef3c0 h1:3f+Ijgr0vghawMUAitgFILQpt4KsoYHGv1Zb/YBeeQM= +github.com/smartcontractkit/chainlink-ccv v0.13.1-0.20260918171034-c93b0d2ef3c0/go.mod h1:gX7FJzSnGQx4RAlsn2rRW8IQBlEFZYiXFXEEB5jnQgA= github.com/smartcontractkit/chainlink-common v0.11.2-0.20260917115705-1d3a14a9b049 h1:WebE9HTubitMC5xq+xCAArEI+oBLekVOoxYnCkB8whI= github.com/smartcontractkit/chainlink-common v0.11.2-0.20260917115705-1d3a14a9b049/go.mod h1:3CaCxSyZmgWl1PhxneFSZqOfN7DF2VnHML0bTfiDNIo= github.com/smartcontractkit/chainlink-common/keystore v1.3.1-0.20260903141829-ef07b52a737d h1:M9xuiIvdiHtim4nlxCVajyC/Mk63tAg9ESWb/biAhNA= @@ -1721,8 +1721,8 @@ github.com/smartcontractkit/chainlink-protos/chainlink-ccv/message-rules v0.0.0- github.com/smartcontractkit/chainlink-protos/chainlink-ccv/message-rules v0.0.0-20260505131349-78e491b80735/go.mod h1:zAJq6Tpkx5AdFUwW67dIYnW+Bdf50drCCpMR81Qxb4E= github.com/smartcontractkit/chainlink-protos/chainlink-ccv/verifier v0.0.0-20251211142334-5c3421fe2c8d h1:AJy55QJ/pBhXkZjc7N+ATnWfxrcjq9BI9DmdtdjwDUQ= github.com/smartcontractkit/chainlink-protos/chainlink-ccv/verifier v0.0.0-20251211142334-5c3421fe2c8d/go.mod h1:5JdppgngCOUS76p61zCinSCgOhPeYQ+OcDUuome5THQ= -github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260804200254-c1accce563a8 h1:PuLjldCKeHUZf9JJzsX8aKEzqIJOpoY3wPeuGfm47C8= -github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260804200254-c1accce563a8/go.mod h1:/i8hjTPFdVWHiY+QjeSiVS2Z3GB3WAZznGgXHstC02E= +github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260916140808-f5d22b3cb3ee h1:drewC9gPerS+FDeaaSfG7YL1Zzt/0Jr6YQ1YvHXzz04= +github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260916140808-f5d22b3cb3ee/go.mod h1:/i8hjTPFdVWHiY+QjeSiVS2Z3GB3WAZznGgXHstC02E= github.com/smartcontractkit/chainlink-protos/data-feeds v0.1.1-0.20260501174546-2e8846986b36 h1:SG+wAsNyAcA6Kk19ljuxi3HK9Ll2lpHik8OKoY4x7A0= github.com/smartcontractkit/chainlink-protos/data-feeds v0.1.1-0.20260501174546-2e8846986b36/go.mod h1:vL1bDgPSJjV0EqHYs4dDlR+EEE0cJchgvGLYXhwIjXY= github.com/smartcontractkit/chainlink-protos/job-distributor v0.20.1-0.20260701185448-696c075849ea h1:gdA7tZgcRYMq3ryi7uNopYgn6s26g04Haw9SdmLRHzE= diff --git a/core/utils/abihelpers/abi_helpers_test.go b/core/utils/abihelpers/abi_helpers_test.go index 6b946a69bce..fc3b271ab6c 100644 --- a/core/utils/abihelpers/abi_helpers_test.go +++ b/core/utils/abihelpers/abi_helpers_test.go @@ -9,6 +9,7 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" ) func TestProofFlagToBits(t *testing.T) { @@ -79,14 +80,14 @@ func TestABIEncodeDecode(t *testing.T) { }{big.NewInt(10), big.NewInt(12)}} encoded, err := ABIEncode(abiStr, values...) - assert.NoError(t, err) + require.NoError(t, err) assert.NotNil(t, encoded) encodedAgain, err := ABIEncode(abiStr, values...) - assert.NoError(t, err) + require.NoError(t, err) assert.True(t, bytes.Equal(encoded, encodedAgain)) decoded, err := ABIDecode(abiStr, encoded) - assert.NoError(t, err) + require.NoError(t, err) assert.Equal(t, decoded, values) } diff --git a/core/utils/backoff_ticker.go b/core/utils/backoff_ticker.go index 4a25f856315..197cef9cc97 100644 --- a/core/utils/backoff_ticker.go +++ b/core/utils/backoff_ticker.go @@ -9,13 +9,13 @@ import ( type timerFactory func(d time.Duration) *time.Timer -func newBackoffTicker(tf timerFactory, min, max time.Duration) BackoffTicker { +func newBackoffTicker(tf timerFactory, minDuration, maxDuration time.Duration) BackoffTicker { c := make(chan time.Time, 1) return BackoffTicker{ createTimer: tf, b: backoff.Backoff{ - Min: min, - Max: max, + Min: minDuration, + Max: maxDuration, }, C: c, chStop: make(chan struct{}), @@ -34,8 +34,8 @@ type BackoffTicker struct { } // NewBackoffTicker returns a new BackoffTicker for the given range. -func NewBackoffTicker(min, max time.Duration) BackoffTicker { - return newBackoffTicker(time.NewTimer, min, max) +func NewBackoffTicker(minDuration, maxDuration time.Duration) BackoffTicker { + return newBackoffTicker(time.NewTimer, minDuration, maxDuration) } // Start - Starts the ticker diff --git a/core/utils/backoff_ticker_test.go b/core/utils/backoff_ticker_test.go index e70d38935bb..7fccc8c41c1 100644 --- a/core/utils/backoff_ticker_test.go +++ b/core/utils/backoff_ticker_test.go @@ -12,9 +12,9 @@ func TestBackoffTicker_Bounds(t *testing.T) { t.Parallel() bt := NewBackoffTicker(1*time.Millisecond, 2*time.Second) - min, max := bt.Bounds() - assert.Equal(t, 1*time.Millisecond, min) - assert.Equal(t, 2*time.Second, max) + minVal, maxVal := bt.Bounds() + assert.Equal(t, 1*time.Millisecond, minVal) + assert.Equal(t, 2*time.Second, maxVal) } func TestBackoffTicker_StartTwice(t *testing.T) { @@ -51,20 +51,20 @@ func TestBackoffTicker_NoTicksAfterStop(t *testing.T) { t.Parallel() - min := 100 * time.Millisecond - max := 5 * time.Second + minVal := 100 * time.Millisecond + maxVal := 5 * time.Second chTime := make(chan time.Time, 1) defer close(chTime) newFakeTimer := func(d time.Duration) *time.Timer { - assert.Equal(t, min, d) - realTimer := time.NewTimer(max) + assert.Equal(t, minVal, d) + realTimer := time.NewTimer(maxVal) realTimer.C = chTime return realTimer } - bt := newBackoffTicker(newFakeTimer, min, max) + bt := newBackoffTicker(newFakeTimer, minVal, maxVal) ok := bt.Start() assert.True(t, ok) @@ -75,7 +75,7 @@ func TestBackoffTicker_NoTicksAfterStop(t *testing.T) { chTime <- time.Now() select { - case <-time.After(2 * min): + case <-time.After(2 * minVal): case <-bt.Ticks(): assert.FailNow(t, "received a tick after Stop()") } @@ -88,20 +88,20 @@ func TestBackoffTicker_Ticks(t *testing.T) { t.Parallel() - min := 100 * time.Millisecond - max := 5 * time.Second + minVal := 100 * time.Millisecond + maxVal := 5 * time.Second chTime := make(chan time.Time) defer close(chTime) newFakeTimer := func(d time.Duration) *time.Timer { - assert.Equal(t, min, d) - realTimer := time.NewTimer(max) + assert.Equal(t, minVal, d) + realTimer := time.NewTimer(maxVal) realTimer.C = chTime return realTimer } - bt := newBackoffTicker(newFakeTimer, min, max) + bt := newBackoffTicker(newFakeTimer, minVal, maxVal) ok := bt.Start() assert.True(t, ok) @@ -124,7 +124,7 @@ func TestBackoffTicker_Ticks(t *testing.T) { } select { - case <-time.After(2 * min): + case <-time.After(2 * minVal): case <-bt.Ticks(): assert.FailNow(t, "received an unexpected tick") } @@ -133,18 +133,18 @@ func TestBackoffTicker_Ticks(t *testing.T) { func TestBackoffTicker_Restart(t *testing.T) { t.Parallel() - min := 1 * time.Second - max := 10 * time.Second + minVal := 1 * time.Second + maxVal := 10 * time.Second var newTimerCount atomic.Int32 newFakeTimer := func(d time.Duration) *time.Timer { newTimerCount.Add(1) - assert.Equal(t, min, d) - return time.NewTimer(max) + assert.Equal(t, minVal, d) + return time.NewTimer(maxVal) } - bt := newBackoffTicker(newFakeTimer, min, max) + bt := newBackoffTicker(newFakeTimer, minVal, maxVal) ok := bt.Start() assert.True(t, ok) @@ -158,5 +158,5 @@ func TestBackoffTicker_Restart(t *testing.T) { assert.Eventually(t, func() bool { return newTimerCount.Load() == 2 - }, min, min/100, "expected timer factory to be triggered twice") + }, minVal, minVal/100, "expected timer factory to be triggered twice") } diff --git a/core/utils/collection.go b/core/utils/collection.go index ec8e9f48c2f..ccd77fdbc49 100644 --- a/core/utils/collection.go +++ b/core/utils/collection.go @@ -3,16 +3,16 @@ package utils import "errors" // BatchSplit splits an slices into an slices of slicess with a maximum length -func BatchSplit[T any](list []T, max int) (out [][]T, err error) { - if max == 0 { +func BatchSplit[T any](list []T, maxLen int) (out [][]T, err error) { + if maxLen == 0 { return out, errors.New("max batch length cannot be 0") } // batch list into no more than max each - for len(list) > max { + for len(list) > maxLen { // assign to list: remaining after taking slice from beginning // append to out: max length slice from beginning of list - list, out = list[max:], append(out, list[:max]) + list, out = list[maxLen:], append(out, list[:maxLen]) } out = append(out, list) // append remaining to list (slice len < max) return out, nil diff --git a/core/utils/collection_test.go b/core/utils/collection_test.go index 3866fa78cbe..18f045f25ec 100644 --- a/core/utils/collection_test.go +++ b/core/utils/collection_test.go @@ -4,10 +4,11 @@ import ( "testing" "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" ) func TestBatchSplit(t *testing.T) { - list := []int{} + list := make([]int, 0, 100) for i := range 100 { list = append(list, i) } @@ -38,7 +39,7 @@ func TestBatchSplit(t *testing.T) { return } - assert.NoError(t, err) + require.NoError(t, err) assert.Len(t, batch, r.num) // check number of batches temp := []int{} diff --git a/core/utils/config/validate.go b/core/utils/config/validate.go index fe776de44e1..da3fa57d742 100644 --- a/core/utils/config/validate.go +++ b/core/utils/config/validate.go @@ -8,37 +8,52 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/config" ) -type ErrInvalid = config.ErrInvalid +type InvalidError = config.ErrInvalid -// NewErrDuplicate returns an ErrInvalid with a standard duplicate message. -func NewErrDuplicate(name string, value any) ErrInvalid { +// NewErrDuplicate returns an InvalidError with a standard duplicate message. +func NewErrDuplicate(name string, value any) InvalidError { return config.NewErrDuplicate(name, value) } -type ErrMissing = config.ErrMissing +type MissingError = config.ErrMissing -type ErrEmpty = config.ErrEmpty +type EmptyError = config.ErrEmpty // UniqueStrings is a helper for tracking unique values in string form. type UniqueStrings = config.UniqueStrings -type ErrOverride struct { +type OverrideError struct { Name string } -func (e ErrOverride) Error() string { +func (e OverrideError) Error() string { return e.Name + ": overrides (duplicate keys or list elements) are not allowed for multiple secrets files" } -type ErrDeprecated struct { +type DeprecatedError struct { Name string Version semver.Version } -func (e ErrDeprecated) Error() string { +func (e DeprecatedError) Error() string { when := "a future version" if e.Version != (semver.Version{}) { when = fmt.Sprintf("version %s", e.Version) } return fmt.Sprintf("%s: is deprecated and will be removed in %s", e.Name, when) } + +// Deprecated: use InvalidError instead. +type ErrInvalid = InvalidError //nolint:errname // backward compatibility + +// Deprecated: use MissingError instead. +type ErrMissing = MissingError //nolint:errname // backward compatibility + +// Deprecated: use EmptyError instead. +type ErrEmpty = EmptyError //nolint:errname // backward compatibility + +// Deprecated: use OverrideError instead. +type ErrOverride = OverrideError //nolint:errname // backward compatibility + +// Deprecated: use DeprecatedError instead. +type ErrDeprecated = DeprecatedError //nolint:errname // backward compatibility diff --git a/core/utils/crypto/private_key_test.go b/core/utils/crypto/private_key_test.go index 6a42b7abd6b..4379f5fc22c 100644 --- a/core/utils/crypto/private_key_test.go +++ b/core/utils/crypto/private_key_test.go @@ -58,7 +58,7 @@ func Test_EncryptedPrivateKey_Scan(t *testing.T) { // Error if not bytes err = actual.Scan("not bytes") - assert.Error(t, err) + require.Error(t, err) // Bytes err = actual.Scan(b) diff --git a/core/utils/crypto/public_key_test.go b/core/utils/crypto/public_key_test.go index 680ef48a3d3..0813e3d6595 100644 --- a/core/utils/crypto/public_key_test.go +++ b/core/utils/crypto/public_key_test.go @@ -58,7 +58,7 @@ func Test_PublicKey_Scan(t *testing.T) { // Error if not bytes err = actual.Scan("not bytes") - assert.Error(t, err) + require.Error(t, err) // Nil err = actual.Scan(nil) diff --git a/core/utils/deferable_write_closer_test.go b/core/utils/deferable_write_closer_test.go index 18d08bd80c2..86791fca09e 100644 --- a/core/utils/deferable_write_closer_test.go +++ b/core/utils/deferable_write_closer_test.go @@ -18,23 +18,23 @@ func TestDeferableWriteCloser_Close(t *testing.T) { wc := NewDeferableWriteCloser(f) wantStr := "wanted" _, err = io.WriteString(wc, wantStr) - assert.NoError(t, err) + require.NoError(t, err) defer func() { assert.NoError(t, wc.Close()) }() - assert.NoError(t, wc.Close()) + require.NoError(t, wc.Close()) assert.True(t, wc.closed) // safe to close multiple times - assert.NoError(t, wc.Close()) + require.NoError(t, wc.Close()) _, err = io.WriteString(f, "after close") - assert.ErrorIs(t, err, os.ErrClosed) + require.ErrorIs(t, err, os.ErrClosed) _, err = io.WriteString(f, "write to wc after close") - assert.ErrorIs(t, err, os.ErrClosed) + require.ErrorIs(t, err, os.ErrClosed) r, err := os.ReadFile(f.Name()) - assert.NoError(t, err) + require.NoError(t, err) assert.Equal(t, wantStr, string(r)) } diff --git a/core/utils/eth_signatures_test.go b/core/utils/eth_signatures_test.go index 85b94500d68..8ad01a3af3b 100644 --- a/core/utils/eth_signatures_test.go +++ b/core/utils/eth_signatures_test.go @@ -15,10 +15,10 @@ func TestGetSignersEthAddress_Success(t *testing.T) { msg := []byte("test message") sig, err := GenerateEthSignature(privateKey, msg) - assert.NoError(t, err) + require.NoError(t, err) recoveredAddress, err := GetSignersEthAddress(msg, sig) - assert.NoError(t, err) + require.NoError(t, err) assert.Equal(t, address, recoveredAddress) } @@ -40,14 +40,14 @@ func TestGenerateEthPrefixedMsgHash(t *testing.T) { func TestGenerateEthSignature(t *testing.T) { privateKey, err := crypto.GenerateKey() - assert.NoError(t, err) + require.NoError(t, err) msg := []byte("test message") signature, err := GenerateEthSignature(privateKey, msg) - assert.NoError(t, err) + require.NoError(t, err) assert.Len(t, signature, 65) recoveredPub, err := crypto.SigToPub(GenerateEthPrefixedMsgHash(msg).Bytes(), signature) - assert.NoError(t, err) + require.NoError(t, err) assert.Equal(t, privateKey.PublicKey, *recoveredPub) } diff --git a/core/utils/files.go b/core/utils/files.go index b30dd51c5fd..192b6887497 100644 --- a/core/utils/files.go +++ b/core/utils/files.go @@ -13,6 +13,7 @@ import ( // FileExists returns true if a file at the passed string exists. func FileExists(name string) (bool, error) { + //nolint:gosec // path is caller-provided, not untrusted user input if _, err := os.Stat(name); err != nil { if os.IsNotExist(err) { return false, nil @@ -35,16 +36,17 @@ func TooPermissive(fileMode, maxAllowedPerms os.FileMode) bool { // - If the path exists, and is a directory, but has the wrong perms, it is chmod'ed func EnsureDirAndMaxPerms(path string, perms os.FileMode) error { stat, err := os.Stat(path) - if err != nil && !os.IsNotExist(err) { + switch { + case err != nil && !os.IsNotExist(err): // Regular error return err - } else if os.IsNotExist(err) { + case os.IsNotExist(err): // Dir doesn't exist, create it with desired perms return os.MkdirAll(path, perms) - } else if !stat.IsDir() { + case !stat.IsDir(): // Path exists, but it's a file, so don't clobber return errors.Errorf("%v already exists and is not a directory", path) - } else if stat.Mode() != perms { + case stat.Mode() != perms: // Dir exists, but wrong perms, so chmod return os.Chmod(path, stat.Mode()&perms) } @@ -116,13 +118,14 @@ var ( // MarshalText encodes s as a human readable string. func (s FileSize) MarshalText() ([]byte, error) { - if s >= TB { + switch { + case s >= TB: return fmt.Appendf(nil, "%.2ftb", float64(s)/TB), nil - } else if s >= GB { + case s >= GB: return fmt.Appendf(nil, "%.2fgb", float64(s)/GB), nil - } else if s >= MB { + case s >= MB: return fmt.Appendf(nil, "%.2fmb", float64(s)/MB), nil - } else if s >= KB { + case s >= KB: return fmt.Appendf(nil, "%.2fkb", float64(s)/KB), nil } return fmt.Appendf(nil, "%db", s), nil diff --git a/core/utils/files_test.go b/core/utils/files_test.go index f7df0c454c0..cb6ee6eceb4 100644 --- a/core/utils/files_test.go +++ b/core/utils/files_test.go @@ -68,7 +68,7 @@ func TestFileSize_MarshalText_String(t *testing.T) { t.Parallel() bstr, err := test.input.MarshalText() - assert.NoError(t, err) + require.NoError(t, err) assert.Equal(t, test.expected, string(bstr)) assert.Equal(t, test.expected, test.input.String()) }) @@ -117,7 +117,7 @@ func TestFileSize_UnmarshalText(t *testing.T) { var fs FileSize err := fs.UnmarshalText([]byte(test.input)) if test.valid { - assert.NoError(t, err) + require.NoError(t, err) assert.Equal(t, test.expected, fs) } else { assert.Error(t, err) diff --git a/core/utils/jwt.go b/core/utils/jwt.go index 094518bb952..14007276e0a 100644 --- a/core/utils/jwt.go +++ b/core/utils/jwt.go @@ -92,9 +92,9 @@ func (m *SigningMethodEth) Alg() string { return "ETH" } -// Sign signs the given signing string using the given key -// key is expected to be an *ecdsa.PrivateKey -// returns the signature as a 65-byte array (r, s, v) with v being 0 or 1 +// Sign signs the given signing string using the given key. +// The key is expected to be an *ecdsa.PrivateKey. +// Returns the signature as a 65-byte array (r, s, v) with v being 0 or 1. func (m *SigningMethodEth) Sign(signingString string, key any) ([]byte, error) { var ecdsaKey *ecdsa.PrivateKey switch k := key.(type) { @@ -110,8 +110,8 @@ func (m *SigningMethodEth) Sign(signingString string, key any) ([]byte, error) { return signature, nil } -// Verify verifies the given signature for the given signing string using the given public key -// key is expected to be a gethcommon.Address +// Verify verifies the given signature for the given signing string using the given public key. +// The key is expected to be a gethcommon.Address. func (m *SigningMethodEth) Verify(signingString string, signature []byte, key any) error { var ethAddr gethcommon.Address switch k := key.(type) { diff --git a/core/utils/password_test.go b/core/utils/password_test.go index 79fbe28cfb3..8eb730ee3b1 100644 --- a/core/utils/password_test.go +++ b/core/utils/password_test.go @@ -6,6 +6,7 @@ import ( "github.com/pkg/errors" "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" "github.com/smartcontractkit/chainlink/v2/core/utils" ) @@ -40,7 +41,7 @@ func TestVerifyPasswordComplexity(t *testing.T) { if len(test.errors) == 0 { assert.NoError(t, err) } else { - assert.Error(t, err) + require.Error(t, err) assert.ErrorContains(t, err, utils.ErrMsgHeader) for _, subErr := range test.errors { assert.ErrorContains(t, err, subErr.Error()) @@ -67,17 +68,17 @@ func TestPasswordFromFile(t *testing.T) { t.Parallel() pwdFile, err := os.CreateTemp(t.TempDir(), "") - assert.NoError(t, err) + require.NoError(t, err) defer os.Remove(pwdFile.Name()) _, err = pwdFile.WriteString(test.password) - assert.NoError(t, err) + require.NoError(t, err) pwd, err := utils.PasswordFromFile(pwdFile.Name()) if test.err != nil { - assert.Error(t, err) + require.Error(t, err) assert.ErrorContains(t, err, test.err.Error()) } else { - assert.NoError(t, err) + require.NoError(t, err) assert.Equal(t, pwd, test.password) } }) diff --git a/core/utils/tomlutils/toml_test.go b/core/utils/tomlutils/toml_test.go index b640eee73eb..4c5dac696bd 100644 --- a/core/utils/tomlutils/toml_test.go +++ b/core/utils/tomlutils/toml_test.go @@ -4,6 +4,7 @@ import ( "testing" "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" ) func TestUtils_TomlFloat32_Success_Decimal(t *testing.T) { @@ -13,8 +14,8 @@ func TestUtils_TomlFloat32_Success_Decimal(t *testing.T) { err := tomlF32.UnmarshalText([]byte("0.23")) - assert.NoError(t, err) - assert.Equal(t, tomlF32, Float32(0.23)) + require.NoError(t, err) + assert.InEpsilon(t, float32(0.23), float32(tomlF32), 1e-9) } func TestUtils_TomlFloat32_Success_Integer(t *testing.T) { @@ -24,8 +25,8 @@ func TestUtils_TomlFloat32_Success_Integer(t *testing.T) { err := tomlF32.UnmarshalText([]byte("13")) - assert.NoError(t, err) - assert.Equal(t, tomlF32, Float32(13)) + require.NoError(t, err) + assert.InEpsilon(t, float32(13), float32(tomlF32), 1e-9) } func TestUtils_TomlFloat32_Failure(t *testing.T) { @@ -45,8 +46,8 @@ func TestUtils_TomlFloat64_Success_Decimal(t *testing.T) { err := tomlF64.UnmarshalText([]byte("2.82")) - assert.NoError(t, err) - assert.Equal(t, tomlF64, Float64(2.82)) + require.NoError(t, err) + assert.InEpsilon(t, float64(2.82), float64(tomlF64), 1e-9) } func TestUtils_TomlFloat64_Success_Integer(t *testing.T) { @@ -56,8 +57,8 @@ func TestUtils_TomlFloat64_Success_Integer(t *testing.T) { err := tomlF64.UnmarshalText([]byte("3")) - assert.NoError(t, err) - assert.Equal(t, tomlF64, Float64(3)) + require.NoError(t, err) + assert.InEpsilon(t, float64(3), float64(tomlF64), 1e-9) } func TestUtils_TomlFloat64_Failure(t *testing.T) { diff --git a/core/utils/utils.go b/core/utils/utils.go index fdc88b8b1ee..d9d03a6ac68 100644 --- a/core/utils/utils.go +++ b/core/utils/utils.go @@ -54,6 +54,7 @@ func ISO8601UTC(t time.Time) string { // DurationFromNow returns the amount of time since the Time // field was last updated. +// // Deprecated: Use [time.Until]. func DurationFromNow(t time.Time) time.Duration { return time.Until(t) @@ -145,18 +146,21 @@ func Sha256(in string) (string, error) { } // WithCloseChan wraps a context so that it is canceled if the passed in channel is closed. +// // Deprecated: Call [services.StopChan.Ctx] directly func WithCloseChan(parentCtx context.Context, chStop chan struct{}) (context.Context, context.CancelFunc) { return services.StopChan(chStop).Ctx(parentCtx) } // ContextFromChan creates a context that finishes when the provided channel receives or is closed. +// // Deprecated: Call [services.StopChan.NewCtx] directly. func ContextFromChan(chStop chan struct{}) (context.Context, context.CancelFunc) { return services.StopChan(chStop).NewCtx() } // ContextFromChanWithTimeout creates a context with a timeout that finishes when the provided channel receives or is closed. +// // Deprecated: Call [services.StopChan.CtxCancel] directly func ContextFromChanWithTimeout(chStop chan struct{}, timeout time.Duration) (context.Context, context.CancelFunc) { return services.StopChan(chStop).CtxWithTimeout(timeout) @@ -231,7 +235,7 @@ type BoundedPriorityQueue[T any] struct { // NewBoundedPriorityQueue creates a new BoundedPriorityQueue func NewBoundedPriorityQueue[T any](capacities map[uint]int) *BoundedPriorityQueue[T] { queues := make(map[uint]*BoundedQueue[T]) - var priorities []uint + priorities := make([]uint, 0, len(capacities)) for priority, capacity := range capacities { priorities = append(priorities, priority) queues[priority] = NewBoundedQueue[T](capacity) @@ -452,6 +456,7 @@ func (t *ResettableTimer) Reset(duration time.Duration) { } // StartStopOnce contains a StartStopOnceState integer +// // Deprecated: use services.StateMachine type StartStopOnce = services.StateMachine @@ -462,10 +467,10 @@ func WithJitter(d time.Duration) time.Duration { return 0 } // ensure non-zero arg to Intn to avoid panic - max := math.Max(float64(d.Abs())/5.0, 1.) + maxVal := math.Max(float64(d.Abs())/5.0, 1.) // #nosec - non critical randomness - jitter := mrand.Intn(int(max)) - jitter = jitter - (jitter / 2) + jitter := mrand.Intn(int(maxVal)) + jitter -= (jitter / 2) return time.Duration(int(d) + jitter) } @@ -523,13 +528,13 @@ func (eb *ErrorBuffer) Append(incoming error) { eb.buffer = append(eb.buffer, incoming) } -func (eb *ErrorBuffer) SetCap(cap int) { +func (eb *ErrorBuffer) SetCap(capacity int) { eb.mu.Lock() defer eb.mu.Unlock() - if len(eb.buffer) > cap { - eb.buffer = eb.buffer[len(eb.buffer)-cap:] + if len(eb.buffer) > capacity { + eb.buffer = eb.buffer[len(eb.buffer)-capacity:] } - eb.cap = cap + eb.cap = capacity } // UnwrapError returns a list of underlying errors if passed error implements joinedError or return the err in a single-element list otherwise. diff --git a/core/utils/utils_test.go b/core/utils/utils_test.go index ed5e1ed2f30..55397143c25 100644 --- a/core/utils/utils_test.go +++ b/core/utils/utils_test.go @@ -190,7 +190,7 @@ func TestHashPassword(t *testing.T) { t.Parallel() h, err := utils.HashPassword("Qwerty123!") - assert.NoError(t, err) + require.NoError(t, err) assert.NotEmpty(t, h) ok := utils.CheckPasswordHash("Qwerty123!", h) @@ -213,7 +213,7 @@ func TestFormatJSON(t *testing.T) { json := `{"foo":123}` formatted, err := utils.FormatJSON(json) - assert.NoError(t, err) + require.NoError(t, err) assert.Equal(t, "\"{\\\"foo\\\":123}\"", string(formatted)) } @@ -239,10 +239,10 @@ func TestSha256(t *testing.T) { t.Parallel() hexHash, err := utils.Sha256("test") - assert.NoError(t, err) + require.NoError(t, err) hash, err := hex.DecodeString(hexHash) - assert.NoError(t, err) + require.NoError(t, err) assert.Len(t, hash, 32) } @@ -368,13 +368,13 @@ func TestValidateCronSchedule(t *testing.T) { t.Parallel() err := utils.ValidateCronSchedule("") - assert.Error(t, err) + require.Error(t, err) err = utils.ValidateCronSchedule("CRON_TZ=UTC 5 * * * *") - assert.NoError(t, err) + require.NoError(t, err) err = utils.ValidateCronSchedule("@every 1h30m") - assert.NoError(t, err) + require.NoError(t, err) err = utils.ValidateCronSchedule("@every xyz") assert.Error(t, err) @@ -440,7 +440,7 @@ func TestCronTicker(t *testing.T) { var counter atomic.Int32 ct, err := utils.NewCronTicker("@every 100ms") - assert.NoError(t, err) + require.NoError(t, err) awaiter := cltest.NewAwaiter() done := make(chan struct{}) diff --git a/core/web/api_test.go b/core/web/api_test.go index f12d9f69c71..c04bc6f7ed0 100644 --- a/core/web/api_test.go +++ b/core/web/api_test.go @@ -73,32 +73,38 @@ func TestApi_NewPaginatedResponse(t *testing.T) { }{ { "a single resource", - "/v2/index", 1, 0, 0, TestResource{Title: "Item"}, + "/v2/index", 1, 0, 0, + TestResource{Title: "Item"}, false, `{"data":{"type":"testResources","id":"1","attributes":{"Title":"Item"}},"meta":{"count":0}}`, }, { "a resource collection", - "/v2/index", 1, 0, 0, []TestResource{{Title: "Item 1"}, {Title: "Item 2"}}, + "/v2/index", 1, 0, 0, + []TestResource{{Title: "Item 1"}, {Title: "Item 2"}}, false, `{"data":[{"type":"testResources","id":"1","attributes":{"Title":"Item 1"}},{"type":"testResources","id":"1","attributes":{"Title":"Item 2"}}],"meta":{"count":0}}`, }, { "first page of collection results", - "/v2/index", 5, 1, 7, []TestResource{{Title: "Item 1"}}, + "/v2/index", 5, 1, 7, + []TestResource{{Title: "Item 1"}}, false, `{"links":{"next":"/v2/index?page=2\u0026size=5"},"data":[{"type":"testResources","id":"1","attributes":{"Title":"Item 1"}}],"meta":{"count":7}}`, }, { "middle page of collection results", - "/v2/index", 5, 2, 13, []TestResource{{Title: "Item 2"}}, + "/v2/index", 5, 2, 13, + []TestResource{{Title: "Item 2"}}, false, `{"links":{"next":"/v2/index?page=3\u0026size=5","prev":"/v2/index?page=1\u0026size=5"},"data":[{"type":"testResources","id":"1","attributes":{"Title":"Item 2"}}],"meta":{"count":13}}`, }, { "end page of collection results", - "/v2/index", 5, 3, 13, []TestResource{{Title: "Item 3"}}, + "/v2/index", 5, 3, 13, + []TestResource{{Title: "Item 3"}}, false, `{"links":{"prev":"/v2/index?page=2\u0026size=5"},"data":[{"type":"testResources","id":"1","attributes":{"Title":"Item 3"}}],"meta":{"count":13}}`, }, { "path with existing query", - "/v2/index?authToken=3123", 1, 0, 2, []TestResource{{Title: "Item 1"}}, + "/v2/index?authToken=3123", 1, 0, 2, + []TestResource{{Title: "Item 1"}}, false, `{"links":{"next":"/v2/index?authToken=3123\u0026page=1\u0026size=1"},"data":[{"type":"testResources","id":"1","attributes":{"Title":"Item 1"}}],"meta":{"count":2}}`, }, { diff --git a/core/web/auth/auth_test.go b/core/web/auth/auth_test.go index ccc574a92aa..d28cd47f4da 100644 --- a/core/web/auth/auth_test.go +++ b/core/web/auth/auth_test.go @@ -33,18 +33,30 @@ func authSuccess(*gin.Context, webauth.Authenticator) error { return nil } -type stubAuthProvider struct { +type userFindFailure struct { + sessions.AuthenticationProvider + err error +} + +func (u userFindFailure) FindUser(ctx context.Context, email string) (sessions.User, error) { + return sessions.User{}, u.err +} + +func (u userFindFailure) FindUserByAPIToken(ctx context.Context, token string) (sessions.User, error) { + return sessions.User{}, u.err +} + +type userFindSuccess struct { sessions.AuthenticationProvider user sessions.User - err error } -func (s stubAuthProvider) FindUser(ctx context.Context, email string) (sessions.User, error) { - return s.user, s.err +func (u userFindSuccess) FindUser(ctx context.Context, email string) (sessions.User, error) { + return u.user, nil } -func (s stubAuthProvider) FindUserByAPIToken(ctx context.Context, token string) (sessions.User, error) { - return s.user, s.err +func (u userFindSuccess) FindUserByAPIToken(ctx context.Context, token string) (sessions.User, error) { + return u.user, nil } func TestAuthenticateByToken_Success(t *testing.T) { @@ -54,7 +66,7 @@ func TestAuthenticateByToken_Success(t *testing.T) { apiToken := auth.Token{AccessKey: key, Secret: secret} err := user.SetAuthToken(&apiToken) require.NoError(t, err) - authr := stubAuthProvider{user: user} + authr := userFindSuccess{user: user} called := false router := gin.New() @@ -76,7 +88,7 @@ func TestAuthenticateByToken_Success(t *testing.T) { func TestAuthenticateByToken_AuthFailed(t *testing.T) { t.Parallel() - authr := stubAuthProvider{err: auth.ErrorAuthFailed} + authr := userFindFailure{err: auth.ErrorAuthFailed} called := false router := gin.New() @@ -103,7 +115,7 @@ func TestAuthenticateByToken_RejectsBlankAccessKey(t *testing.T) { apiToken := auth.Token{AccessKey: key, Secret: secret} err := user.SetAuthToken(&apiToken) require.NoError(t, err) - authr := stubAuthProvider{user: user} + authr := userFindSuccess{user: user} called := false router := gin.New() diff --git a/core/web/auth/gql.go b/core/web/auth/gql.go index 9f5c4f9ffcd..bff151c5dd6 100644 --- a/core/web/auth/gql.go +++ b/core/web/auth/gql.go @@ -7,15 +7,17 @@ import ( "github.com/gin-gonic/gin" "github.com/pkg/errors" - "github.com/smartcontractkit/chainlink/v2/core/logger" + "github.com/smartcontractkit/chainlink-common/pkg/logger" clsessions "github.com/smartcontractkit/chainlink/v2/core/sessions" ) -type sessionUserKey struct{} -type GQLSession struct { - SessionID string - User *clsessions.User -} +type ( + sessionUserKey struct{} + GQLSession struct { + SessionID string + User *clsessions.User + } +) // AuthenticateGQL middleware checks the session cookie for a user and sets it // on the request context if it exists. It is the responsibility of each resolver diff --git a/core/web/auth/gql_test.go b/core/web/auth/gql_test.go index c3f3903c505..224d1a84048 100644 --- a/core/web/auth/gql_test.go +++ b/core/web/auth/gql_test.go @@ -11,8 +11,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" + "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/chainlink/v2/core/internal/cltest" - "github.com/smartcontractkit/chainlink/v2/core/logger" clsessions "github.com/smartcontractkit/chainlink/v2/core/sessions" "github.com/smartcontractkit/chainlink/v2/core/sessions/mocks" "github.com/smartcontractkit/chainlink/v2/core/web/auth" @@ -26,7 +26,7 @@ func Test_AuthenticateGQL_Unauthenticated(t *testing.T) { r := gin.Default() r.Use(sessions.Sessions(auth.SessionName, sessionStore)) - r.Use(auth.AuthenticateGQL(sessionORM, logger.TestLogger(t))) + r.Use(auth.AuthenticateGQL(sessionORM, logger.Test(t))) r.GET("/", func(c *gin.Context) { session, ok := auth.GetGQLAuthenticatedSession(c) @@ -50,7 +50,7 @@ func Test_AuthenticateGQL_Authenticated(t *testing.T) { r := gin.Default() r.Use(sessions.Sessions(auth.SessionName, sessionStore)) - r.Use(auth.AuthenticateGQL(sessionORM, logger.TestLogger(t))) + r.Use(auth.AuthenticateGQL(sessionORM, logger.Test(t))) r.GET("/", func(c *gin.Context) { session, ok := auth.GetGQLAuthenticatedSession(c.Request.Context()) diff --git a/core/web/bridge_types_controller_test.go b/core/web/bridge_types_controller_test.go index c9e4eb1e080..8e4cfa147a8 100644 --- a/core/web/bridge_types_controller_test.go +++ b/core/web/bridge_types_controller_test.go @@ -100,7 +100,8 @@ func TestValidateBridgeType(t *testing.T) { URL: cltest.WebURL(t, "https://denergy.eth"), }, nil, - }} + }, + } for _, test := range tests { t.Run(test.description, func(t *testing.T) { diff --git a/core/web/build_info_controller_test.go b/core/web/build_info_controller_test.go index 57c00e404aa..940f7b3db0f 100644 --- a/core/web/build_info_controller_test.go +++ b/core/web/build_info_controller_test.go @@ -43,5 +43,6 @@ func TestBuildInfoController_Show_NoCredentials(t *testing.T) { require.NoError(t, err) resp, err := client.Do(req) require.NoError(t, err) + defer resp.Body.Close() require.Equal(t, http.StatusUnauthorized, resp.StatusCode) } diff --git a/core/web/chains_controller.go b/core/web/chains_controller.go index 37011d5fd1f..f466ee2a627 100644 --- a/core/web/chains_controller.go +++ b/core/web/chains_controller.go @@ -6,8 +6,8 @@ import ( "github.com/gin-gonic/gin" + "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/chainlink-common/pkg/types" - "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/logger/audit" "github.com/smartcontractkit/chainlink/v2/core/services/chainlink" "github.com/smartcontractkit/chainlink/v2/core/web/presenters" @@ -52,7 +52,6 @@ func (cc *chainsController) Index(c *gin.Context, size, page, offset int) { } chains, count, err := chainStats.ChainStatuses(c.Request.Context(), offset, size) - if err != nil { jsonAPIError(c, http.StatusBadRequest, err) return diff --git a/core/web/chains_controller_test.go b/core/web/chains_controller_test.go index 92181f0e897..2979caff5ce 100644 --- a/core/web/chains_controller_test.go +++ b/core/web/chains_controller_test.go @@ -166,37 +166,40 @@ func Test_EVMChainsController_Index(t *testing.T) { assert.Empty(t, links["prev"].Href) assert.Len(t, links, 1) - // the difference in index value here seems to be due to the fact - // that cltest always has a default EVM chain, which is the off-by-one - // in the indices - var chainFound bool - var gotChain presenters.ChainResource - for _, chain := range gotChains { - if chain.ID == configuredChains[1].ChainID.String() { - chainFound = true - gotChain = chain - } - } - assert.True(t, chainFound) - toml, err := configuredChains[1].TOMLString() - require.NoError(t, err) - assert.Equal(t, toml, gotChain.Config) resp, cleanup = controller.client.Get(links["next"].Href) t.Cleanup(cleanup) require.Equal(t, http.StatusOK, resp.StatusCode) - gotChains = []presenters.ChainResource{} - err = web.ParsePaginatedResponse(cltest.ParseResponseBody(t, resp), &gotChains, &links) + var gotChainsPage2 []presenters.ChainResource + err = web.ParsePaginatedResponse(cltest.ParseResponseBody(t, resp), &gotChainsPage2, &links) require.NoError(t, err) assert.Empty(t, links["next"].Href) assert.NotEmpty(t, links["prev"].Href) - assert.Len(t, links, 1) - assert.Equal(t, gotChains[0].ID, configuredChains[2].ChainID.String()) - toml, err = configuredChains[2].TOMLString() - require.NoError(t, err) - assert.Equal(t, toml, gotChains[0].Config) + + // cltest always adds a default EVM chain in addition to the ones configured above, + // and chains are sorted lexicographically by chain ID, so a configured chain can end + // up on either page depending on where its (randomly generated) ID sorts relative to + // the default chain's ID. Search across both pages instead of assuming a fixed page. + allChains := make([]presenters.ChainResource, 0, len(gotChains)+len(gotChainsPage2)) + allChains = append(allChains, gotChains...) + allChains = append(allChains, gotChainsPage2...) + require.Len(t, allChains, 1+len(configuredChains)) + + for _, configuredChain := range []*toml.EVMConfig{configuredChains[1], configuredChains[2]} { + var gotChain *presenters.ChainResource + for i := range allChains { + if allChains[i].ID == configuredChain.ChainID.String() { + gotChain = &allChains[i] + break + } + } + require.NotNil(t, gotChain, "expected to find configured chain %s in response", configuredChain.ChainID.String()) + wantTOML, err := configuredChain.TOMLString() + require.NoError(t, err) + assert.Equal(t, wantTOML, gotChain.Config) + } } type TestEVMChainsController struct { diff --git a/core/web/config_controller.go b/core/web/config_controller.go index be8b42523fd..e755cb12503 100644 --- a/core/web/config_controller.go +++ b/core/web/config_controller.go @@ -38,14 +38,14 @@ func (cc *ConfigController) Show(c *gin.Context) { } else { toml = effective } - jsonAPIResponse(c, ConfigV2Resource{toml}, "config") + jsonAPIResponse(c, &ConfigV2Resource{toml}, "config") } type ConfigV2Resource struct { Config string `json:"config"` } -func (c ConfigV2Resource) GetID() string { +func (c *ConfigV2Resource) GetID() string { return utils.NewBytes32ID() } diff --git a/core/web/eth_keys_controller.go b/core/web/eth_keys_controller.go index c66b6597d7e..e29923f8bda 100644 --- a/core/web/eth_keys_controller.go +++ b/core/web/eth_keys_controller.go @@ -16,11 +16,11 @@ import ( "github.com/smartcontractkit/chainlink-common/keystore/corekeys/ethkey" commonassets "github.com/smartcontractkit/chainlink-common/pkg/assets" + "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/chainlink-common/pkg/sqlutil" "github.com/smartcontractkit/chainlink-evm/pkg/assets" "github.com/smartcontractkit/chainlink-evm/pkg/chains/legacyevm" "github.com/smartcontractkit/chainlink/v2/core/config/toml" - "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/logger/audit" "github.com/smartcontractkit/chainlink/v2/core/services/chainlink" "github.com/smartcontractkit/chainlink/v2/core/services/keystore" diff --git a/core/web/eth_keys_controller_test.go b/core/web/eth_keys_controller_test.go index ac70ec71edc..28f2b89e35e 100644 --- a/core/web/eth_keys_controller_test.go +++ b/core/web/eth_keys_controller_test.go @@ -14,6 +14,7 @@ import ( "github.com/smartcontractkit/chainlink-common/keystore/corekeys/ethkey" "github.com/smartcontractkit/chainlink-common/pkg/assets" + "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/chainlink-evm/pkg/chains/legacyevm" "github.com/smartcontractkit/chainlink-evm/pkg/client/clienttest" "github.com/smartcontractkit/chainlink-evm/pkg/txmgr" @@ -21,7 +22,6 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/internal/cltest" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/configtest" - "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/chainlink" webpresenters "github.com/smartcontractkit/chainlink/v2/core/web/presenters" ) @@ -409,7 +409,7 @@ func TestETHKeysController_ChainSuccess_ResetWithAbandon(t *testing.T) { }) require.NoError(t, err) - txStore := txmgr.NewTxStore(app.GetDB(), logger.TestLogger(t)) + txStore := txmgr.NewTxStore(app.GetDB(), logger.Test(t)) txes, err := txStore.FindTxesByFromAddressAndState(t.Context(), addr, "fatal_error") require.NoError(t, err) diff --git a/core/web/evm_forwarders_controller.go b/core/web/evm_forwarders_controller.go index e70b8613a72..61853c1e700 100644 --- a/core/web/evm_forwarders_controller.go +++ b/core/web/evm_forwarders_controller.go @@ -85,7 +85,7 @@ func (cc *EVMForwardersController) Delete(c *gin.Context) { if err2 != nil { // If the chain id doesn't even exist, or logpoller is disabled, then there isn't any filter to clean up. Returning an error // here could be dangerous as it would make it impossible to delete a forwarder with an invalid chain id - return nil + return nil //nolint:nilerr // intentional: a missing chain id means no forwarder filter to clean up } chain, ok := chainService.(legacyevm.Chain) if !ok { diff --git a/core/web/evm_transfer_controller_test.go b/core/web/evm_transfer_controller_test.go index 764878fc7f9..853568a8601 100644 --- a/core/web/evm_transfer_controller_test.go +++ b/core/web/evm_transfer_controller_test.go @@ -19,6 +19,7 @@ import ( "github.com/stretchr/testify/require" commonconfig "github.com/smartcontractkit/chainlink-common/pkg/config" + "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/chainlink-common/pkg/loop" "github.com/smartcontractkit/chainlink-common/pkg/sqlutil" "github.com/smartcontractkit/chainlink-common/pkg/types" @@ -30,7 +31,6 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/configtest" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/evmtest" - "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/logger/audit" "github.com/smartcontractkit/chainlink/v2/core/services/chainlink" chainlinkmocks "github.com/smartcontractkit/chainlink/v2/core/services/chainlink/mocks" @@ -110,17 +110,14 @@ func TestTransfersController_CreateSuccess_From_WithRelayer(t *testing.T) { request := models.SendEtherRequest{ DestinationAddress: to, FromAddress: from, - Amount: (assets.Eth)(*amount), + Amount: assets.Eth(*amount), SkipWaitTxAttempt: true, EVMChainID: sqlutil.New(chainB), } relayer.EXPECT().Transact(mock.Anything, from.String(), to.String(), amount, true).Return(nil).Once() relayer.EXPECT().GetChainInfo(mock.Anything).Return(types.ChainInfo{ChainID: chainB.String()}, nil).Once() - cfg := configtest.NewTestGeneralConfig(t) - auditLogger, err := audit.NewAuditLogger(logger.TestLogger(t), cfg.AuditLogger()) - require.NoError(t, err) - app.EXPECT().GetAuditLogger().Return(auditLogger).Once() + app.EXPECT().GetAuditLogger().Return(audit.NoopLogger).Once() ctrl := &web.EVMTransfersController{App: app} @@ -142,7 +139,7 @@ func TestTransfersController_CreateSuccess_From_WithRelayer(t *testing.T) { From: &from, To: &to, EVMChainID: *sqlutil.New(chainB), - Value: ((*assets.Eth)(amount)).String(), + Value: (*assets.Eth)(amount).String(), Data: []byte{}, }, resp) } @@ -527,7 +524,7 @@ func TestTransfersController_FindTxAttempt(t *testing.T) { } func validateTxCount(t *testing.T, ds sqlutil.DataSource, count int) { - txStore := txmgr.NewTxStore(ds, logger.TestLogger(t)) + txStore := txmgr.NewTxStore(ds, logger.Test(t)) txes, err := txStore.GetAllTxes(t.Context()) require.NoError(t, err) diff --git a/core/web/external_initiators_controller.go b/core/web/external_initiators_controller.go index 633d039d054..1be44c26a0d 100644 --- a/core/web/external_initiators_controller.go +++ b/core/web/external_initiators_controller.go @@ -18,9 +18,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/web/presenters" ) -var ( - externalInitiatorNameRegexp = regexp.MustCompile("^[a-zA-Z0-9-_]+$") -) +var externalInitiatorNameRegexp = regexp.MustCompile("^[a-zA-Z0-9-_]+$") // ValidateExternalInitiator checks whether External Initiator parameters are // safe for processing. @@ -49,10 +47,10 @@ type ExternalInitiatorsController struct { func (eic *ExternalInitiatorsController) Index(c *gin.Context, size, page, offset int) { ctx := c.Request.Context() - externalInitiators, count, err := eic.App.BridgeORM().ExternalInitiators(ctx, offset, size) - resources := make([]presenters.ExternalInitiatorResource, 0, len(externalInitiators)) - for _, initiator := range externalInitiators { - resources = append(resources, presenters.NewExternalInitiatorResource(initiator)) + eis, count, err := eic.App.BridgeORM().ExternalInitiators(ctx, offset, size) + resources := make([]presenters.ExternalInitiatorResource, 0, len(eis)) + for _, ei := range eis { + resources = append(resources, presenters.NewExternalInitiatorResource(ei)) } paginatedResponse(c, "externalInitiators", size, page, resources, count, err) diff --git a/core/web/external_initiators_controller_test.go b/core/web/external_initiators_controller_test.go index e5f02535a7a..58a4f11e98f 100644 --- a/core/web/external_initiators_controller_test.go +++ b/core/web/external_initiators_controller_test.go @@ -95,35 +95,35 @@ func TestExternalInitiatorsController_Index(t *testing.T) { require.Equal(t, 2, metaCount) var links jsonapi.Links - var externalInitiators []presenters.ExternalInitiatorResource - err = web.ParsePaginatedResponse(body, &externalInitiators, &links) + var eis []presenters.ExternalInitiatorResource + err = web.ParsePaginatedResponse(body, &eis, &links) require.NoError(t, err) assert.NotEmpty(t, links["next"].Href) assert.Empty(t, links["prev"].Href) - assert.Len(t, externalInitiators, 1) - assert.Equal(t, strconv.FormatInt(eiBar.ID, 10), externalInitiators[0].ID) - assert.Equal(t, eiBar.Name, externalInitiators[0].Name) - assert.Nil(t, externalInitiators[0].URL) - assert.Equal(t, eiBar.AccessKey, externalInitiators[0].AccessKey) - assert.Equal(t, eiBar.OutgoingToken, externalInitiators[0].OutgoingToken) + assert.Len(t, eis, 1) + assert.Equal(t, strconv.FormatInt(eiBar.ID, 10), eis[0].ID) + assert.Equal(t, eiBar.Name, eis[0].Name) + assert.Nil(t, eis[0].URL) + assert.Equal(t, eiBar.AccessKey, eis[0].AccessKey) + assert.Equal(t, eiBar.OutgoingToken, eis[0].OutgoingToken) resp, cleanup = client.Get(links["next"].Href) t.Cleanup(cleanup) cltest.AssertServerResponse(t, resp, http.StatusOK) - externalInitiators = []presenters.ExternalInitiatorResource{} - err = web.ParsePaginatedResponse(cltest.ParseResponseBody(t, resp), &externalInitiators, &links) + eis = []presenters.ExternalInitiatorResource{} + err = web.ParsePaginatedResponse(cltest.ParseResponseBody(t, resp), &eis, &links) require.NoError(t, err) assert.Empty(t, links["next"]) assert.NotEmpty(t, links["prev"]) - assert.Len(t, externalInitiators, 1) - assert.Equal(t, strconv.FormatInt(eiFoo.ID, 10), externalInitiators[0].ID) - assert.Equal(t, eiFoo.Name, externalInitiators[0].Name) - assert.Equal(t, eiFoo.URL.String(), externalInitiators[0].URL.String()) - assert.Equal(t, eiFoo.AccessKey, externalInitiators[0].AccessKey) - assert.Equal(t, eiFoo.OutgoingToken, externalInitiators[0].OutgoingToken) + assert.Len(t, eis, 1) + assert.Equal(t, strconv.FormatInt(eiFoo.ID, 10), eis[0].ID) + assert.Equal(t, eiFoo.Name, eis[0].Name) + assert.Equal(t, eiFoo.URL.String(), eis[0].URL.String()) + assert.Equal(t, eiFoo.AccessKey, eis[0].AccessKey) + assert.Equal(t, eiFoo.OutgoingToken, eis[0].OutgoingToken) } func TestExternalInitiatorsController_Create_success(t *testing.T) { diff --git a/core/web/gui_assets_test.go b/core/web/gui_assets_test.go index e02f0b32def..07ccbf443ca 100644 --- a/core/web/gui_assets_test.go +++ b/core/web/gui_assets_test.go @@ -10,10 +10,10 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/chainlink/v2/core/internal/cltest" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/configtest" clhttptest "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/httptest" - "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/web" ) @@ -46,6 +46,7 @@ func TestGuiAssets_DefaultIndexHtml_OK(t *testing.T) { require.NoError(t, err) resp, err := client.Do(req) require.NoError(t, err) + defer resp.Body.Close() cltest.AssertServerResponse(t, resp, http.StatusOK) }) } @@ -78,6 +79,7 @@ func TestGuiAssets_DefaultIndexHtml_NotFound(t *testing.T) { require.NoError(t, err) resp, err := client.Do(req) require.NoError(t, err) + defer resp.Body.Close() cltest.AssertServerResponse(t, resp, http.StatusNotFound) }) } @@ -100,6 +102,7 @@ func TestGuiAssets_DefaultIndexHtml_RateLimited(t *testing.T) { resp, err := client.Do(req) require.NoError(t, err) cltest.AssertServerResponse(t, resp, http.StatusOK) + _ = resp.Body.Close() } // Last request fails @@ -107,6 +110,7 @@ func TestGuiAssets_DefaultIndexHtml_RateLimited(t *testing.T) { require.NoError(t, err) resp, err := client.Do(req) require.NoError(t, err) + defer resp.Body.Close() assert.Equal(t, http.StatusTooManyRequests, resp.StatusCode) } @@ -114,7 +118,7 @@ func TestGuiAssets_AssetsFS(t *testing.T) { t.Parallel() efs := web.NewEmbedFileSystem(testFs, "fixtures/operator_ui") - handler := web.ServeGzippedAssets("/fixtures/operator_ui/", efs, logger.TestLogger(t)) + handler := web.ServeGzippedAssets("/fixtures/operator_ui/", efs, logger.Test(t)) t.Run("it get exact assets if Accept-Encoding is not specified", func(t *testing.T) { t.Parallel() diff --git a/core/web/health_controller.go b/core/web/health_controller.go index 35fe36915c1..d6bb933362a 100644 --- a/core/web/health_controller.go +++ b/core/web/health_controller.go @@ -239,8 +239,7 @@ func (t checkTree) WriteHTMLTo(w io.Writer) error { } func (t checkTree) writeHTMLTo(w *linePrefixWriter) error { - keys := slices.AppendSeq(make([]string, 0, len(t)), maps.Keys(t)) - slices.Sort(keys) + keys := slices.Sorted(maps.Keys(t)) for _, short := range keys { node := t[short] if _, err := io.WriteString(w, ` diff --git a/core/web/health_controller_test.go b/core/web/health_controller_test.go index edcf07f1ef5..16823d54be8 100644 --- a/core/web/health_controller_test.go +++ b/core/web/health_controller_test.go @@ -22,7 +22,7 @@ import ( func TestHealthController_Readyz(t *testing.T) { t.Parallel() - var tt = []struct { + tt := []struct { name string ready bool status int @@ -60,7 +60,7 @@ func TestHealthController_Readyz(t *testing.T) { func TestHealthController_PublicReadyz(t *testing.T) { t.Parallel() - var tt = []struct { + tt := []struct { name string ready bool status int @@ -111,7 +111,7 @@ func TestHealthController_PublicReadyz(t *testing.T) { func TestHealthController_Health_status(t *testing.T) { t.Parallel() - var tt = []struct { + tt := []struct { name string ready bool status int diff --git a/core/web/jobs_controller_test.go b/core/web/jobs_controller_test.go index 16564377429..23558de0ac8 100644 --- a/core/web/jobs_controller_test.go +++ b/core/web/jobs_controller_test.go @@ -44,15 +44,13 @@ import ( func TestJobsController_Create_ValidationFailure_OffchainReportingSpec(t *testing.T) { t.Parallel() - var ( - contractAddress = cltest.NewEIP55Address() - ) + contractAddress := cltest.NewEIP55Address() var peerID ragep2ptypes.PeerID require.NoError(t, peerID.UnmarshalText([]byte(configtest.DefaultPeerID))) randomBytes := testutils.Random32Byte() - var tt = []struct { + tt := []struct { name string pid p2pkey.PeerID kb string @@ -129,7 +127,7 @@ func TestJobController_Create_HappyPath(t *testing.T) { } jorm := app.JobORM() - var tt = []struct { + tt := []struct { name string tomlTemplate func(nameAndExternalJobID string) string assertion func(t *testing.T, nameAndExternalJobID string, r *http.Response) @@ -457,7 +455,8 @@ func TestJobsController_Update_HappyPath(t *testing.T) { // BCF-2095 // disable fkey checks until the end of the test transaction require.NoError(t, utils.JustError( - app.GetDB().ExecContext(ctx, `SET CONSTRAINTS job_spec_errors_v2_job_id_fkey DEFERRED`))) + app.GetDB().ExecContext(ctx, `SET CONSTRAINTS job_spec_errors_v2_job_id_fkey DEFERRED`), + )) var ocrSpec job.OCROracleSpec err = toml.Unmarshal([]byte(ocrspec.Toml()), &ocrSpec) diff --git a/core/web/keys_controller.go b/core/web/keys_controller.go index 4399e1ab60e..9fe90c0d77e 100644 --- a/core/web/keys_controller.go +++ b/core/web/keys_controller.go @@ -9,7 +9,7 @@ import ( "github.com/gin-gonic/gin" "github.com/manyminds/api2go/jsonapi" - "github.com/smartcontractkit/chainlink/v2/core/logger" + "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/chainlink/v2/core/logger/audit" "github.com/smartcontractkit/chainlink/v2/core/services/keystore" ) @@ -20,7 +20,7 @@ type Keystore[K keystore.Key] interface { Create(context.Context) (K, error) Delete(ctx context.Context, id string) (K, error) Import(ctx context.Context, keyJSON []byte, password string) (K, error) - Export(id string, password string) ([]byte, error) + Export(id, password string) ([]byte, error) } type KeysController interface { @@ -47,7 +47,8 @@ type keysController[K keystore.Key, R jsonapi.EntityNamer] struct { } func NewKeysController[K keystore.Key, R jsonapi.EntityNamer](ks Keystore[K], lggr logger.Logger, auditLogger audit.AuditLogger, resourceName string, - newResource func(K) *R, newResources func([]K) []R) KeysController { + newResource func(K) *R, newResources func([]K) []R, +) KeysController { var k K typ, err := keystore.GetFieldNameForKey(k) if err != nil { diff --git a/core/web/loader/getters.go b/core/web/loader/getters.go index f7126d90e40..e7851264546 100644 --- a/core/web/loader/getters.go +++ b/core/web/loader/getters.go @@ -37,7 +37,7 @@ func GetChainByRelayID(ctx context.Context, id string) (*chainlink.NetworkChainS } // GetFeedsManagerByID fetches the feed manager by ID. -func GetFeedsManagerByID(ctx context.Context, id string) (*feeds.FeedsManager, error) { +func GetFeedsManagerByID(ctx context.Context, id string) (*feeds.Manager, error) { ldr := For(ctx) thunk := ldr.FeedsManagersByIDLoader.Load(ctx, dataloader.StringKey(id)) @@ -46,7 +46,7 @@ func GetFeedsManagerByID(ctx context.Context, id string) (*feeds.FeedsManager, e return nil, err } - mgr, ok := result.(feeds.FeedsManager) + mgr, ok := result.(feeds.Manager) if !ok { return nil, ErrInvalidType } diff --git a/core/web/loader/loader_test.go b/core/web/loader/loader_test.go index 82ce0e86c80..a9b66e1fbf4 100644 --- a/core/web/loader/loader_test.go +++ b/core/web/loader/loader_test.go @@ -141,20 +141,20 @@ func TestLoader_FeedsManagers(t *testing.T) { app := coremocks.NewApplication(t) ctx := InjectDataloader(t.Context(), app) - mgr1 := feeds.FeedsManager{ + mgr1 := feeds.Manager{ ID: int64(1), Name: "manager 1", } - mgr2 := feeds.FeedsManager{ + mgr2 := feeds.Manager{ ID: int64(2), Name: "manager 2", } - mgr3 := feeds.FeedsManager{ + mgr3 := feeds.Manager{ ID: int64(3), Name: "manager 3", } - fsvc.On("ListManagersByIDs", mock.Anything, []int64{3, 1, 2, 5}).Return([]feeds.FeedsManager{ + fsvc.On("ListManagersByIDs", mock.Anything, []int64{3, 1, 2, 5}).Return([]feeds.Manager{ mgr1, mgr2, mgr3, }, nil) app.On("GetFeedsService").Return(fsvc) diff --git a/core/web/loop_registry.go b/core/web/loop_registry.go index c9396b4f74f..fe3ab81141c 100644 --- a/core/web/loop_registry.go +++ b/core/web/loop_registry.go @@ -17,8 +17,8 @@ import ( "github.com/prometheus/common/model" "github.com/prometheus/prometheus/discovery/targetgroup" + "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/chainlink/v2/core/config/env" - "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/chainlink" "github.com/smartcontractkit/chainlink/v2/plugins" ) @@ -30,7 +30,7 @@ type LoopRegistryServer struct { discoveryHostName string // discovery endpoint hostname. must be accessible to external prom for scraping loopHostName string // internal hostname of loopps. used by node to forward external prom requests registry *plugins.LoopRegistry - logger logger.SugaredLogger + logger logger.Logger promClient *http.Client jsonMarshalFn func(any) ([]byte, error) diff --git a/core/web/loop_registry_internal_test.go b/core/web/loop_registry_internal_test.go index c2b67b6f0ec..4c059d32eba 100644 --- a/core/web/loop_registry_internal_test.go +++ b/core/web/loop_registry_internal_test.go @@ -7,9 +7,9 @@ import ( "github.com/pkg/errors" "github.com/stretchr/testify/assert" - "go.uber.org/zap" + "go.uber.org/zap/zapcore" - "github.com/smartcontractkit/chainlink/v2/core/logger" + "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/chainlink/v2/plugins" ) @@ -36,11 +36,11 @@ func newResponseWriter() *responseWriter { func TestLoopRegistryServer_CantWriteToResponse(t *testing.T) { t.Parallel() - l, o := logger.TestLoggerObserved(t, zap.ErrorLevel) + l, o := logger.TestObserved(t, zapcore.ErrorLevel) s := &LoopRegistryServer{ exposedPromPort: 1, registry: plugins.NewTestLoopRegistry(l), - logger: l.(logger.SugaredLogger), + logger: l, jsonMarshalFn: json.Marshal, } @@ -52,11 +52,11 @@ func TestLoopRegistryServer_CantWriteToResponse(t *testing.T) { func TestLoopRegistryServer_CantMarshal(t *testing.T) { t.Parallel() - l, o := logger.TestLoggerObserved(t, zap.ErrorLevel) + l, o := logger.TestObserved(t, zapcore.ErrorLevel) s := &LoopRegistryServer{ exposedPromPort: 1, registry: plugins.NewTestLoopRegistry(l), - logger: l.(logger.SugaredLogger), + logger: l, jsonMarshalFn: func(any) ([]byte, error) { return []byte(""), errors.New("can't unmarshal") }, diff --git a/core/web/loop_registry_test.go b/core/web/loop_registry_test.go index be619c139bc..72a8d578208 100644 --- a/core/web/loop_registry_test.go +++ b/core/web/loop_registry_test.go @@ -16,12 +16,12 @@ import ( "github.com/smartcontractkit/freeport" + "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/chainlink-common/pkg/loop" "github.com/smartcontractkit/chainlink-common/pkg/services" "github.com/smartcontractkit/chainlink-common/pkg/services/servicetest" "github.com/smartcontractkit/chainlink/v2/core/internal/cltest" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/configtest" - "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/chainlink" "github.com/smartcontractkit/chainlink/v2/core/web" ) @@ -48,7 +48,7 @@ func configurePromRegistry() { func newMockLoopImpl(t *testing.T, port int) *mockLoopImpl { return &mockLoopImpl{ t: t, - Service: loop.WebServerOpts{Handler: testHandler}.New(logger.TestLogger(t).Named("mock-loop"), port), + Service: loop.WebServerOpts{Handler: testHandler}.New(logger.Named(logger.Test(t), "mock-loop"), port), } } diff --git a/core/web/middleware.go b/core/web/middleware.go index ed9ff9b02ef..380b5031b44 100644 --- a/core/web/middleware.go +++ b/core/web/middleware.go @@ -13,7 +13,7 @@ import ( "github.com/gin-gonic/gin" - "github.com/smartcontractkit/chainlink/v2/core/logger" + "github.com/smartcontractkit/chainlink-common/pkg/logger" ) // Go's new embed feature doesn't allow us to embed things outside of the current module. @@ -40,7 +40,7 @@ const ( // ServeFileSystem wraps a http.FileSystem with an additional file existence check type ServeFileSystem interface { http.FileSystem - Exists(prefix string, path string) (bool, error) + Exists(prefix, path string) (bool, error) } // EmbedFileSystem implements the ServeFileSystem interface using an embed.FS @@ -60,7 +60,7 @@ func NewEmbedFileSystem(efs embed.FS, pathPrefix string) ServeFileSystem { } // Exists implements the ServeFileSystem interface. -func (e *EmbedFileSystem) Exists(prefix string, filepath string) (found bool, err error) { +func (e *EmbedFileSystem) Exists(prefix, filepath string) (found bool, err error) { if p := path.Base(strings.TrimPrefix(filepath, prefix)); len(p) < len(filepath) { err = fs.WalkDir(e.FS, ".", func(fpath string, d fs.DirEntry, err error) error { fileName := path.Base(fpath) @@ -72,7 +72,7 @@ func (e *EmbedFileSystem) Exists(prefix string, filepath string) (found bool, er }) } - return + return found, err } // Open implements the http.FileSystem interface. @@ -93,7 +93,7 @@ type gzipFileHandler struct { // which adds support for static resources precompressed with gzip, at // the cost of removing the support for directory browsing. func GzipFileServer(root ServeFileSystem, lggr logger.Logger) http.Handler { - return &gzipFileHandler{root, logger.Sugared(lggr.Named("GzipFilehandler"))} + return &gzipFileHandler{root, logger.Sugared(lggr).Named("GzipFilehandler")} } func (f *gzipFileHandler) openAndStat(path string) (http.File, os.FileInfo, error) { diff --git a/core/web/ping_controller_test.go b/core/web/ping_controller_test.go index ff352ef88f1..4a84248f49e 100644 --- a/core/web/ping_controller_test.go +++ b/core/web/ping_controller_test.go @@ -82,5 +82,6 @@ func TestPingController_Show_NoCredentials(t *testing.T) { require.NoError(t, err) resp, err := client.Do(req) require.NoError(t, err) + defer resp.Body.Close() require.Equal(t, http.StatusUnauthorized, resp.StatusCode) } diff --git a/core/web/pipeline_runs_controller_test.go b/core/web/pipeline_runs_controller_test.go index 4bfbbaa3622..d25ca77857a 100644 --- a/core/web/pipeline_runs_controller_test.go +++ b/core/web/pipeline_runs_controller_test.go @@ -21,6 +21,7 @@ import ( "github.com/smartcontractkit/freeport" commonconfig "github.com/smartcontractkit/chainlink-common/pkg/config" + "github.com/smartcontractkit/chainlink-common/pkg/utils/jsonserializable" "github.com/smartcontractkit/chainlink/v2/core/internal/cltest" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/configtest" @@ -71,6 +72,34 @@ func TestPipelineRunsController_RunExistingWebhookJobRejected(t *testing.T) { require.Contains(t, string(cltest.ParseResponseBody(t, response)), "webhook") } +// assertPipelineRunResult asserts the outputs/errors/inputs of a pipeline run created by +// setupPipelineRunsControllerTests, comparing parsed fields directly instead of matching +// raw JSON substrings. +func assertPipelineRunResult(t *testing.T, got presenters.PipelineRunResource) { + t.Helper() + + three := "3" + uhOh := "uh oh" + assert.Equal(t, []*string{&three}, got.Outputs) + assert.Equal(t, []*string{nil}, got.Errors) //nolint:staticcheck // Errors is deprecated but still populated for backwards compatibility + assert.Equal(t, []*string{&uhOh}, got.AllErrors) + assert.Equal(t, []*string{nil}, got.FatalErrors) + assert.Equal(t, jsonserializable.JSONSerializable{ + Valid: true, + Val: map[string]any{ + "answer": "3", + "ds1": `{"USD": 1}`, + "ds1_multiply": "3", + "ds1_parse": int64(1), + "ds2": `{"USD": 1}`, + "ds2_multiply": "3", + "ds2_parse": int64(1), + "ds3": map[string]any{}, + "jobRun": map[string]any{"meta": nil}, + }, + }, got.Inputs) +} + func TestPipelineRunsController_Index_GlobalHappyPath(t *testing.T) { t.Parallel() @@ -87,7 +116,6 @@ func TestPipelineRunsController_Index_GlobalHappyPath(t *testing.T) { var parsedResponse []presenters.PipelineRunResource responseBytes := cltest.ParseResponseBody(t, response) - assert.Contains(t, string(responseBytes), `"outputs":["3"],"errors":[null],"allErrors":["uh oh"],"fatalErrors":[null],"inputs":{"answer":"3","ds1":"{\"USD\": 1}","ds1_multiply":"3","ds1_parse":1,"ds2":"{\"USD\": 1}","ds2_multiply":"3","ds2_parse":1,"ds3":{},"jobRun":{"meta":null}`) err := web.ParseJSONAPIResponse(responseBytes, &parsedResponse) require.NoError(t, err) @@ -99,6 +127,7 @@ func TestPipelineRunsController_Index_GlobalHappyPath(t *testing.T) { assert.NotNil(t, parsedResponse[1].FinishedAt) assert.Equal(t, jobID, parsedResponse[1].PipelineSpec.JobID) require.Len(t, parsedResponse[1].TaskRuns, 8) + assertPipelineRunResult(t, parsedResponse[1]) } func TestPipelineRunsController_Index_HappyPath(t *testing.T) { @@ -112,7 +141,6 @@ func TestPipelineRunsController_Index_HappyPath(t *testing.T) { var parsedResponse []presenters.PipelineRunResource responseBytes := cltest.ParseResponseBody(t, response) - assert.Contains(t, string(responseBytes), `"outputs":["3"],"errors":[null],"allErrors":["uh oh"],"fatalErrors":[null],"inputs":{"answer":"3","ds1":"{\"USD\": 1}","ds1_multiply":"3","ds1_parse":1,"ds2":"{\"USD\": 1}","ds2_multiply":"3","ds2_parse":1,"ds3":{},"jobRun":{"meta":null}`) err := web.ParseJSONAPIResponse(responseBytes, &parsedResponse) require.NoError(t, err) @@ -124,6 +152,7 @@ func TestPipelineRunsController_Index_HappyPath(t *testing.T) { assert.NotNil(t, parsedResponse[1].FinishedAt) assert.Equal(t, jobID, parsedResponse[1].PipelineSpec.JobID) require.Len(t, parsedResponse[1].TaskRuns, 8) + assertPipelineRunResult(t, parsedResponse[1]) } func TestPipelineRunsController_Index_Pagination(t *testing.T) { @@ -137,7 +166,6 @@ func TestPipelineRunsController_Index_Pagination(t *testing.T) { var parsedResponse []presenters.PipelineRunResource responseBytes := cltest.ParseResponseBody(t, response) - assert.Contains(t, string(responseBytes), `"outputs":["3"],"errors":[null],"allErrors":["uh oh"],"fatalErrors":[null],"inputs":{"answer":"3","ds1":"{\"USD\": 1}","ds1_multiply":"3","ds1_parse":1,"ds2":"{\"USD\": 1}","ds2_multiply":"3","ds2_parse":1,"ds3":{},"jobRun":{"meta":null}`) assert.Contains(t, string(responseBytes), `"meta":{"count":2}`) err := web.ParseJSONAPIResponse(responseBytes, &parsedResponse) @@ -148,6 +176,7 @@ func TestPipelineRunsController_Index_Pagination(t *testing.T) { assert.NotNil(t, parsedResponse[0].CreatedAt) assert.NotNil(t, parsedResponse[0].FinishedAt) require.Len(t, parsedResponse[0].TaskRuns, 8) + assertPipelineRunResult(t, parsedResponse[0]) } func TestPipelineRunsController_Show_HappyPath(t *testing.T) { @@ -161,7 +190,6 @@ func TestPipelineRunsController_Show_HappyPath(t *testing.T) { var parsedResponse presenters.PipelineRunResource responseBytes := cltest.ParseResponseBody(t, response) - assert.Contains(t, string(responseBytes), `"outputs":["3"],"errors":[null],"allErrors":["uh oh"],"fatalErrors":[null],"inputs":{"answer":"3","ds1":"{\"USD\": 1}","ds1_multiply":"3","ds1_parse":1,"ds2":"{\"USD\": 1}","ds2_multiply":"3","ds2_parse":1,"ds3":{},"jobRun":{"meta":null}`) err := web.ParseJSONAPIResponse(responseBytes, &parsedResponse) require.NoError(t, err) @@ -169,6 +197,7 @@ func TestPipelineRunsController_Show_HappyPath(t *testing.T) { assert.NotNil(t, parsedResponse.CreatedAt) assert.NotNil(t, parsedResponse.FinishedAt) require.Len(t, parsedResponse.TaskRuns, 8) + assertPipelineRunResult(t, parsedResponse) } func TestPipelineRunsController_ShowRun_InvalidID(t *testing.T) { diff --git a/core/web/presenters/job_test.go b/core/web/presenters/job_test.go index 4e151c5e76c..801588b0a09 100644 --- a/core/web/presenters/job_test.go +++ b/core/web/presenters/job_test.go @@ -1016,7 +1016,7 @@ func TestJob(t *testing.T) { }, want: ` { - "data": { + "data": { "type": "jobs", "id": "1", "attributes": { @@ -1054,7 +1054,7 @@ func TestJob(t *testing.T) { "jobID": 0, "dotDagSource": "" }, - "errors": [] + "errors": [] } } }`, diff --git a/core/web/presenters/jsonapi.go b/core/web/presenters/jsonapi.go index 47f7c46c8a4..5c68a3af7c8 100644 --- a/core/web/presenters/jsonapi.go +++ b/core/web/presenters/jsonapi.go @@ -16,7 +16,7 @@ func NewJAID(id string) JAID { } // NewPrefixedJAID prefixes JAID with chain id in %s/%s format. -func NewPrefixedJAID(id string, prefix string) JAID { +func NewPrefixedJAID(id, prefix string) JAID { return JAID{ID: fmt.Sprintf("%s/%s", prefix, id)} } diff --git a/core/web/presenters/pipeline_run.go b/core/web/presenters/pipeline_run.go index 874c9efd2b0..794ea7ae37e 100644 --- a/core/web/presenters/pipeline_run.go +++ b/core/web/presenters/pipeline_run.go @@ -5,8 +5,8 @@ import ( "gopkg.in/guregu/null.v4" + "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/chainlink-common/pkg/utils/jsonserializable" - "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/pipeline" ) @@ -33,7 +33,7 @@ func (r PipelineRunResource) GetName() string { } func NewPipelineRunResource(pr pipeline.Run, lggr logger.Logger) PipelineRunResource { - lggr = lggr.Named("PipelineRunResource") + lggr = logger.Sugared(lggr).Named("PipelineRunResource") trs := make([]PipelineTaskRunResource, 0, len(pr.PipelineTaskRuns)) for i := range pr.PipelineTaskRuns { trs = append(trs, NewPipelineTaskRunResource(pr.PipelineTaskRuns[i])) diff --git a/core/web/presenters/vrf_key.go b/core/web/presenters/vrf_key.go index a0dfc1f9653..21fb8295c9a 100644 --- a/core/web/presenters/vrf_key.go +++ b/core/web/presenters/vrf_key.go @@ -2,7 +2,7 @@ package presenters import ( "github.com/smartcontractkit/chainlink-common/keystore/corekeys/vrfkey" - "github.com/smartcontractkit/chainlink/v2/core/logger" + "github.com/smartcontractkit/chainlink-common/pkg/logger" ) type VRFKeyResource struct { diff --git a/core/web/resolver/feeds_manager.go b/core/web/resolver/feeds_manager.go index 5c81068f428..1235bdaac7e 100644 --- a/core/web/resolver/feeds_manager.go +++ b/core/web/resolver/feeds_manager.go @@ -13,14 +13,14 @@ import ( // FeedsManagerResolver resolves the FeedsManager type. type FeedsManagerResolver struct { - mgr feeds.FeedsManager + mgr feeds.Manager } -func NewFeedsManager(mgr feeds.FeedsManager) *FeedsManagerResolver { +func NewFeedsManager(mgr feeds.Manager) *FeedsManagerResolver { return &FeedsManagerResolver{mgr: mgr} } -func NewFeedsManagers(mgrs []feeds.FeedsManager) []*FeedsManagerResolver { +func NewFeedsManagers(mgrs []feeds.Manager) []*FeedsManagerResolver { resolvers := make([]*FeedsManagerResolver, 0, len(mgrs)) for _, mgr := range mgrs { resolvers = append(resolvers, NewFeedsManager(mgr)) @@ -87,11 +87,11 @@ func (r *FeedsManagerResolver) DisabledAt() *graphql.Time { // -- FeedsManager Query -- type FeedsManagerPayloadResolver struct { - mgr *feeds.FeedsManager + mgr *feeds.Manager NotFoundErrorUnionType } -func NewFeedsManagerPayload(mgr *feeds.FeedsManager, err error) *FeedsManagerPayloadResolver { +func NewFeedsManagerPayload(mgr *feeds.Manager, err error) *FeedsManagerPayloadResolver { e := NotFoundErrorUnionType{err: err, message: "feeds manager not found", isExpectedErrorFn: nil} return &FeedsManagerPayloadResolver{mgr: mgr, NotFoundErrorUnionType: e} @@ -110,10 +110,10 @@ func (r *FeedsManagerPayloadResolver) ToFeedsManager() (*FeedsManagerResolver, b // FeedsManagersPayloadResolver resolves a list of feeds managers type FeedsManagersPayloadResolver struct { - feedsManagers []feeds.FeedsManager + feedsManagers []feeds.Manager } -func NewFeedsManagersPayload(feedsManagers []feeds.FeedsManager) *FeedsManagersPayloadResolver { +func NewFeedsManagersPayload(feedsManagers []feeds.Manager) *FeedsManagersPayloadResolver { return &FeedsManagersPayloadResolver{ feedsManagers: feedsManagers, } @@ -128,13 +128,13 @@ func (r *FeedsManagersPayloadResolver) Results() []*FeedsManagerResolver { // CreateFeedsManagerPayloadResolver - type CreateFeedsManagerPayloadResolver struct { - mgr *feeds.FeedsManager + mgr *feeds.Manager // inputErrors maps an input path to a string inputErrs map[string]string NotFoundErrorUnionType } -func NewCreateFeedsManagerPayload(mgr *feeds.FeedsManager, err error, inputErrs map[string]string) *CreateFeedsManagerPayloadResolver { +func NewCreateFeedsManagerPayload(mgr *feeds.Manager, err error, inputErrs map[string]string) *CreateFeedsManagerPayloadResolver { e := NotFoundErrorUnionType{err: err, message: "feeds manager not found", isExpectedErrorFn: nil} return &CreateFeedsManagerPayloadResolver{ @@ -184,10 +184,10 @@ func (r *CreateFeedsManagerPayloadResolver) ToInputErrors() (*InputErrorsResolve } type CreateFeedsManagerSuccessResolver struct { - mgr feeds.FeedsManager + mgr feeds.Manager } -func NewCreateFeedsManagerSuccessResolver(mgr feeds.FeedsManager) *CreateFeedsManagerSuccessResolver { +func NewCreateFeedsManagerSuccessResolver(mgr feeds.Manager) *CreateFeedsManagerSuccessResolver { return &CreateFeedsManagerSuccessResolver{ mgr: mgr, } @@ -240,12 +240,12 @@ func (r *DuplicateFeedsManagerErrorResolver) Code() ErrorCode { // UpdateFeedsManagerPayloadResolver - type UpdateFeedsManagerPayloadResolver struct { - mgr *feeds.FeedsManager + mgr *feeds.Manager inputErrs map[string]string NotFoundErrorUnionType } -func NewUpdateFeedsManagerPayload(mgr *feeds.FeedsManager, err error, inputErrs map[string]string) *UpdateFeedsManagerPayloadResolver { +func NewUpdateFeedsManagerPayload(mgr *feeds.Manager, err error, inputErrs map[string]string) *UpdateFeedsManagerPayloadResolver { e := NotFoundErrorUnionType{err: err, message: "feeds manager not found", isExpectedErrorFn: nil} return &UpdateFeedsManagerPayloadResolver{ @@ -278,10 +278,10 @@ func (r *UpdateFeedsManagerPayloadResolver) ToInputErrors() (*InputErrorsResolve } type UpdateFeedsManagerSuccessResolver struct { - mgr feeds.FeedsManager + mgr feeds.Manager } -func NewUpdateFeedsManagerSuccessResolver(mgr feeds.FeedsManager) *UpdateFeedsManagerSuccessResolver { +func NewUpdateFeedsManagerSuccessResolver(mgr feeds.Manager) *UpdateFeedsManagerSuccessResolver { return &UpdateFeedsManagerSuccessResolver{ mgr: mgr, } @@ -294,11 +294,11 @@ func (r *UpdateFeedsManagerSuccessResolver) FeedsManager() *FeedsManagerResolver // -- EnableFeedsManager Mutation -- type EnableFeedsManagerPayloadResolver struct { - mgr *feeds.FeedsManager + mgr *feeds.Manager NotFoundErrorUnionType } -func NewEnableFeedsManagerPayload(mgr *feeds.FeedsManager, err error) *EnableFeedsManagerPayloadResolver { +func NewEnableFeedsManagerPayload(mgr *feeds.Manager, err error) *EnableFeedsManagerPayloadResolver { e := NotFoundErrorUnionType{err: err, message: "feeds manager not found", isExpectedErrorFn: nil} return &EnableFeedsManagerPayloadResolver{ @@ -316,10 +316,10 @@ func (r *EnableFeedsManagerPayloadResolver) ToEnableFeedsManagerSuccess() (*Enab } type EnableFeedsManagerSuccessResolver struct { - mgr feeds.FeedsManager + mgr feeds.Manager } -func NewEnableFeedsManagerSuccessResolver(mgr feeds.FeedsManager) *EnableFeedsManagerSuccessResolver { +func NewEnableFeedsManagerSuccessResolver(mgr feeds.Manager) *EnableFeedsManagerSuccessResolver { return &EnableFeedsManagerSuccessResolver{ mgr: mgr, } @@ -332,11 +332,11 @@ func (r *EnableFeedsManagerSuccessResolver) FeedsManager() *FeedsManagerResolver // -- DisableFeedsManager Mutation -- type DisableFeedsManagerPayloadResolver struct { - mgr *feeds.FeedsManager + mgr *feeds.Manager NotFoundErrorUnionType } -func NewDisableFeedsManagerPayload(mgr *feeds.FeedsManager, err error) *DisableFeedsManagerPayloadResolver { +func NewDisableFeedsManagerPayload(mgr *feeds.Manager, err error) *DisableFeedsManagerPayloadResolver { e := NotFoundErrorUnionType{err: err, message: "feeds manager not found", isExpectedErrorFn: nil} return &DisableFeedsManagerPayloadResolver{ @@ -354,10 +354,10 @@ func (r *DisableFeedsManagerPayloadResolver) ToDisableFeedsManagerSuccess() (*Di } type DisableFeedsManagerSuccessResolver struct { - mgr feeds.FeedsManager + mgr feeds.Manager } -func NewDisableFeedsManagerSuccessResolver(mgr feeds.FeedsManager) *DisableFeedsManagerSuccessResolver { +func NewDisableFeedsManagerSuccessResolver(mgr feeds.Manager) *DisableFeedsManagerSuccessResolver { return &DisableFeedsManagerSuccessResolver{ mgr: mgr, } diff --git a/core/web/resolver/feeds_manager_test.go b/core/web/resolver/feeds_manager_test.go index ac117fcd4bd..bf1abbbf0e1 100644 --- a/core/web/resolver/feeds_manager_test.go +++ b/core/web/resolver/feeds_manager_test.go @@ -52,7 +52,7 @@ func Test_FeedsManagers(t *testing.T) { Status: feeds.JobProposalStatusApproved, }, }, nil) - f.Mocks.feedsSvc.On("ListManagers", mock.Anything).Return([]feeds.FeedsManager{ + f.Mocks.feedsSvc.On("ListManagers", mock.Anything).Return([]feeds.Manager{ { ID: 1, Name: "manager1", @@ -119,7 +119,7 @@ func Test_FeedsManager(t *testing.T) { authenticated: true, before: func(ctx context.Context, f *gqlTestFramework) { f.App.On("GetFeedsService").Return(f.Mocks.feedsSvc) - f.Mocks.feedsSvc.On("GetManager", mock.Anything, mgrID).Return(&feeds.FeedsManager{ + f.Mocks.feedsSvc.On("GetManager", mock.Anything, mgrID).Return(&feeds.Manager{ ID: mgrID, Name: "manager1", URI: "localhost:2000", @@ -228,7 +228,7 @@ func Test_CreateFeedsManager(t *testing.T) { URI: uri, PublicKey: *pubKey, }).Return(mgrID, nil) - f.Mocks.feedsSvc.On("GetManager", mock.Anything, mgrID).Return(&feeds.FeedsManager{ + f.Mocks.feedsSvc.On("GetManager", mock.Anything, mgrID).Return(&feeds.Manager{ ID: mgrID, Name: name, URI: uri, @@ -389,13 +389,13 @@ func Test_UpdateFeedsManager(t *testing.T) { authenticated: true, before: func(ctx context.Context, f *gqlTestFramework) { f.App.On("GetFeedsService").Return(f.Mocks.feedsSvc) - f.Mocks.feedsSvc.On("UpdateManager", mock.Anything, feeds.FeedsManager{ + f.Mocks.feedsSvc.On("UpdateManager", mock.Anything, feeds.Manager{ ID: mgrID, Name: name, URI: uri, PublicKey: *pubKey, }).Return(nil) - f.Mocks.feedsSvc.On("GetManager", mock.Anything, mgrID).Return(&feeds.FeedsManager{ + f.Mocks.feedsSvc.On("GetManager", mock.Anything, mgrID).Return(&feeds.Manager{ ID: mgrID, Name: name, URI: uri, @@ -425,7 +425,7 @@ func Test_UpdateFeedsManager(t *testing.T) { authenticated: true, before: func(ctx context.Context, f *gqlTestFramework) { f.App.On("GetFeedsService").Return(f.Mocks.feedsSvc) - f.Mocks.feedsSvc.On("UpdateManager", mock.Anything, mock.IsType(feeds.FeedsManager{})).Return(nil) + f.Mocks.feedsSvc.On("UpdateManager", mock.Anything, mock.IsType(feeds.Manager{})).Return(nil) f.Mocks.feedsSvc.On("GetManager", mock.Anything, mgrID).Return(nil, sql.ErrNoRows) }, query: mutation, @@ -510,7 +510,7 @@ func Test_EnableFeedsManager(t *testing.T) { before: func(ctx context.Context, f *gqlTestFramework) { disabledAt := f.Timestamp() f.App.On("GetFeedsService").Return(f.Mocks.feedsSvc) - f.Mocks.feedsSvc.On("EnableManager", mock.Anything, mgrID).Return(&feeds.FeedsManager{ + f.Mocks.feedsSvc.On("EnableManager", mock.Anything, mgrID).Return(&feeds.Manager{ ID: mgrID, Name: name, URI: uri, @@ -618,7 +618,7 @@ func Test_DisableFeedsManager(t *testing.T) { before: func(ctx context.Context, f *gqlTestFramework) { disabledAt := f.Timestamp() f.App.On("GetFeedsService").Return(f.Mocks.feedsSvc) - f.Mocks.feedsSvc.On("DisableManager", mock.Anything, mgrID).Return(&feeds.FeedsManager{ + f.Mocks.feedsSvc.On("DisableManager", mock.Anything, mgrID).Return(&feeds.Manager{ ID: mgrID, Name: name, URI: uri, diff --git a/core/web/resolver/job_proposal_test.go b/core/web/resolver/job_proposal_test.go index 3c09435e56e..16177f2cb97 100644 --- a/core/web/resolver/job_proposal_test.go +++ b/core/web/resolver/job_proposal_test.go @@ -66,7 +66,7 @@ func TestResolver_GetJobProposal(t *testing.T) { name: "success", authenticated: true, before: func(ctx context.Context, f *gqlTestFramework) { - f.Mocks.feedsSvc.On("ListManagersByIDs", mock.Anything, []int64{1}).Return([]feeds.FeedsManager{ + f.Mocks.feedsSvc.On("ListManagersByIDs", mock.Anything, []int64{1}).Return([]feeds.Manager{ { ID: 1, Name: "manager", diff --git a/core/web/resolver/mutation.go b/core/web/resolver/mutation.go index a304a150d3d..bbd83b37915 100644 --- a/core/web/resolver/mutation.go +++ b/core/web/resolver/mutation.go @@ -410,7 +410,7 @@ func (r *Resolver) CreateFeedsManager(ctx context.Context, args struct { publicKey, err := crypto.PublicKeyFromHex(args.Input.PublicKey) if err != nil { - return NewCreateFeedsManagerPayload(nil, nil, map[string]string{ + return NewCreateFeedsManagerPayload(nil, nil, map[string]string{ //nolint:nilerr // validation error surfaced via inputErrs map, not the resolver error return "input/publicKey": "invalid hex value", }), nil } @@ -538,12 +538,12 @@ func (r *Resolver) UpdateFeedsManager(ctx context.Context, args struct { publicKey, err := crypto.PublicKeyFromHex(args.Input.PublicKey) if err != nil { - return NewUpdateFeedsManagerPayload(nil, nil, map[string]string{ + return NewUpdateFeedsManagerPayload(nil, nil, map[string]string{ //nolint:nilerr // validation error surfaced via inputErrs map, not the resolver error return "input/publicKey": "invalid hex value", }), nil } - mgr := &feeds.FeedsManager{ + mgr := &feeds.Manager{ ID: id, URI: args.Input.URI, Name: args.Input.Name, @@ -1007,7 +1007,7 @@ func (r *Resolver) CreateAPIToken(ctx context.Context, args struct { if err != nil { r.App.GetAuditLogger().Audit(audit.APITokenCreateAttemptPasswordMismatch, map[string]any{"user": dbUser.Email}) - return NewCreateAPITokenPayload(nil, map[string]string{ + return NewCreateAPITokenPayload(nil, map[string]string{ //nolint:nilerr // validation error surfaced via inputErrs map, not the resolver error return "password": "incorrect password", }), nil } @@ -1041,7 +1041,7 @@ func (r *Resolver) DeleteAPIToken(ctx context.Context, args struct { if err != nil { r.App.GetAuditLogger().Audit(audit.APITokenDeleteAttemptPasswordMismatch, map[string]any{"user": dbUser.Email}) - return NewDeleteAPITokenPayload(nil, map[string]string{ + return NewDeleteAPITokenPayload(nil, map[string]string{ //nolint:nilerr // validation error surfaced via inputErrs map, not the resolver error return "password": "incorrect password", }), nil } @@ -1248,7 +1248,7 @@ func (r *Resolver) SetGlobalLogLevel(ctx context.Context, args struct { err := lvl.UnmarshalText([]byte(logLvl)) if err != nil { - return NewSetGlobalLogLevelPayload("", map[string]string{ + return NewSetGlobalLogLevelPayload("", map[string]string{ //nolint:nilerr // validation error surfaced via inputErrs map, not the resolver error return "level": "invalid log level", }), nil } diff --git a/core/web/resolver/plugins.go b/core/web/resolver/plugins.go index 187bd7977b7..392261ecdd4 100644 --- a/core/web/resolver/plugins.go +++ b/core/web/resolver/plugins.go @@ -28,7 +28,7 @@ func (r PluginsResolver) Mercury() bool { return r.plugins.Mercury } -// Rebalancer returns the the status of the rebalancer plugin. +// Rebalancer returns the status of the rebalancer plugin. func (r PluginsResolver) Rebalancer() bool { return r.plugins.Rebalancer } diff --git a/core/web/router.go b/core/web/router.go index a89d7f744f7..0be1fa20d2a 100644 --- a/core/web/router.go +++ b/core/web/router.go @@ -35,8 +35,8 @@ import ( "go.opentelemetry.io/contrib/instrumentation/github.com/gin-gonic/gin/otelgin" "go.opentelemetry.io/otel" + "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/chainlink/v2/core/build" - "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/chainlink" "github.com/smartcontractkit/chainlink/v2/core/web/auth" "github.com/smartcontractkit/chainlink/v2/core/web/loader" @@ -160,7 +160,6 @@ func secureMiddleware(tlsRedirect bool, tlsHost string, devWebServer bool) gin.H secureFunc := func() gin.HandlerFunc { return func(c *gin.Context) { err := secureMiddleware.Process(c.Writer, c.Request) - // If there was an error, do not continue. if err != nil { c.Abort() @@ -456,14 +455,16 @@ func v2Routes(app chainlink.Application, r *gin.RouterGroup) { // This is higher because it serves main.js and any static images. There are // 5 assets which must be served, so this allows for 20 requests/min -var staticAssetsRateLimit = int64(100) -var staticAssetsRateLimitPeriod = 1 * time.Minute -var indexRateLimit = int64(20) -var indexRateLimitPeriod = 1 * time.Minute +var ( + staticAssetsRateLimit = int64(100) + staticAssetsRateLimitPeriod = 1 * time.Minute + indexRateLimit = int64(20) + indexRateLimitPeriod = 1 * time.Minute +) // guiAssetRoutes serves the operator UI static files and index.html. Rate // limiting is disabled when in dev mode. -func guiAssetRoutes(engine *gin.Engine, rateLimitingDisabled bool, lggr logger.SugaredLogger) { +func guiAssetRoutes(engine *gin.Engine, rateLimitingDisabled bool, lggr logger.Logger) { // Serve static files var assetsRouterHandlers []gin.HandlerFunc if !rateLimitingDisabled { @@ -520,7 +521,7 @@ func guiAssetRoutes(engine *gin.Engine, rateLimitingDisabled bool, lggr logger.S } return } - defer lggr.ErrorIfFn(file.Close, "Error closing file") + defer logger.Sugared(lggr).ErrorIfFn(file.Close, "Error closing file") http.ServeContent(c.Writer, c.Request, path, time.Time{}, file) }) diff --git a/core/web/router_test.go b/core/web/router_test.go index 07a967b6afc..b493292026f 100644 --- a/core/web/router_test.go +++ b/core/web/router_test.go @@ -33,6 +33,7 @@ func TestTokenAuthRequired_NoCredentials(t *testing.T) { req.Header.Set("Content-Type", web.MediaType) resp, err := http.DefaultClient.Do(req) require.NoError(t, err) + defer resp.Body.Close() assert.Equal(t, http.StatusUnauthorized, resp.StatusCode) } @@ -85,6 +86,7 @@ func TestTokenAuthRequired_TokenCredentials(t *testing.T) { client := clhttptest.NewTestLocalOnlyHTTPClient() resp, err := client.Do(request) require.NoError(t, err) + defer resp.Body.Close() assert.Equal(t, http.StatusOK, resp.StatusCode) } @@ -120,6 +122,7 @@ func TestTokenAuthRequired_BadTokenCredentials(t *testing.T) { client := clhttptest.NewTestLocalOnlyHTTPClient() resp, err := client.Do(request) require.NoError(t, err) + defer resp.Body.Close() assert.Equal(t, http.StatusUnauthorized, resp.StatusCode) } @@ -145,6 +148,7 @@ func TestSessions_RateLimited(t *testing.T) { resp, err := client.Do(request) require.NoError(t, err) assert.Equal(t, http.StatusUnauthorized, resp.StatusCode) + _ = resp.Body.Close() } request, err := http.NewRequestWithContext(ctx, http.MethodPost, ts.URL+"/sessions", bytes.NewBufferString(input)) @@ -152,6 +156,7 @@ func TestSessions_RateLimited(t *testing.T) { resp, err := client.Do(request) require.NoError(t, err) + defer resp.Body.Close() assert.Equal(t, 429, resp.StatusCode) } @@ -174,6 +179,7 @@ func TestRouter_LargePOSTBody(t *testing.T) { resp, err := client.Do(request) require.NoError(t, err) + defer resp.Body.Close() assert.Equal(t, http.StatusRequestEntityTooLarge, resp.StatusCode) } @@ -191,6 +197,7 @@ func TestRouter_GinHelmetHeaders(t *testing.T) { require.NoError(t, err) res, err := http.DefaultClient.Do(req) require.NoError(t, err) + defer res.Body.Close() for _, tt := range []struct { HelmetName string HeaderKey string diff --git a/core/web/sessions_controller_test.go b/core/web/sessions_controller_test.go index 8ae20027a7d..09ce0fddb15 100644 --- a/core/web/sessions_controller_test.go +++ b/core/web/sessions_controller_test.go @@ -159,6 +159,7 @@ func TestSessionsController_Destroy(t *testing.T) { resp, err := client.Do(request) require.NoError(t, err) + defer resp.Body.Close() _, err = app.AuthenticationProvider().AuthorizedUserWithSession(ctx, test.sessionID) require.Error(t, err) @@ -199,6 +200,7 @@ func TestSessionsController_Destroy_ReapSessions(t *testing.T) { resp, err := client.Do(request) require.NoError(t, err) + defer resp.Body.Close() assert.Equal(t, http.StatusOK, resp.StatusCode) gomega.NewWithT(t).Eventually(func() []sessions.Session { diff --git a/core/web/webauthn_controller.go b/core/web/webauthn_controller.go index feeda3ef8b7..84d83fe678e 100644 --- a/core/web/webauthn_controller.go +++ b/core/web/webauthn_controller.go @@ -7,7 +7,6 @@ import ( "github.com/gin-gonic/gin" - "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/logger/audit" "github.com/smartcontractkit/chainlink/v2/core/services/chainlink" "github.com/smartcontractkit/chainlink/v2/core/sessions" @@ -63,7 +62,7 @@ func (w *WebAuthnController) FinishRegistration(c *gin.Context) { ctx := c.Request.Context() user, ok := auth.GetAuthenticatedUser(c) if !ok { - logger.Sugared(w.App.GetLogger()).AssumptionViolationf("failed to obtain current user from context") + w.App.GetLogger().AssumptionViolationf("failed to obtain current user from context") jsonAPIError(c, http.StatusInternalServerError, errors.New("unable to register key")) return } diff --git a/deployment/go.mod b/deployment/go.mod index cd2080772ac..4b8f4b70bb3 100644 --- a/deployment/go.mod +++ b/deployment/go.mod @@ -40,7 +40,7 @@ require ( github.com/sethvargo/go-retry v0.3.0 github.com/smartcontractkit/ccip-contract-examples/chains/evm v0.0.0-20260129135848-c86808ba5cb9 github.com/smartcontractkit/ccip-owner-contracts v0.2.1 - github.com/smartcontractkit/chain-selectors v1.0.109 + github.com/smartcontractkit/chain-selectors v1.0.111 github.com/smartcontractkit/chainlink-aptos v0.0.0-20260828090428-9828cc37ebc2 github.com/smartcontractkit/chainlink-aptos/codec v0.0.0-20260716230027-bd85997bc03c github.com/smartcontractkit/chainlink-aptos/deployment v0.0.0-20260706100550-d43558069754 @@ -57,7 +57,7 @@ require ( github.com/smartcontractkit/chainlink-evm v0.3.4-0.20260917132551-2a2b38e8b744 github.com/smartcontractkit/chainlink-evm/contracts/cre/gobindings v0.0.0-20260403151002-2c91155b5501 github.com/smartcontractkit/chainlink-evm/gethwrappers v0.0.0-20260713161920-de075095648b - github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260804200254-c1accce563a8 + github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260916140808-f5d22b3cb3ee github.com/smartcontractkit/chainlink-protos/job-distributor v0.20.1-0.20260701185448-696c075849ea github.com/smartcontractkit/chainlink-protos/orchestrator v0.11.0 github.com/smartcontractkit/chainlink-solana v1.3.1-0.20260605202330-b5a89c32fdc1 @@ -434,7 +434,7 @@ require ( github.com/sigurn/crc16 v0.0.0-20211026045750-20ab5afb07e3 // indirect github.com/sirupsen/logrus v1.9.4 // indirect github.com/smartcontractkit/chainlink-canton/contracts/v2 v2.0.0 // indirect - github.com/smartcontractkit/chainlink-ccv v0.12.0 // indirect + github.com/smartcontractkit/chainlink-ccv v0.13.1-0.20260918171034-c93b0d2ef3c0 // indirect github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.11-0.20260915184316-2730f1867c92 // indirect github.com/smartcontractkit/chainlink-feeds v0.1.2-0.20250227211209-7cd000095135 // indirect github.com/smartcontractkit/chainlink-framework/chains v0.0.0-20260724153515-bb6a2de39bcb // indirect diff --git a/deployment/go.sum b/deployment/go.sum index 803b58e5e35..77398047cbe 100644 --- a/deployment/go.sum +++ b/deployment/go.sum @@ -1381,8 +1381,8 @@ github.com/smartcontractkit/ccip-contract-examples/chains/evm v0.0.0-20260129135 github.com/smartcontractkit/ccip-contract-examples/chains/evm v0.0.0-20260129135848-c86808ba5cb9/go.mod h1:SYc+BvAALmwsx2zMJIAczIyVNwsiXRIBXmejcTORxGE= github.com/smartcontractkit/ccip-owner-contracts v0.2.1 h1:HgrVtzpyqrPCQiyIeoUKcPK/S+TQI76F3CNU6/hH+6s= github.com/smartcontractkit/ccip-owner-contracts v0.2.1/go.mod h1:dpKtlTVEKohsbhnPe/r1oLFqfq7TP7iKvMaUOiidAaM= -github.com/smartcontractkit/chain-selectors v1.0.109 h1:nM4bESP4OpJSdoHPSwS2+OyG+ef8pow3FAaYK6WXF6g= -github.com/smartcontractkit/chain-selectors v1.0.109/go.mod h1:qy7whtgG5g+7z0jt0nRyii9bLND9m15NZTzuQPkMZ5w= +github.com/smartcontractkit/chain-selectors v1.0.111 h1:urb/qOyRanxDn+Wras+LULHEHSlJ4tYnfeAHzeMBn5U= +github.com/smartcontractkit/chain-selectors v1.0.111/go.mod h1:qy7whtgG5g+7z0jt0nRyii9bLND9m15NZTzuQPkMZ5w= github.com/smartcontractkit/chainlink-aptos v0.0.0-20260828090428-9828cc37ebc2 h1:gIlepiEA6cYoYtIYHV0dsGwrarU5LlXhIZ+AhhPFtRY= github.com/smartcontractkit/chainlink-aptos v0.0.0-20260828090428-9828cc37ebc2/go.mod h1:zxbSVfmTCjxN2LdXeOhZS8T5wh6TVDGC40iliRsF62o= github.com/smartcontractkit/chainlink-aptos/codec v0.0.0-20260716230027-bd85997bc03c h1:aDS7I+SK9mWkDcWlfP5JrDY4NnicC/4KVm30dG7HQaw= @@ -1403,8 +1403,8 @@ github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20260 github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20260908155618-50f521d70e62/go.mod h1:c++Ed0jeYn4w8WIfiAboRwN6ClRRVGglL0qwB/QjJvM= github.com/smartcontractkit/chainlink-ccip/deployment v0.0.0-20260908155618-50f521d70e62 h1:cLO5RdL18z4NWMhsyRh+/2mPcQDu/HsHxXePIfM9jpY= github.com/smartcontractkit/chainlink-ccip/deployment v0.0.0-20260908155618-50f521d70e62/go.mod h1:Dm/Abz0vr7F2v9TygUX947q8HIwJEJikDfSdanX1Cic= -github.com/smartcontractkit/chainlink-ccv v0.12.0 h1:/EbL7S96ItC3YF9pZ/fihbxugYxT1xxLSQSFJT4JQoQ= -github.com/smartcontractkit/chainlink-ccv v0.12.0/go.mod h1:yijeTgli1K0e1noV/06/etKFxnYz8kBIe3IVXBaGnQw= +github.com/smartcontractkit/chainlink-ccv v0.13.1-0.20260918171034-c93b0d2ef3c0 h1:3f+Ijgr0vghawMUAitgFILQpt4KsoYHGv1Zb/YBeeQM= +github.com/smartcontractkit/chainlink-ccv v0.13.1-0.20260918171034-c93b0d2ef3c0/go.mod h1:gX7FJzSnGQx4RAlsn2rRW8IQBlEFZYiXFXEEB5jnQgA= github.com/smartcontractkit/chainlink-common v0.11.2-0.20260917115705-1d3a14a9b049 h1:WebE9HTubitMC5xq+xCAArEI+oBLekVOoxYnCkB8whI= github.com/smartcontractkit/chainlink-common v0.11.2-0.20260917115705-1d3a14a9b049/go.mod h1:3CaCxSyZmgWl1PhxneFSZqOfN7DF2VnHML0bTfiDNIo= github.com/smartcontractkit/chainlink-common/keystore v1.3.1-0.20260903141829-ef07b52a737d h1:M9xuiIvdiHtim4nlxCVajyC/Mk63tAg9ESWb/biAhNA= @@ -1441,8 +1441,8 @@ github.com/smartcontractkit/chainlink-protos/chainlink-ccv/message-rules v0.0.0- github.com/smartcontractkit/chainlink-protos/chainlink-ccv/message-rules v0.0.0-20260505131349-78e491b80735/go.mod h1:zAJq6Tpkx5AdFUwW67dIYnW+Bdf50drCCpMR81Qxb4E= github.com/smartcontractkit/chainlink-protos/chainlink-ccv/verifier v0.0.0-20251211142334-5c3421fe2c8d h1:AJy55QJ/pBhXkZjc7N+ATnWfxrcjq9BI9DmdtdjwDUQ= github.com/smartcontractkit/chainlink-protos/chainlink-ccv/verifier v0.0.0-20251211142334-5c3421fe2c8d/go.mod h1:5JdppgngCOUS76p61zCinSCgOhPeYQ+OcDUuome5THQ= -github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260804200254-c1accce563a8 h1:PuLjldCKeHUZf9JJzsX8aKEzqIJOpoY3wPeuGfm47C8= -github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260804200254-c1accce563a8/go.mod h1:/i8hjTPFdVWHiY+QjeSiVS2Z3GB3WAZznGgXHstC02E= +github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260916140808-f5d22b3cb3ee h1:drewC9gPerS+FDeaaSfG7YL1Zzt/0Jr6YQ1YvHXzz04= +github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260916140808-f5d22b3cb3ee/go.mod h1:/i8hjTPFdVWHiY+QjeSiVS2Z3GB3WAZznGgXHstC02E= github.com/smartcontractkit/chainlink-protos/data-feeds v0.1.1-0.20260501174546-2e8846986b36 h1:SG+wAsNyAcA6Kk19ljuxi3HK9Ll2lpHik8OKoY4x7A0= github.com/smartcontractkit/chainlink-protos/data-feeds v0.1.1-0.20260501174546-2e8846986b36/go.mod h1:vL1bDgPSJjV0EqHYs4dDlR+EEE0cJchgvGLYXhwIjXY= github.com/smartcontractkit/chainlink-protos/job-distributor v0.20.1-0.20260701185448-696c075849ea h1:gdA7tZgcRYMq3ryi7uNopYgn6s26g04Haw9SdmLRHzE= diff --git a/go.mod b/go.mod index 793cd8dd2c0..fb8f7af8011 100644 --- a/go.mod +++ b/go.mod @@ -75,13 +75,13 @@ require ( github.com/scylladb/go-reflectx v1.0.1 github.com/shirou/gopsutil/v3 v3.24.3 github.com/shopspring/decimal v1.4.0 - github.com/smartcontractkit/chain-selectors v1.0.109 + github.com/smartcontractkit/chain-selectors v1.0.111 github.com/smartcontractkit/chainlink-aptos/codec v0.0.0-20260716230027-bd85997bc03c github.com/smartcontractkit/chainlink-ccip v0.1.1-solana.0.20260908155618-50f521d70e62 github.com/smartcontractkit/chainlink-ccip/chains/evm v0.0.0-20260908164107-3de1349d970b github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20260908155618-50f521d70e62 github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20260908155618-50f521d70e62 - github.com/smartcontractkit/chainlink-ccv v0.12.0 + github.com/smartcontractkit/chainlink-ccv v0.13.1-0.20260918171034-c93b0d2ef3c0 github.com/smartcontractkit/chainlink-common v0.11.2-0.20260917115705-1d3a14a9b049 github.com/smartcontractkit/chainlink-common/keystore v1.3.1-0.20260903141829-ef07b52a737d github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.11-0.20260915184316-2730f1867c92 @@ -93,7 +93,7 @@ require ( github.com/smartcontractkit/chainlink-framework/chains v0.0.0-20260724153515-bb6a2de39bcb github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20260625152110-9afcf56e4053 github.com/smartcontractkit/chainlink-protos/billing/go v0.0.0-20251024234028-0988426d98f4 - github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260804191526-b7a850ae7648 + github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260916140808-f5d22b3cb3ee github.com/smartcontractkit/chainlink-protos/data-feeds v0.1.1-0.20260501174546-2e8846986b36 github.com/smartcontractkit/chainlink-protos/linking-service/go v0.0.0-20260512230622-65f10f4cd305 github.com/smartcontractkit/chainlink-protos/metering/go v0.0.0-20260729184203-90b4cdd48536 diff --git a/go.sum b/go.sum index 8dbdc7c6ad4..9b28e3f3746 100644 --- a/go.sum +++ b/go.sum @@ -1092,8 +1092,8 @@ github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrf github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/sirupsen/logrus v1.9.4 h1:TsZE7l11zFCLZnZ+teH4Umoq5BhEIfIzfRDZ1Uzql2w= github.com/sirupsen/logrus v1.9.4/go.mod h1:ftWc9WdOfJ0a92nsE2jF5u5ZwH8Bv2zdeOC42RjbV2g= -github.com/smartcontractkit/chain-selectors v1.0.109 h1:nM4bESP4OpJSdoHPSwS2+OyG+ef8pow3FAaYK6WXF6g= -github.com/smartcontractkit/chain-selectors v1.0.109/go.mod h1:qy7whtgG5g+7z0jt0nRyii9bLND9m15NZTzuQPkMZ5w= +github.com/smartcontractkit/chain-selectors v1.0.111 h1:urb/qOyRanxDn+Wras+LULHEHSlJ4tYnfeAHzeMBn5U= +github.com/smartcontractkit/chain-selectors v1.0.111/go.mod h1:qy7whtgG5g+7z0jt0nRyii9bLND9m15NZTzuQPkMZ5w= github.com/smartcontractkit/chainlink-aptos/codec v0.0.0-20260716230027-bd85997bc03c h1:aDS7I+SK9mWkDcWlfP5JrDY4NnicC/4KVm30dG7HQaw= github.com/smartcontractkit/chainlink-aptos/codec v0.0.0-20260716230027-bd85997bc03c/go.mod h1:/ABThVk5DzhpsO1A4io8C6cAmqpF8RzgQDlGj98hke0= github.com/smartcontractkit/chainlink-ccip v0.1.1-solana.0.20260908155618-50f521d70e62 h1:nQg1GNpy3f0synbDhGUXlhNWQcwluUEAq1ua6NprPLs= @@ -1104,8 +1104,8 @@ github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20260908155618-5 github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20260908155618-50f521d70e62/go.mod h1:5snE6Mg2+wYIddLZ5NIUPno3mYa9edyV3EyXJnE54vw= github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20260908155618-50f521d70e62 h1:psQpY4BeoAH50S7QTX5fUhUYeYnM88jldPXRPXpXuvU= github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20260908155618-50f521d70e62/go.mod h1:c++Ed0jeYn4w8WIfiAboRwN6ClRRVGglL0qwB/QjJvM= -github.com/smartcontractkit/chainlink-ccv v0.12.0 h1:/EbL7S96ItC3YF9pZ/fihbxugYxT1xxLSQSFJT4JQoQ= -github.com/smartcontractkit/chainlink-ccv v0.12.0/go.mod h1:yijeTgli1K0e1noV/06/etKFxnYz8kBIe3IVXBaGnQw= +github.com/smartcontractkit/chainlink-ccv v0.13.1-0.20260918171034-c93b0d2ef3c0 h1:3f+Ijgr0vghawMUAitgFILQpt4KsoYHGv1Zb/YBeeQM= +github.com/smartcontractkit/chainlink-ccv v0.13.1-0.20260918171034-c93b0d2ef3c0/go.mod h1:gX7FJzSnGQx4RAlsn2rRW8IQBlEFZYiXFXEEB5jnQgA= github.com/smartcontractkit/chainlink-common v0.11.2-0.20260917115705-1d3a14a9b049 h1:WebE9HTubitMC5xq+xCAArEI+oBLekVOoxYnCkB8whI= github.com/smartcontractkit/chainlink-common v0.11.2-0.20260917115705-1d3a14a9b049/go.mod h1:3CaCxSyZmgWl1PhxneFSZqOfN7DF2VnHML0bTfiDNIo= github.com/smartcontractkit/chainlink-common/keystore v1.3.1-0.20260903141829-ef07b52a737d h1:M9xuiIvdiHtim4nlxCVajyC/Mk63tAg9ESWb/biAhNA= @@ -1140,8 +1140,8 @@ github.com/smartcontractkit/chainlink-protos/chainlink-ccv/message-rules v0.0.0- github.com/smartcontractkit/chainlink-protos/chainlink-ccv/message-rules v0.0.0-20260505131349-78e491b80735/go.mod h1:zAJq6Tpkx5AdFUwW67dIYnW+Bdf50drCCpMR81Qxb4E= github.com/smartcontractkit/chainlink-protos/chainlink-ccv/verifier v0.0.0-20251211142334-5c3421fe2c8d h1:AJy55QJ/pBhXkZjc7N+ATnWfxrcjq9BI9DmdtdjwDUQ= github.com/smartcontractkit/chainlink-protos/chainlink-ccv/verifier v0.0.0-20251211142334-5c3421fe2c8d/go.mod h1:5JdppgngCOUS76p61zCinSCgOhPeYQ+OcDUuome5THQ= -github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260804191526-b7a850ae7648 h1:WEUMkKQPAgcNMRgES6CBWrRUiII+HKEWQjulKQBSuMA= -github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260804191526-b7a850ae7648/go.mod h1:/i8hjTPFdVWHiY+QjeSiVS2Z3GB3WAZznGgXHstC02E= +github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260916140808-f5d22b3cb3ee h1:drewC9gPerS+FDeaaSfG7YL1Zzt/0Jr6YQ1YvHXzz04= +github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260916140808-f5d22b3cb3ee/go.mod h1:/i8hjTPFdVWHiY+QjeSiVS2Z3GB3WAZznGgXHstC02E= github.com/smartcontractkit/chainlink-protos/data-feeds v0.1.1-0.20260501174546-2e8846986b36 h1:SG+wAsNyAcA6Kk19ljuxi3HK9Ll2lpHik8OKoY4x7A0= github.com/smartcontractkit/chainlink-protos/data-feeds v0.1.1-0.20260501174546-2e8846986b36/go.mod h1:vL1bDgPSJjV0EqHYs4dDlR+EEE0cJchgvGLYXhwIjXY= github.com/smartcontractkit/chainlink-protos/linking-service/go v0.0.0-20260512230622-65f10f4cd305 h1:NJdGFhzT6zMaTod4QkBqVD2sg0I25iw1boOYtTpEwRo= diff --git a/integration-tests/go.mod b/integration-tests/go.mod index 393e9dcaebe..3d8a19a2bc1 100644 --- a/integration-tests/go.mod +++ b/integration-tests/go.mod @@ -27,7 +27,7 @@ require ( github.com/pkg/errors v0.9.1 github.com/rs/zerolog v1.35.1 github.com/segmentio/ksuid v1.0.4 - github.com/smartcontractkit/chain-selectors v1.0.109 + github.com/smartcontractkit/chain-selectors v1.0.111 github.com/smartcontractkit/chainlink-aptos v0.0.0-20260828090428-9828cc37ebc2 github.com/smartcontractkit/chainlink-ccip v0.1.1-solana.0.20260908155618-50f521d70e62 github.com/smartcontractkit/chainlink-ccip/chains/evm v0.0.0-20260908164107-3de1349d970b @@ -417,7 +417,7 @@ require ( github.com/smartcontractkit/chainlink-aptos/codec v0.0.0-20260716230027-bd85997bc03c // indirect github.com/smartcontractkit/chainlink-aptos/deployment v0.0.0-20260706100550-d43558069754 github.com/smartcontractkit/chainlink-ccip/deployment v0.0.0-20260908155618-50f521d70e62 // indirect - github.com/smartcontractkit/chainlink-ccv v0.12.0 // indirect + github.com/smartcontractkit/chainlink-ccv v0.13.1-0.20260918171034-c93b0d2ef3c0 // indirect github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.11-0.20260915184316-2730f1867c92 // indirect github.com/smartcontractkit/chainlink-data-streams v1.1.1 // indirect github.com/smartcontractkit/chainlink-evm/contracts/cre/gobindings v0.0.0-20260403151002-2c91155b5501 // indirect @@ -431,7 +431,7 @@ require ( github.com/smartcontractkit/chainlink-protos/chainlink-ccv/message-discovery v0.0.0-20251211142334-5c3421fe2c8d // indirect github.com/smartcontractkit/chainlink-protos/chainlink-ccv/message-rules v0.0.0-20260505131349-78e491b80735 // indirect github.com/smartcontractkit/chainlink-protos/chainlink-ccv/verifier v0.0.0-20251211142334-5c3421fe2c8d // indirect - github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260804200254-c1accce563a8 // indirect + github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260916140808-f5d22b3cb3ee // indirect github.com/smartcontractkit/chainlink-protos/data-feeds v0.1.1-0.20260501174546-2e8846986b36 // indirect github.com/smartcontractkit/chainlink-protos/linking-service/go v0.0.0-20260512230622-65f10f4cd305 // indirect github.com/smartcontractkit/chainlink-protos/node-platform v0.2.1-0.20260908085225-914a0fc9200e // indirect diff --git a/integration-tests/go.sum b/integration-tests/go.sum index acee8cfc231..7466f2be2b0 100644 --- a/integration-tests/go.sum +++ b/integration-tests/go.sum @@ -1370,8 +1370,8 @@ github.com/smartcontractkit/ccip-contract-examples/chains/evm v0.0.0-20260129135 github.com/smartcontractkit/ccip-contract-examples/chains/evm v0.0.0-20260129135848-c86808ba5cb9/go.mod h1:SYc+BvAALmwsx2zMJIAczIyVNwsiXRIBXmejcTORxGE= github.com/smartcontractkit/ccip-owner-contracts v0.2.1 h1:HgrVtzpyqrPCQiyIeoUKcPK/S+TQI76F3CNU6/hH+6s= github.com/smartcontractkit/ccip-owner-contracts v0.2.1/go.mod h1:dpKtlTVEKohsbhnPe/r1oLFqfq7TP7iKvMaUOiidAaM= -github.com/smartcontractkit/chain-selectors v1.0.109 h1:nM4bESP4OpJSdoHPSwS2+OyG+ef8pow3FAaYK6WXF6g= -github.com/smartcontractkit/chain-selectors v1.0.109/go.mod h1:qy7whtgG5g+7z0jt0nRyii9bLND9m15NZTzuQPkMZ5w= +github.com/smartcontractkit/chain-selectors v1.0.111 h1:urb/qOyRanxDn+Wras+LULHEHSlJ4tYnfeAHzeMBn5U= +github.com/smartcontractkit/chain-selectors v1.0.111/go.mod h1:qy7whtgG5g+7z0jt0nRyii9bLND9m15NZTzuQPkMZ5w= github.com/smartcontractkit/chainlink-aptos v0.0.0-20260828090428-9828cc37ebc2 h1:gIlepiEA6cYoYtIYHV0dsGwrarU5LlXhIZ+AhhPFtRY= github.com/smartcontractkit/chainlink-aptos v0.0.0-20260828090428-9828cc37ebc2/go.mod h1:zxbSVfmTCjxN2LdXeOhZS8T5wh6TVDGC40iliRsF62o= github.com/smartcontractkit/chainlink-aptos/codec v0.0.0-20260716230027-bd85997bc03c h1:aDS7I+SK9mWkDcWlfP5JrDY4NnicC/4KVm30dG7HQaw= @@ -1392,8 +1392,8 @@ github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20260 github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20260908155618-50f521d70e62/go.mod h1:c++Ed0jeYn4w8WIfiAboRwN6ClRRVGglL0qwB/QjJvM= github.com/smartcontractkit/chainlink-ccip/deployment v0.0.0-20260908155618-50f521d70e62 h1:cLO5RdL18z4NWMhsyRh+/2mPcQDu/HsHxXePIfM9jpY= github.com/smartcontractkit/chainlink-ccip/deployment v0.0.0-20260908155618-50f521d70e62/go.mod h1:Dm/Abz0vr7F2v9TygUX947q8HIwJEJikDfSdanX1Cic= -github.com/smartcontractkit/chainlink-ccv v0.12.0 h1:/EbL7S96ItC3YF9pZ/fihbxugYxT1xxLSQSFJT4JQoQ= -github.com/smartcontractkit/chainlink-ccv v0.12.0/go.mod h1:yijeTgli1K0e1noV/06/etKFxnYz8kBIe3IVXBaGnQw= +github.com/smartcontractkit/chainlink-ccv v0.13.1-0.20260918171034-c93b0d2ef3c0 h1:3f+Ijgr0vghawMUAitgFILQpt4KsoYHGv1Zb/YBeeQM= +github.com/smartcontractkit/chainlink-ccv v0.13.1-0.20260918171034-c93b0d2ef3c0/go.mod h1:gX7FJzSnGQx4RAlsn2rRW8IQBlEFZYiXFXEEB5jnQgA= github.com/smartcontractkit/chainlink-common v0.11.2-0.20260917115705-1d3a14a9b049 h1:WebE9HTubitMC5xq+xCAArEI+oBLekVOoxYnCkB8whI= github.com/smartcontractkit/chainlink-common v0.11.2-0.20260917115705-1d3a14a9b049/go.mod h1:3CaCxSyZmgWl1PhxneFSZqOfN7DF2VnHML0bTfiDNIo= github.com/smartcontractkit/chainlink-common/keystore v1.3.1-0.20260903141829-ef07b52a737d h1:M9xuiIvdiHtim4nlxCVajyC/Mk63tAg9ESWb/biAhNA= @@ -1430,8 +1430,8 @@ github.com/smartcontractkit/chainlink-protos/chainlink-ccv/message-rules v0.0.0- github.com/smartcontractkit/chainlink-protos/chainlink-ccv/message-rules v0.0.0-20260505131349-78e491b80735/go.mod h1:zAJq6Tpkx5AdFUwW67dIYnW+Bdf50drCCpMR81Qxb4E= github.com/smartcontractkit/chainlink-protos/chainlink-ccv/verifier v0.0.0-20251211142334-5c3421fe2c8d h1:AJy55QJ/pBhXkZjc7N+ATnWfxrcjq9BI9DmdtdjwDUQ= github.com/smartcontractkit/chainlink-protos/chainlink-ccv/verifier v0.0.0-20251211142334-5c3421fe2c8d/go.mod h1:5JdppgngCOUS76p61zCinSCgOhPeYQ+OcDUuome5THQ= -github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260804200254-c1accce563a8 h1:PuLjldCKeHUZf9JJzsX8aKEzqIJOpoY3wPeuGfm47C8= -github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260804200254-c1accce563a8/go.mod h1:/i8hjTPFdVWHiY+QjeSiVS2Z3GB3WAZznGgXHstC02E= +github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260916140808-f5d22b3cb3ee h1:drewC9gPerS+FDeaaSfG7YL1Zzt/0Jr6YQ1YvHXzz04= +github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260916140808-f5d22b3cb3ee/go.mod h1:/i8hjTPFdVWHiY+QjeSiVS2Z3GB3WAZznGgXHstC02E= github.com/smartcontractkit/chainlink-protos/data-feeds v0.1.1-0.20260501174546-2e8846986b36 h1:SG+wAsNyAcA6Kk19ljuxi3HK9Ll2lpHik8OKoY4x7A0= github.com/smartcontractkit/chainlink-protos/data-feeds v0.1.1-0.20260501174546-2e8846986b36/go.mod h1:vL1bDgPSJjV0EqHYs4dDlR+EEE0cJchgvGLYXhwIjXY= github.com/smartcontractkit/chainlink-protos/job-distributor v0.20.1-0.20260701185448-696c075849ea h1:gdA7tZgcRYMq3ryi7uNopYgn6s26g04Haw9SdmLRHzE= diff --git a/integration-tests/load/go.mod b/integration-tests/load/go.mod index 47a859d715d..b4d7901c2fa 100644 --- a/integration-tests/load/go.mod +++ b/integration-tests/load/go.mod @@ -18,7 +18,7 @@ require ( github.com/ethereum/go-ethereum v1.17.4 github.com/gagliardetto/solana-go v1.23.0 github.com/rs/zerolog v1.35.1 - github.com/smartcontractkit/chain-selectors v1.0.109 + github.com/smartcontractkit/chain-selectors v1.0.111 github.com/smartcontractkit/chainlink-aptos v0.0.0-20260828090428-9828cc37ebc2 github.com/smartcontractkit/chainlink-ccip v0.1.1-solana.0.20260908155618-50f521d70e62 github.com/smartcontractkit/chainlink-ccip/chains/evm v0.0.0-20260908164107-3de1349d970b @@ -479,7 +479,7 @@ require ( github.com/smartcontractkit/chainlink-canton/contracts/v2 v2.0.0 // indirect github.com/smartcontractkit/chainlink-ccip/chains/solana/deployment v0.0.0-20260908155618-50f521d70e62 // indirect github.com/smartcontractkit/chainlink-ccip/deployment v0.0.0-20260908155618-50f521d70e62 // indirect - github.com/smartcontractkit/chainlink-ccv v0.12.0 // indirect + github.com/smartcontractkit/chainlink-ccv v0.13.1-0.20260918171034-c93b0d2ef3c0 // indirect github.com/smartcontractkit/chainlink-common/keystore v1.3.1-0.20260903141829-ef07b52a737d // indirect github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.11-0.20260915184316-2730f1867c92 // indirect github.com/smartcontractkit/chainlink-data-streams v1.1.1 // indirect @@ -495,7 +495,7 @@ require ( github.com/smartcontractkit/chainlink-protos/chainlink-ccv/message-discovery v0.0.0-20251211142334-5c3421fe2c8d // indirect github.com/smartcontractkit/chainlink-protos/chainlink-ccv/message-rules v0.0.0-20260505131349-78e491b80735 // indirect github.com/smartcontractkit/chainlink-protos/chainlink-ccv/verifier v0.0.0-20251211142334-5c3421fe2c8d // indirect - github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260804200254-c1accce563a8 // indirect + github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260916140808-f5d22b3cb3ee // indirect github.com/smartcontractkit/chainlink-protos/data-feeds v0.1.1-0.20260501174546-2e8846986b36 // indirect github.com/smartcontractkit/chainlink-protos/job-distributor v0.20.1-0.20260701185448-696c075849ea // indirect github.com/smartcontractkit/chainlink-protos/linking-service/go v0.0.0-20260512230622-65f10f4cd305 // indirect diff --git a/integration-tests/load/go.sum b/integration-tests/load/go.sum index c6725a2ae14..49fe2a412a0 100644 --- a/integration-tests/load/go.sum +++ b/integration-tests/load/go.sum @@ -1608,8 +1608,8 @@ github.com/smartcontractkit/ccip-contract-examples/chains/evm v0.0.0-20260129135 github.com/smartcontractkit/ccip-contract-examples/chains/evm v0.0.0-20260129135848-c86808ba5cb9/go.mod h1:SYc+BvAALmwsx2zMJIAczIyVNwsiXRIBXmejcTORxGE= github.com/smartcontractkit/ccip-owner-contracts v0.2.1 h1:HgrVtzpyqrPCQiyIeoUKcPK/S+TQI76F3CNU6/hH+6s= github.com/smartcontractkit/ccip-owner-contracts v0.2.1/go.mod h1:dpKtlTVEKohsbhnPe/r1oLFqfq7TP7iKvMaUOiidAaM= -github.com/smartcontractkit/chain-selectors v1.0.109 h1:nM4bESP4OpJSdoHPSwS2+OyG+ef8pow3FAaYK6WXF6g= -github.com/smartcontractkit/chain-selectors v1.0.109/go.mod h1:qy7whtgG5g+7z0jt0nRyii9bLND9m15NZTzuQPkMZ5w= +github.com/smartcontractkit/chain-selectors v1.0.111 h1:urb/qOyRanxDn+Wras+LULHEHSlJ4tYnfeAHzeMBn5U= +github.com/smartcontractkit/chain-selectors v1.0.111/go.mod h1:qy7whtgG5g+7z0jt0nRyii9bLND9m15NZTzuQPkMZ5w= github.com/smartcontractkit/chainlink-aptos v0.0.0-20260828090428-9828cc37ebc2 h1:gIlepiEA6cYoYtIYHV0dsGwrarU5LlXhIZ+AhhPFtRY= github.com/smartcontractkit/chainlink-aptos v0.0.0-20260828090428-9828cc37ebc2/go.mod h1:zxbSVfmTCjxN2LdXeOhZS8T5wh6TVDGC40iliRsF62o= github.com/smartcontractkit/chainlink-aptos/codec v0.0.0-20260716230027-bd85997bc03c h1:aDS7I+SK9mWkDcWlfP5JrDY4NnicC/4KVm30dG7HQaw= @@ -1630,8 +1630,8 @@ github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20260 github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20260908155618-50f521d70e62/go.mod h1:c++Ed0jeYn4w8WIfiAboRwN6ClRRVGglL0qwB/QjJvM= github.com/smartcontractkit/chainlink-ccip/deployment v0.0.0-20260908155618-50f521d70e62 h1:cLO5RdL18z4NWMhsyRh+/2mPcQDu/HsHxXePIfM9jpY= github.com/smartcontractkit/chainlink-ccip/deployment v0.0.0-20260908155618-50f521d70e62/go.mod h1:Dm/Abz0vr7F2v9TygUX947q8HIwJEJikDfSdanX1Cic= -github.com/smartcontractkit/chainlink-ccv v0.12.0 h1:/EbL7S96ItC3YF9pZ/fihbxugYxT1xxLSQSFJT4JQoQ= -github.com/smartcontractkit/chainlink-ccv v0.12.0/go.mod h1:yijeTgli1K0e1noV/06/etKFxnYz8kBIe3IVXBaGnQw= +github.com/smartcontractkit/chainlink-ccv v0.13.1-0.20260918171034-c93b0d2ef3c0 h1:3f+Ijgr0vghawMUAitgFILQpt4KsoYHGv1Zb/YBeeQM= +github.com/smartcontractkit/chainlink-ccv v0.13.1-0.20260918171034-c93b0d2ef3c0/go.mod h1:gX7FJzSnGQx4RAlsn2rRW8IQBlEFZYiXFXEEB5jnQgA= github.com/smartcontractkit/chainlink-common v0.11.2-0.20260917115705-1d3a14a9b049 h1:WebE9HTubitMC5xq+xCAArEI+oBLekVOoxYnCkB8whI= github.com/smartcontractkit/chainlink-common v0.11.2-0.20260917115705-1d3a14a9b049/go.mod h1:3CaCxSyZmgWl1PhxneFSZqOfN7DF2VnHML0bTfiDNIo= github.com/smartcontractkit/chainlink-common/keystore v1.3.1-0.20260903141829-ef07b52a737d h1:M9xuiIvdiHtim4nlxCVajyC/Mk63tAg9ESWb/biAhNA= @@ -1668,8 +1668,8 @@ github.com/smartcontractkit/chainlink-protos/chainlink-ccv/message-rules v0.0.0- github.com/smartcontractkit/chainlink-protos/chainlink-ccv/message-rules v0.0.0-20260505131349-78e491b80735/go.mod h1:zAJq6Tpkx5AdFUwW67dIYnW+Bdf50drCCpMR81Qxb4E= github.com/smartcontractkit/chainlink-protos/chainlink-ccv/verifier v0.0.0-20251211142334-5c3421fe2c8d h1:AJy55QJ/pBhXkZjc7N+ATnWfxrcjq9BI9DmdtdjwDUQ= github.com/smartcontractkit/chainlink-protos/chainlink-ccv/verifier v0.0.0-20251211142334-5c3421fe2c8d/go.mod h1:5JdppgngCOUS76p61zCinSCgOhPeYQ+OcDUuome5THQ= -github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260804200254-c1accce563a8 h1:PuLjldCKeHUZf9JJzsX8aKEzqIJOpoY3wPeuGfm47C8= -github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260804200254-c1accce563a8/go.mod h1:/i8hjTPFdVWHiY+QjeSiVS2Z3GB3WAZznGgXHstC02E= +github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260916140808-f5d22b3cb3ee h1:drewC9gPerS+FDeaaSfG7YL1Zzt/0Jr6YQ1YvHXzz04= +github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260916140808-f5d22b3cb3ee/go.mod h1:/i8hjTPFdVWHiY+QjeSiVS2Z3GB3WAZznGgXHstC02E= github.com/smartcontractkit/chainlink-protos/data-feeds v0.1.1-0.20260501174546-2e8846986b36 h1:SG+wAsNyAcA6Kk19ljuxi3HK9Ll2lpHik8OKoY4x7A0= github.com/smartcontractkit/chainlink-protos/data-feeds v0.1.1-0.20260501174546-2e8846986b36/go.mod h1:vL1bDgPSJjV0EqHYs4dDlR+EEE0cJchgvGLYXhwIjXY= github.com/smartcontractkit/chainlink-protos/job-distributor v0.20.1-0.20260701185448-696c075849ea h1:gdA7tZgcRYMq3ryi7uNopYgn6s26g04Haw9SdmLRHzE= diff --git a/system-tests/lib/go.mod b/system-tests/lib/go.mod index b6f69273881..f1ba1bc2eb1 100644 --- a/system-tests/lib/go.mod +++ b/system-tests/lib/go.mod @@ -34,7 +34,7 @@ require ( github.com/rs/zerolog v1.35.1 github.com/scylladb/go-reflectx v1.0.1 github.com/sethvargo/go-retry v0.3.0 - github.com/smartcontractkit/chain-selectors v1.0.109 + github.com/smartcontractkit/chain-selectors v1.0.111 github.com/smartcontractkit/chainlink-aptos v0.0.0-20260828090428-9828cc37ebc2 github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20260908155618-50f521d70e62 github.com/smartcontractkit/chainlink-common v0.11.2-0.20260917115705-1d3a14a9b049 @@ -43,7 +43,7 @@ require ( github.com/smartcontractkit/chainlink-deployments-framework v0.122.2 github.com/smartcontractkit/chainlink-evm v0.3.4-0.20260917132551-2a2b38e8b744 github.com/smartcontractkit/chainlink-evm/gethwrappers v0.0.0-20260713161920-de075095648b - github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260804200254-c1accce563a8 + github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260916140808-f5d22b3cb3ee github.com/smartcontractkit/chainlink-protos/job-distributor v0.20.1-0.20260701185448-696c075849ea github.com/smartcontractkit/chainlink-protos/linking-service/go v0.0.0-20260512230622-65f10f4cd305 github.com/smartcontractkit/chainlink-protos/workflows/go v0.0.0-20260821155228-fa1d775e2138 @@ -495,7 +495,7 @@ require ( github.com/smartcontractkit/chainlink-ccip v0.1.1-solana.0.20260908155618-50f521d70e62 // indirect github.com/smartcontractkit/chainlink-ccip/chains/evm v0.0.0-20260908164107-3de1349d970b // indirect github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20260908155618-50f521d70e62 // indirect - github.com/smartcontractkit/chainlink-ccv v0.12.0 // indirect + github.com/smartcontractkit/chainlink-ccv v0.13.1-0.20260918171034-c93b0d2ef3c0 // indirect github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.11-0.20260915184316-2730f1867c92 // indirect github.com/smartcontractkit/chainlink-data-streams v1.1.1 // indirect github.com/smartcontractkit/chainlink-evm/contracts/cre/gobindings v0.0.0-20260403151002-2c91155b5501 // indirect diff --git a/system-tests/lib/go.sum b/system-tests/lib/go.sum index 94e7b105aed..484d0bf7bf0 100644 --- a/system-tests/lib/go.sum +++ b/system-tests/lib/go.sum @@ -1636,8 +1636,8 @@ github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966 h1:JIAuq3EE github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966/go.mod h1:sUM3LWHvSMaG192sy56D9F7CNvL7jUJVXoqM1QKLnog= github.com/smartcontractkit/ccip-owner-contracts v0.2.1 h1:HgrVtzpyqrPCQiyIeoUKcPK/S+TQI76F3CNU6/hH+6s= github.com/smartcontractkit/ccip-owner-contracts v0.2.1/go.mod h1:dpKtlTVEKohsbhnPe/r1oLFqfq7TP7iKvMaUOiidAaM= -github.com/smartcontractkit/chain-selectors v1.0.109 h1:nM4bESP4OpJSdoHPSwS2+OyG+ef8pow3FAaYK6WXF6g= -github.com/smartcontractkit/chain-selectors v1.0.109/go.mod h1:qy7whtgG5g+7z0jt0nRyii9bLND9m15NZTzuQPkMZ5w= +github.com/smartcontractkit/chain-selectors v1.0.111 h1:urb/qOyRanxDn+Wras+LULHEHSlJ4tYnfeAHzeMBn5U= +github.com/smartcontractkit/chain-selectors v1.0.111/go.mod h1:qy7whtgG5g+7z0jt0nRyii9bLND9m15NZTzuQPkMZ5w= github.com/smartcontractkit/chainlink-aptos v0.0.0-20260828090428-9828cc37ebc2 h1:gIlepiEA6cYoYtIYHV0dsGwrarU5LlXhIZ+AhhPFtRY= github.com/smartcontractkit/chainlink-aptos v0.0.0-20260828090428-9828cc37ebc2/go.mod h1:zxbSVfmTCjxN2LdXeOhZS8T5wh6TVDGC40iliRsF62o= github.com/smartcontractkit/chainlink-aptos/codec v0.0.0-20260716230027-bd85997bc03c h1:aDS7I+SK9mWkDcWlfP5JrDY4NnicC/4KVm30dG7HQaw= @@ -1652,8 +1652,8 @@ github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20260908155618-5 github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20260908155618-50f521d70e62/go.mod h1:5snE6Mg2+wYIddLZ5NIUPno3mYa9edyV3EyXJnE54vw= github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20260908155618-50f521d70e62 h1:psQpY4BeoAH50S7QTX5fUhUYeYnM88jldPXRPXpXuvU= github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20260908155618-50f521d70e62/go.mod h1:c++Ed0jeYn4w8WIfiAboRwN6ClRRVGglL0qwB/QjJvM= -github.com/smartcontractkit/chainlink-ccv v0.12.0 h1:/EbL7S96ItC3YF9pZ/fihbxugYxT1xxLSQSFJT4JQoQ= -github.com/smartcontractkit/chainlink-ccv v0.12.0/go.mod h1:yijeTgli1K0e1noV/06/etKFxnYz8kBIe3IVXBaGnQw= +github.com/smartcontractkit/chainlink-ccv v0.13.1-0.20260918171034-c93b0d2ef3c0 h1:3f+Ijgr0vghawMUAitgFILQpt4KsoYHGv1Zb/YBeeQM= +github.com/smartcontractkit/chainlink-ccv v0.13.1-0.20260918171034-c93b0d2ef3c0/go.mod h1:gX7FJzSnGQx4RAlsn2rRW8IQBlEFZYiXFXEEB5jnQgA= github.com/smartcontractkit/chainlink-common v0.11.2-0.20260917115705-1d3a14a9b049 h1:WebE9HTubitMC5xq+xCAArEI+oBLekVOoxYnCkB8whI= github.com/smartcontractkit/chainlink-common v0.11.2-0.20260917115705-1d3a14a9b049/go.mod h1:3CaCxSyZmgWl1PhxneFSZqOfN7DF2VnHML0bTfiDNIo= github.com/smartcontractkit/chainlink-common/keystore v1.3.1-0.20260903141829-ef07b52a737d h1:M9xuiIvdiHtim4nlxCVajyC/Mk63tAg9ESWb/biAhNA= @@ -1692,8 +1692,8 @@ github.com/smartcontractkit/chainlink-protos/chainlink-ccv/message-rules v0.0.0- github.com/smartcontractkit/chainlink-protos/chainlink-ccv/message-rules v0.0.0-20260505131349-78e491b80735/go.mod h1:zAJq6Tpkx5AdFUwW67dIYnW+Bdf50drCCpMR81Qxb4E= github.com/smartcontractkit/chainlink-protos/chainlink-ccv/verifier v0.0.0-20251211142334-5c3421fe2c8d h1:AJy55QJ/pBhXkZjc7N+ATnWfxrcjq9BI9DmdtdjwDUQ= github.com/smartcontractkit/chainlink-protos/chainlink-ccv/verifier v0.0.0-20251211142334-5c3421fe2c8d/go.mod h1:5JdppgngCOUS76p61zCinSCgOhPeYQ+OcDUuome5THQ= -github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260804200254-c1accce563a8 h1:PuLjldCKeHUZf9JJzsX8aKEzqIJOpoY3wPeuGfm47C8= -github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260804200254-c1accce563a8/go.mod h1:/i8hjTPFdVWHiY+QjeSiVS2Z3GB3WAZznGgXHstC02E= +github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260916140808-f5d22b3cb3ee h1:drewC9gPerS+FDeaaSfG7YL1Zzt/0Jr6YQ1YvHXzz04= +github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260916140808-f5d22b3cb3ee/go.mod h1:/i8hjTPFdVWHiY+QjeSiVS2Z3GB3WAZznGgXHstC02E= github.com/smartcontractkit/chainlink-protos/data-feeds v0.1.1-0.20260501174546-2e8846986b36 h1:SG+wAsNyAcA6Kk19ljuxi3HK9Ll2lpHik8OKoY4x7A0= github.com/smartcontractkit/chainlink-protos/data-feeds v0.1.1-0.20260501174546-2e8846986b36/go.mod h1:vL1bDgPSJjV0EqHYs4dDlR+EEE0cJchgvGLYXhwIjXY= github.com/smartcontractkit/chainlink-protos/job-distributor v0.20.1-0.20260701185448-696c075849ea h1:gdA7tZgcRYMq3ryi7uNopYgn6s26g04Haw9SdmLRHzE= diff --git a/system-tests/tests/go.mod b/system-tests/tests/go.mod index b488fd10f77..e8ce1bb685e 100644 --- a/system-tests/tests/go.mod +++ b/system-tests/tests/go.mod @@ -68,7 +68,7 @@ require ( github.com/moby/moby/client v0.5.1 github.com/pkg/errors v0.9.1 github.com/rs/zerolog v1.35.1 - github.com/smartcontractkit/chain-selectors v1.0.109 + github.com/smartcontractkit/chain-selectors v1.0.111 github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20260908155618-50f521d70e62 github.com/smartcontractkit/chainlink-common v0.11.2-0.20260917115705-1d3a14a9b049 github.com/smartcontractkit/chainlink-common/keystore v1.3.1-0.20260903141829-ef07b52a737d @@ -78,7 +78,7 @@ require ( github.com/smartcontractkit/chainlink-evm/contracts/cre/gobindings v0.0.0-20260403151002-2c91155b5501 github.com/smartcontractkit/chainlink-evm/gethwrappers v0.0.0-20260713161920-de075095648b github.com/smartcontractkit/chainlink-framework/capabilities v0.0.0-20260423135514-5b1a7565a99c - github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260804200254-c1accce563a8 + github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260916140808-f5d22b3cb3ee github.com/smartcontractkit/chainlink-protos/ring/go v0.0.0-20260904122233-4d79005babd9 github.com/smartcontractkit/chainlink-protos/workflows/go v0.0.0-20260821155228-fa1d775e2138 github.com/smartcontractkit/chainlink-testing-framework/framework v0.16.8 @@ -281,7 +281,7 @@ require ( github.com/smartcontractkit/chainlink-canton/contracts/v2 v2.0.0 // indirect github.com/smartcontractkit/chainlink-ccip/chains/evm v0.0.0-20260908164107-3de1349d970b // indirect github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20260908155618-50f521d70e62 // indirect - github.com/smartcontractkit/chainlink-ccv v0.12.0 // indirect + github.com/smartcontractkit/chainlink-ccv v0.13.1-0.20260918171034-c93b0d2ef3c0 // indirect github.com/smartcontractkit/chainlink-data-streams v1.1.1 // indirect github.com/smartcontractkit/chainlink-feeds v0.1.2-0.20250227211209-7cd000095135 // indirect github.com/smartcontractkit/chainlink-protos/chainlink-ccv/committee-verifier v0.0.0-20251211142334-5c3421fe2c8d // indirect diff --git a/system-tests/tests/go.sum b/system-tests/tests/go.sum index 2544e69c3e1..f102afadd98 100644 --- a/system-tests/tests/go.sum +++ b/system-tests/tests/go.sum @@ -1815,8 +1815,8 @@ github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966 h1:JIAuq3EE github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966/go.mod h1:sUM3LWHvSMaG192sy56D9F7CNvL7jUJVXoqM1QKLnog= github.com/smartcontractkit/ccip-owner-contracts v0.2.1 h1:HgrVtzpyqrPCQiyIeoUKcPK/S+TQI76F3CNU6/hH+6s= github.com/smartcontractkit/ccip-owner-contracts v0.2.1/go.mod h1:dpKtlTVEKohsbhnPe/r1oLFqfq7TP7iKvMaUOiidAaM= -github.com/smartcontractkit/chain-selectors v1.0.109 h1:nM4bESP4OpJSdoHPSwS2+OyG+ef8pow3FAaYK6WXF6g= -github.com/smartcontractkit/chain-selectors v1.0.109/go.mod h1:qy7whtgG5g+7z0jt0nRyii9bLND9m15NZTzuQPkMZ5w= +github.com/smartcontractkit/chain-selectors v1.0.111 h1:urb/qOyRanxDn+Wras+LULHEHSlJ4tYnfeAHzeMBn5U= +github.com/smartcontractkit/chain-selectors v1.0.111/go.mod h1:qy7whtgG5g+7z0jt0nRyii9bLND9m15NZTzuQPkMZ5w= github.com/smartcontractkit/chainlink-aptos v0.0.0-20260828090428-9828cc37ebc2 h1:gIlepiEA6cYoYtIYHV0dsGwrarU5LlXhIZ+AhhPFtRY= github.com/smartcontractkit/chainlink-aptos v0.0.0-20260828090428-9828cc37ebc2/go.mod h1:zxbSVfmTCjxN2LdXeOhZS8T5wh6TVDGC40iliRsF62o= github.com/smartcontractkit/chainlink-aptos/codec v0.0.0-20260716230027-bd85997bc03c h1:aDS7I+SK9mWkDcWlfP5JrDY4NnicC/4KVm30dG7HQaw= @@ -1831,8 +1831,8 @@ github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20260908155618-5 github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20260908155618-50f521d70e62/go.mod h1:5snE6Mg2+wYIddLZ5NIUPno3mYa9edyV3EyXJnE54vw= github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20260908155618-50f521d70e62 h1:psQpY4BeoAH50S7QTX5fUhUYeYnM88jldPXRPXpXuvU= github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20260908155618-50f521d70e62/go.mod h1:c++Ed0jeYn4w8WIfiAboRwN6ClRRVGglL0qwB/QjJvM= -github.com/smartcontractkit/chainlink-ccv v0.12.0 h1:/EbL7S96ItC3YF9pZ/fihbxugYxT1xxLSQSFJT4JQoQ= -github.com/smartcontractkit/chainlink-ccv v0.12.0/go.mod h1:yijeTgli1K0e1noV/06/etKFxnYz8kBIe3IVXBaGnQw= +github.com/smartcontractkit/chainlink-ccv v0.13.1-0.20260918171034-c93b0d2ef3c0 h1:3f+Ijgr0vghawMUAitgFILQpt4KsoYHGv1Zb/YBeeQM= +github.com/smartcontractkit/chainlink-ccv v0.13.1-0.20260918171034-c93b0d2ef3c0/go.mod h1:gX7FJzSnGQx4RAlsn2rRW8IQBlEFZYiXFXEEB5jnQgA= github.com/smartcontractkit/chainlink-common v0.11.2-0.20260917115705-1d3a14a9b049 h1:WebE9HTubitMC5xq+xCAArEI+oBLekVOoxYnCkB8whI= github.com/smartcontractkit/chainlink-common v0.11.2-0.20260917115705-1d3a14a9b049/go.mod h1:3CaCxSyZmgWl1PhxneFSZqOfN7DF2VnHML0bTfiDNIo= github.com/smartcontractkit/chainlink-common/keystore v1.3.1-0.20260903141829-ef07b52a737d h1:M9xuiIvdiHtim4nlxCVajyC/Mk63tAg9ESWb/biAhNA= @@ -1875,8 +1875,8 @@ github.com/smartcontractkit/chainlink-protos/chainlink-ccv/message-rules v0.0.0- github.com/smartcontractkit/chainlink-protos/chainlink-ccv/message-rules v0.0.0-20260505131349-78e491b80735/go.mod h1:zAJq6Tpkx5AdFUwW67dIYnW+Bdf50drCCpMR81Qxb4E= github.com/smartcontractkit/chainlink-protos/chainlink-ccv/verifier v0.0.0-20251211142334-5c3421fe2c8d h1:AJy55QJ/pBhXkZjc7N+ATnWfxrcjq9BI9DmdtdjwDUQ= github.com/smartcontractkit/chainlink-protos/chainlink-ccv/verifier v0.0.0-20251211142334-5c3421fe2c8d/go.mod h1:5JdppgngCOUS76p61zCinSCgOhPeYQ+OcDUuome5THQ= -github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260804200254-c1accce563a8 h1:PuLjldCKeHUZf9JJzsX8aKEzqIJOpoY3wPeuGfm47C8= -github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260804200254-c1accce563a8/go.mod h1:/i8hjTPFdVWHiY+QjeSiVS2Z3GB3WAZznGgXHstC02E= +github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260916140808-f5d22b3cb3ee h1:drewC9gPerS+FDeaaSfG7YL1Zzt/0Jr6YQ1YvHXzz04= +github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260916140808-f5d22b3cb3ee/go.mod h1:/i8hjTPFdVWHiY+QjeSiVS2Z3GB3WAZznGgXHstC02E= github.com/smartcontractkit/chainlink-protos/data-feeds v0.1.1-0.20260501174546-2e8846986b36 h1:SG+wAsNyAcA6Kk19ljuxi3HK9Ll2lpHik8OKoY4x7A0= github.com/smartcontractkit/chainlink-protos/data-feeds v0.1.1-0.20260501174546-2e8846986b36/go.mod h1:vL1bDgPSJjV0EqHYs4dDlR+EEE0cJchgvGLYXhwIjXY= github.com/smartcontractkit/chainlink-protos/job-distributor v0.20.1-0.20260701185448-696c075849ea h1:gdA7tZgcRYMq3ryi7uNopYgn6s26g04Haw9SdmLRHzE=