Skip to content

Commit

Permalink
move to iter
Browse files Browse the repository at this point in the history
  • Loading branch information
ettec committed Nov 26, 2024
1 parent 4ec1024 commit 9f85257
Show file tree
Hide file tree
Showing 11 changed files with 34 additions and 22 deletions.
4 changes: 2 additions & 2 deletions core/scripts/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/smartcontractkit/chainlink/core/scripts

go 1.23
go 1.23.3

// Make sure we're working with the latest chainlink libs
replace github.com/smartcontractkit/chainlink/v2 => ../../
Expand All @@ -24,7 +24,7 @@ require (
github.com/prometheus/client_golang v1.20.5
github.com/shopspring/decimal v1.4.0
github.com/smartcontractkit/chainlink-automation v0.8.1
github.com/smartcontractkit/chainlink-common v0.3.1-0.20241126100903-24c6b95df9f8
github.com/smartcontractkit/chainlink-common v0.3.1-0.20241126153508-6f982e48d4df
github.com/smartcontractkit/chainlink/deployment v0.0.0-00010101000000-000000000000
github.com/smartcontractkit/chainlink/v2 v2.14.0-mercury-20240807.0.20241106193309-5560cd76211a
github.com/smartcontractkit/libocr v0.0.0-20241007185508-adbe57025f12
Expand Down
4 changes: 2 additions & 2 deletions core/scripts/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1094,8 +1094,8 @@ github.com/smartcontractkit/chainlink-automation v0.8.1 h1:sTc9LKpBvcKPc1JDYAmgB
github.com/smartcontractkit/chainlink-automation v0.8.1/go.mod h1:Iij36PvWZ6blrdC5A/nrQUBuf3MH3JvsBB9sSyc9W08=
github.com/smartcontractkit/chainlink-ccip v0.0.0-20241118091009-43c2b4804cec h1:5vS1k8Qn09p8SQ3JzvS8iy4Pve7s3aVq+UPIdl74smY=
github.com/smartcontractkit/chainlink-ccip v0.0.0-20241118091009-43c2b4804cec/go.mod h1:4adKaHNaxFsRvV/lYfqtbsWyyvIPUMLR0FdOJN/ljis=
github.com/smartcontractkit/chainlink-common v0.3.1-0.20241126100903-24c6b95df9f8 h1:LK6aYkiW9lGS6q67kcJ6hJbG6JWURFvOdkajldo+sFk=
github.com/smartcontractkit/chainlink-common v0.3.1-0.20241126100903-24c6b95df9f8/go.mod h1:ny87uTW6hLjCTLiBqBRNFEhETSXhHWevYlPclT5lSco=
github.com/smartcontractkit/chainlink-common v0.3.1-0.20241126153508-6f982e48d4df h1:Q/0MmxA39DEi8+BfAM4O6NjkaNer5K3YQTI4E4AoM/k=
github.com/smartcontractkit/chainlink-common v0.3.1-0.20241126153508-6f982e48d4df/go.mod h1:bQktEJf7sJ0U3SmIcXvbGUox7SmXcnSEZ4kUbT8R5Nk=
github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f h1:BwrIaQIx5Iy6eT+DfLhFfK2XqjxRm74mVdlX8gbu4dw=
github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f/go.mod h1:wHtwSR3F1CQSJJZDQKuqaqFYnvkT+kMyget7dl8Clvo=
github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241114154055-8d29ea018b57 h1:1BMTG66HnCIz+KMBWGvyzELNM6VHGwv2WKFhN7H49Sg=
Expand Down
16 changes: 14 additions & 2 deletions core/services/relay/evm/chain_reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"errors"
"fmt"
"iter"
"maps"
"slices"
"strings"
Expand Down Expand Up @@ -299,7 +300,7 @@ func (cr *chainReader) QueryKey(
}

func (cr *chainReader) QueryKeys(ctx context.Context, filters []commontypes.ContractKeyFilter,
limitAndSort query.LimitAndSort) ([]commontypes.SequenceWithKey, error) {
limitAndSort query.LimitAndSort) (iter.Seq2[string, commontypes.Sequence], error) {
eventQueries := make([]read.EventQuery, 0, len(filters))
for _, filter := range filters {
binding, address, err := cr.bindings.GetReader(filter.Contract.ReadIdentifier(filter.KeyFilter.Key))
Expand Down Expand Up @@ -330,7 +331,18 @@ func (cr *chainReader) QueryKeys(ctx context.Context, filters []commontypes.Cont
})
}

return read.MultiEventTypeQuery(ctx, cr.lp, eventQueries, limitAndSort)
sequenceWithKeys, err := read.MultiEventTypeQuery(ctx, cr.lp, eventQueries, limitAndSort)
if err != nil {
return nil, err
}

return func(yield func(string, commontypes.Sequence) bool) {
for _, s := range sequenceWithKeys {
if !yield(s.Key, s.Sequence) {
return
}
}
}, nil
}

