fix: increments in upf converter TxNonce calculation#561
Conversation
🦋 Changeset detectedLatest commit: dc7cfe5 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 |
1e9906e to
dc7cfe5
Compare
|
There was a problem hiding this comment.
Pull Request Overview
This PR fixes a bug in the upf converter's txNonce calculation where values were incorrectly incremented by 1. The fix moves the increment operation inside the for loop to occur after the index check, ensuring nonce values start at 1 instead of 2.
- Fixed off-by-one error in
calculateOpCountfunction - Updated test expectations to reflect correct txNonce values
- Refactored test helper functions for better reusability
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| experimental/analyzer/upf/upf.go | Corrected the order of operations in calculateOpCount to fix txNonce calculation |
| experimental/analyzer/upf/upf_test.go | Updated expected txNonce values in test cases and refactored helper functions |
| .changeset/beige-sites-lie.md | Added changeset documenting the fix |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated. # Releases ## chainlink-deployments-framework@0.63.0 ### Minor Changes - [#560](#560) [`ed679a7`](ed679a7) Thanks [@huangzhen1997](https://github.com/huangzhen1997)! - bump sui binding version ### Patch Changes - [#561](#561) [`280ce37`](280ce37) Thanks [@gustavogama-cll](https://github.com/gustavogama-cll)! - fix: computation of the txNonce attribute in the upf converter --------- Co-authored-by: app-token-issuer-engops[bot] <144731339+app-token-issuer-engops[bot]@users.noreply.github.com>




The calculation of the txNonce values used by the upf converter was broken. It always added
1to the expected value. This patch simply moves the increment operation inside the for loop and fixes the respective tests.