feat(utils): introduce ExecuteOnChainSequenceAndMerge#1041
Conversation
🦋 Changeset detectedLatest commit: d169a8e The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
Pull request overview
This PR introduces a small sequenceutils helper for running multiple operations.Sequence instances that return OnChainOutput and accumulating their results into a single OnChainOutput, along with unit tests validating key merge behaviors.
Changes:
- Added
ExecuteOnChainSequenceAndMergeutility to execute a sequence and merge itsOnChainOutputinto an accumulator. - Added tests covering success, execution failure preservation, non-deduping behavior, and env metadata conflict behavior.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| changeset/sequenceutils/merge.go | Adds the merge utility for aggregating OnChainOutput across multiple sequence executions. |
| changeset/sequenceutils/merge_test.go | Adds unit tests for merge behavior and error handling. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
2f1eb9d to
570e897
Compare
570e897 to
810c31a
Compare
Introduced ExecuteOnChainSequenceAndMerge util which originated from ccip tooling api [here](https://github.com/smartcontractkit/chainlink-ccip/blob/298ed1c38d5cda61a688beb2494a96a5409daf3d/deployment/utils/sequences/sequences.go#L46) This utils allows user to execute multiple sequence and accumulate their results into an object call OnChainOutput JIRA: https://smartcontract-it.atlassian.net/browse/CLD-2464
810c31a to
d169a8e
Compare
|
| deps DEP, | ||
| seq *operations.Sequence[IN, OnChainOutput, DEP], | ||
| input IN, |
There was a problem hiding this comment.
I'm finding the ordering of arguments here unintiutive (seq, deps, input would be better to me) but I assume that this keeps it backwards compatible.
Not a blocker though
There was a problem hiding this comment.
ah yes, the sequence generic type ordering has always been like this
type Sequence[IN, OUT, DEP any] struct {
def Definition
handler SequenceHandler[IN, OUT, DEP]
}



Introduced ExecuteOnChainSequenceAndMerge util which originated from ccip tooling api here
This utils allows user to execute multiple sequence and accumulate their results into an object call OnChainOutput
JIRA: https://smartcontract-it.atlassian.net/browse/CLD-2464