func (cr *chainReader) CreateContractType(readIdentifier string, forEncoding bool) (any, error) {
Expand Down
4 changes: 2 additions & 2 deletions deployment/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/smartcontractkit/chainlink/deployment

go 1.23
go 1.23.3

// Make sure we're working with the latest chainlink libs
replace github.com/smartcontractkit/chainlink/v2 => ../
Expand All @@ -23,7 +23,7 @@ require (
github.com/smartcontractkit/ccip-owner-contracts v0.0.0-20240926212305-a6deabdfce86
github.com/smartcontractkit/chain-selectors v1.0.31
github.com/smartcontractkit/chainlink-ccip v0.0.0-20241118091009-43c2b4804cec
github.com/smartcontractkit/chainlink-common v0.3.1-0.20241126100903-24c6b95df9f8
github.com/smartcontractkit/chainlink-common v0.3.1-0.20241126153508-6f982e48d4df
github.com/smartcontractkit/chainlink-protos/job-distributor v0.6.0
github.com/smartcontractkit/chainlink-testing-framework/lib v1.50.13
github.com/smartcontractkit/chainlink/v2 v2.0.0-00010101000000-000000000000
Expand Down
4 changes: 2 additions & 2 deletions deployment/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1384,8 +1384,8 @@ github.com/smartcontractkit/chainlink-automation v0.8.1 h1:sTc9LKpBvcKPc1JDYAmgB
github.com/smartcontractkit/chainlink-automation v0.8.1/go.mod h1:Iij36PvWZ6blrdC5A/nrQUBuf3MH3JvsBB9sSyc9W08=
github.com/smartcontractkit/chainlink-ccip v0.0.0-20241118091009-43c2b4804cec h1:5vS1k8Qn09p8SQ3JzvS8iy4Pve7s3aVq+UPIdl74smY=
github.com/smartcontractkit/chainlink-ccip v0.0.0-20241118091009-43c2b4804cec/go.mod h1:4adKaHNaxFsRvV/lYfqtbsWyyvIPUMLR0FdOJN/ljis=
github.com/smartcontractkit/chainlink-common v0.3.1-0.20241126100903-24c6b95df9f8 h1:LK6aYkiW9lGS6q67kcJ6hJbG6JWURFvOdkajldo+sFk=
github.com/smartcontractkit/chainlink-common v0.3.1-0.20241126100903-24c6b95df9f8/go.mod h1:ny87uTW6hLjCTLiBqBRNFEhETSXhHWevYlPclT5lSco=
github.com/smartcontractkit/chainlink-common v0.3.1-0.20241126153508-6f982e48d4df h1:Q/0MmxA39DEi8+BfAM4O6NjkaNer5K3YQTI4E4AoM/k=
github.com/smartcontractkit/chainlink-common v0.3.1-0.20241126153508-6f982e48d4df/go.mod h1:bQktEJf7sJ0U3SmIcXvbGUox7SmXcnSEZ4kUbT8R5Nk=
github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f h1:BwrIaQIx5Iy6eT+DfLhFfK2XqjxRm74mVdlX8gbu4dw=
github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f/go.mod h1:wHtwSR3F1CQSJJZDQKuqaqFYnvkT+kMyget7dl8Clvo=
github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241114154055-8d29ea018b57 h1:1BMTG66HnCIz+KMBWGvyzELNM6VHGwv2WKFhN7H49Sg=
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/smartcontractkit/chainlink/v2

go 1.23
go 1.23.3

require (
github.com/Depado/ginprom v1.8.0
Expand Down Expand Up @@ -77,7 +77,7 @@ require (
github.com/smartcontractkit/chain-selectors v1.0.31
github.com/smartcontractkit/chainlink-automation v0.8.1
github.com/smartcontractkit/chainlink-ccip v0.0.0-20241118091009-43c2b4804cec
github.com/smartcontractkit/chainlink-common v0.3.1-0.20241126100903-24c6b95df9f8
github.com/smartcontractkit/chainlink-common v0.3.1-0.20241126153508-6f982e48d4df
github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f
github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241114154055-8d29ea018b57
github.com/smartcontractkit/chainlink-feeds v0.1.1
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1078,8 +1078,8 @@ github.com/smartcontractkit/chainlink-automation v0.8.1 h1:sTc9LKpBvcKPc1JDYAmgB
github.com/smartcontractkit/chainlink-automation v0.8.1/go.mod h1:Iij36PvWZ6blrdC5A/nrQUBuf3MH3JvsBB9sSyc9W08=
github.com/smartcontractkit/chainlink-ccip v0.0.0-20241118091009-43c2b4804cec h1:5vS1k8Qn09p8SQ3JzvS8iy4Pve7s3aVq+UPIdl74smY=
github.com/smartcontractkit/chainlink-ccip v0.0.0-20241118091009-43c2b4804cec/go.mod h1:4adKaHNaxFsRvV/lYfqtbsWyyvIPUMLR0FdOJN/ljis=
github.com/smartcontractkit/chainlink-common v0.3.1-0.20241126100903-24c6b95df9f8 h1:LK6aYkiW9lGS6q67kcJ6hJbG6JWURFvOdkajldo+sFk=
github.com/smartcontractkit/chainlink-common v0.3.1-0.20241126100903-24c6b95df9f8/go.mod h1:ny87uTW6hLjCTLiBqBRNFEhETSXhHWevYlPclT5lSco=
github.com/smartcontractkit/chainlink-common v0.3.1-0.20241126153508-6f982e48d4df h1:Q/0MmxA39DEi8+BfAM4O6NjkaNer5K3YQTI4E4AoM/k=
github.com/smartcontractkit/chainlink-common v0.3.1-0.20241126153508-6f982e48d4df/go.mod h1:bQktEJf7sJ0U3SmIcXvbGUox7SmXcnSEZ4kUbT8R5Nk=
github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f h1:BwrIaQIx5Iy6eT+DfLhFfK2XqjxRm74mVdlX8gbu4dw=
github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f/go.mod h1:wHtwSR3F1CQSJJZDQKuqaqFYnvkT+kMyget7dl8Clvo=
github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241114154055-8d29ea018b57 h1:1BMTG66HnCIz+KMBWGvyzELNM6VHGwv2WKFhN7H49Sg=
Expand Down
4 changes: 2 additions & 2 deletions integration-tests/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/smartcontractkit/chainlink/integration-tests

go 1.23
go 1.23.3

// Make sure we're working with the latest chainlink libs
replace github.com/smartcontractkit/chainlink/v2 => ../
Expand Down Expand Up @@ -38,7 +38,7 @@ require (
github.com/smartcontractkit/chain-selectors v1.0.31
github.com/smartcontractkit/chainlink-automation v0.8.1
github.com/smartcontractkit/chainlink-ccip v0.0.0-20241118091009-43c2b4804cec
github.com/smartcontractkit/chainlink-common v0.3.1-0.20241126100903-24c6b95df9f8
github.com/smartcontractkit/chainlink-common v0.3.1-0.20241126153508-6f982e48d4df
github.com/smartcontractkit/chainlink-testing-framework/havoc v1.50.2
github.com/smartcontractkit/chainlink-testing-framework/lib v1.50.16
github.com/smartcontractkit/chainlink-testing-framework/lib/grafana v1.50.0
Expand Down
4 changes: 2 additions & 2 deletions integration-tests/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1405,8 +1405,8 @@ github.com/smartcontractkit/chainlink-automation v0.8.1 h1:sTc9LKpBvcKPc1JDYAmgB
github.com/smartcontractkit/chainlink-automation v0.8.1/go.mod h1:Iij36PvWZ6blrdC5A/nrQUBuf3MH3JvsBB9sSyc9W08=
github.com/smartcontractkit/chainlink-ccip v0.0.0-20241118091009-43c2b4804cec h1:5vS1k8Qn09p8SQ3JzvS8iy4Pve7s3aVq+UPIdl74smY=
github.com/smartcontractkit/chainlink-ccip v0.0.0-20241118091009-43c2b4804cec/go.mod h1:4adKaHNaxFsRvV/lYfqtbsWyyvIPUMLR0FdOJN/ljis=
github.com/smartcontractkit/chainlink-common v0.3.1-0.20241126100903-24c6b95df9f8 h1:LK6aYkiW9lGS6q67kcJ6hJbG6JWURFvOdkajldo+sFk=
github.com/smartcontractkit/chainlink-common v0.3.1-0.20241126100903-24c6b95df9f8/go.mod h1:ny87uTW6hLjCTLiBqBRNFEhETSXhHWevYlPclT5lSco=
github.com/smartcontractkit/chainlink-common v0.3.1-0.20241126153508-6f982e48d4df h1:Q/0MmxA39DEi8+BfAM4O6NjkaNer5K3YQTI4E4AoM/k=
github.com/smartcontractkit/chainlink-common v0.3.1-0.20241126153508-6f982e48d4df/go.mod h1:bQktEJf7sJ0U3SmIcXvbGUox7SmXcnSEZ4kUbT8R5Nk=
github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f h1:BwrIaQIx5Iy6eT+DfLhFfK2XqjxRm74mVdlX8gbu4dw=
github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f/go.mod h1:wHtwSR3F1CQSJJZDQKuqaqFYnvkT+kMyget7dl8Clvo=
github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241114154055-8d29ea018b57 h1:1BMTG66HnCIz+KMBWGvyzELNM6VHGwv2WKFhN7H49Sg=
Expand Down
4 changes: 2 additions & 2 deletions integration-tests/load/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/smartcontractkit/chainlink/load-tests

go 1.23
go 1.23.3

// Make sure we're working with the latest chainlink libs
replace github.com/smartcontractkit/chainlink/v2 => ../../
Expand All @@ -17,7 +17,7 @@ require (
github.com/pkg/errors v0.9.1
github.com/rs/zerolog v1.33.0
github.com/slack-go/slack v0.15.0
github.com/smartcontractkit/chainlink-common v0.3.1-0.20241126100903-24c6b95df9f8
github.com/smartcontractkit/chainlink-common v0.3.1-0.20241126153508-6f982e48d4df
github.com/smartcontractkit/chainlink-testing-framework/lib v1.50.16
github.com/smartcontractkit/chainlink-testing-framework/seth v1.50.9
github.com/smartcontractkit/chainlink-testing-framework/wasp v1.50.2
Expand Down
4 changes: 2 additions & 2 deletions integration-tests/load/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1394,8 +1394,8 @@ github.com/smartcontractkit/chainlink-automation v0.8.1 h1:sTc9LKpBvcKPc1JDYAmgB
github.com/smartcontractkit/chainlink-automation v0.8.1/go.mod h1:Iij36PvWZ6blrdC5A/nrQUBuf3MH3JvsBB9sSyc9W08=
github.com/smartcontractkit/chainlink-ccip v0.0.0-20241118091009-43c2b4804cec h1:5vS1k8Qn09p8SQ3JzvS8iy4Pve7s3aVq+UPIdl74smY=
github.com/smartcontractkit/chainlink-ccip v0.0.0-20241118091009-43c2b4804cec/go.mod h1:4adKaHNaxFsRvV/lYfqtbsWyyvIPUMLR0FdOJN/ljis=
github.com/smartcontractkit/chainlink-common v0.3.1-0.20241126100903-24c6b95df9f8 h1:LK6aYkiW9lGS6q67kcJ6hJbG6JWURFvOdkajldo+sFk=
github.com/smartcontractkit/chainlink-common v0.3.1-0.20241126100903-24c6b95df9f8/go.mod h1:ny87uTW6hLjCTLiBqBRNFEhETSXhHWevYlPclT5lSco=
github.com/smartcontractkit/chainlink-common v0.3.1-0.20241126153508-6f982e48d4df h1:Q/0MmxA39DEi8+BfAM4O6NjkaNer5K3YQTI4E4AoM/k=
github.com/smartcontractkit/chainlink-common v0.3.1-0.20241126153508-6f982e48d4df/go.mod h1:bQktEJf7sJ0U3SmIcXvbGUox7SmXcnSEZ4kUbT8R5Nk=
github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f h1:BwrIaQIx5Iy6eT+DfLhFfK2XqjxRm74mVdlX8gbu4dw=
github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f/go.mod h1:wHtwSR3F1CQSJJZDQKuqaqFYnvkT+kMyget7dl8Clvo=
github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241114154055-8d29ea018b57 h1:1BMTG66HnCIz+KMBWGvyzELNM6VHGwv2WKFhN7H49Sg=
Expand Down

0 comments on commit 9f85257

Please sign in to comment.