[OPDATA-6166] Returning calculated-multi-function as a decimal with no scalar#4787
Closed
chray-zhang wants to merge 4 commits intomainfrom
Closed
[OPDATA-6166] Returning calculated-multi-function as a decimal with no scalar#4787chray-zhang wants to merge 4 commits intomainfrom
chray-zhang wants to merge 4 commits intomainfrom
Conversation
🦋 Changeset detectedLatest commit: ebbc179 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 |
Contributor
There was a problem hiding this comment.
Pull request overview
Adds optional decimal scaling support to the calculated-multi-function endpoint in the view-function multi-chain adapter, changing how EVM call results are decoded/returned.
Changes:
- Added optional
decimalsinput to scale single-return EVM results usingethers.formatUnits. - Updated transport to decode single-return function outputs into decimal strings (and keep raw hex for multi-return).
- Added integration tests + snapshot updates and a changeset entry.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/sources/view-function-multi-chain/src/transport/calculated-multi-function.ts | Decodes EVM call results; adds decimal scaling logic and changes single-output return format. |
| packages/sources/view-function-multi-chain/src/endpoint/calculated-multi-function.ts | Adds decimals as an optional request parameter for function calls. |
| packages/sources/view-function-multi-chain/test/integration/adapter.test.ts | Adds integration tests for decimals scaling and decimals=0 behavior. |
| packages/sources/view-function-multi-chain/test/integration/snapshots/adapter.test.ts.snap | Updates snapshots to reflect decoded decimal output and new decimals-scaling cases. |
| .changeset/jolly-maps-cross.md | Declares a version bump for the adapter package. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
packages/sources/view-function-multi-chain/src/transport/calculated-multi-function.ts
Outdated
Show resolved
Hide resolved
packages/sources/view-function-multi-chain/src/endpoint/calculated-multi-function.ts
Outdated
Show resolved
Hide resolved
packages/sources/view-function-multi-chain/src/transport/calculated-multi-function.ts
Outdated
Show resolved
Hide resolved
Contributor
|
Do we need this? Can't we just multiply? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes OPDATA-6166
Description
Steps to Test
Quality Assurance
infra-k8sconfiguration file.adapter-secretsconfiguration file.test-payload.jsonfile with relevant requests.feature/x,chore/x,release/x,hotfix/x,fix/x) or is created from Jira.